use of com.microsoft.tooling.msservices.model.storage.Queue in project azure-tools-for-java by Microsoft.
the class QueueExplorerFileEditorProvider method accept.
@Override
public boolean accept(@NotNull Project project, @NotNull VirtualFile virtualFile) {
StorageAccount storageAccount = virtualFile.getUserData(UIHelperImpl.STORAGE_KEY);
Queue queue = virtualFile.getUserData(QUEUE_KEY);
return (storageAccount != null && queue != null);
}
use of com.microsoft.tooling.msservices.model.storage.Queue in project azure-tools-for-java by Microsoft.
the class CreateQueueForm method okPressed.
@Override
protected void okPressed() {
final String name = nameTextField.getText();
if (name.length() < NAME_MIN || name.length() > NAME_MAX || !name.matches(NAME_REGEX)) {
DefaultLoader.getUIHelper().showError("Queue names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.\n" + "Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names.\n" + "All letters in a container name must be lowercase.\n" + "Queue names must be from 3 through 63 characters long.", "Azure Explorer");
return;
}
DefaultLoader.getIdeHelper().runInBackground(null, "Creating queue...", false, true, "Creating queue...", new Runnable() {
public void run() {
// try {
/*for (Queue queue : StorageClientSDKManager.getManager().getQueues(storageAccount)) {
if (queue.getName().equals(name)) {
DefaultLoader.getIdeHelper().invokeLater(new Runnable() {
@Override
public void run() {
DefaultLoader.getUIHelper().showError("A queue with the specified name already exists.", "Azure Explorer");
}
});
return;
}
}
*/
Queue queue = new Queue(name, "", 0);
if (onCreate != null) {
DefaultLoader.getIdeHelper().invokeLater(onCreate);
}
// } catch (AzureCmdException e) {
// DefaultLoader.getUIHelper().showException("Error creating table", e, "Azure explorer", false, true);
// }
}
});
super.okPressed();
}
use of com.microsoft.tooling.msservices.model.storage.Queue in project azure-tools-for-java by Microsoft.
the class StorageClientSDKManager method getQueues.
@NotNull
public List<Queue> getQueues(@NotNull StorageAccount storageAccount) throws AzureCmdException {
List<Queue> qList = new ArrayList<Queue>();
try {
CloudQueueClient client = getCloudQueueClient(storageAccount);
for (CloudQueue cloudQueue : client.listQueues(null, QueueListingDetails.ALL, null, null)) {
String uri = cloudQueue.getUri() != null ? cloudQueue.getUri().toString() : "";
qList.add(new Queue(Strings.nullToEmpty(cloudQueue.getName()), uri, cloudQueue.getApproximateMessageCount()));
}
return qList;
} catch (Throwable t) {
throw new AzureCmdException("Error retrieving the Queue list", t);
}
}
use of com.microsoft.tooling.msservices.model.storage.Queue in project azure-tools-for-java by Microsoft.
the class QueueExplorerFileEditorProvider method createEditor.
@NotNull
@Override
public FileEditor createEditor(@NotNull Project project, @NotNull VirtualFile virtualFile) {
QueueFileEditor queueFileEditor = new QueueFileEditor(project);
StorageAccount storageAccount = virtualFile.getUserData(UIHelperImpl.STORAGE_KEY);
Queue queue = virtualFile.getUserData(QUEUE_KEY);
queueFileEditor.setQueue(queue);
// queueFileEditor.setStorageAccount(storageAccount);
queueFileEditor.fillGrid();
return queueFileEditor;
}
Aggregations