use of com.microsoft.azuretools.telemetry.TelemetryConstants.STORAGE in project azure-tools-for-java by Microsoft.
the class CreateBlobContainerForm method doOKAction.
@Override
protected void doOKAction() {
final String name = nameTextField.getText();
// Field outerFiele = onCreate.getClass().getDeclaredField("this$0");
final AzureString title = AzureOperationBundle.title("blob.create", name);
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false, () -> {
EventUtil.executeWithLog(STORAGE, CREATE_BLOB_CONTAINER, (operation) -> {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
List<BlobContainer> blobs = StorageClientSDKManager.getManager().getBlobContainers(connectionString);
for (BlobContainer blobContainer : blobs) {
if (blobContainer.getName().equals(name)) {
AzureTaskManager.getInstance().runLater(() -> {
DefaultLoader.getUIHelper().showError("A blob container with the specified name already exists.", "Azure Explorer");
});
return;
}
}
BlobContainer blobContainer = new BlobContainer(name, "", /*storageAccount.getBlobsUri() + name*/
"", Calendar.getInstance(), "");
StorageClientSDKManager.getManager().createBlobContainer(connectionString, blobContainer);
if (onCreate != null) {
AzureTaskManager.getInstance().runLater(onCreate);
}
}, (e) -> {
String msg = "An error occurred while attempting to create blob container." + "\n" + String.format(message("webappExpMsg"), e.getMessage());
PluginUtil.displayErrorDialogAndLog(message("errTtl"), msg, e);
});
}));
sendTelemetry(OK_EXIT_CODE);
this.close(DialogWrapper.OK_EXIT_CODE, true);
}
use of com.microsoft.azuretools.telemetry.TelemetryConstants.STORAGE in project azure-tools-for-java by Microsoft.
the class CreateArmStorageAccountAction method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
SignInCommandHandler.requireSignedIn(PluginUtil.getParentShell(), () -> {
CreateArmStorageAccountForm createStorageAccountForm = new CreateArmStorageAccountForm(PluginUtil.getParentShell(), null, null);
createStorageAccountForm.setOnCreate(() -> {
AzureTaskManager.getInstance().runInBackground("Creating storage account " + createStorageAccountForm.getStorageAccount().getName() + "...", new Runnable() {
@Override
public void run() {
EventUtil.executeWithLog(STORAGE, CREATE_STORAGE_ACCOUNT, (operation) -> {
createStorageAccount(createStorageAccountForm.getStorageAccount());
storageModule.load(false);
}, (e) -> AzureTaskManager.getInstance().runLater(() -> PluginUtil.displayErrorDialog(PluginUtil.getParentShell(), Messages.err, "An error occurred while creating the storage account: " + e.getMessage())));
}
});
});
createStorageAccountForm.open();
});
}
Aggregations