use of com.microsoft.tooling.msservices.model.storage.ClientStorageAccount in project azure-tools-for-java by Microsoft.
the class ExternalStorageAccountForm method getFullStorageAccount.
public ClientStorageAccount getFullStorageAccount() {
ClientStorageAccount clientStorageAccount = new ClientStorageAccount(accountNameTextField.getText());
clientStorageAccount.setPrimaryKey(accountKeyTextField.getText());
clientStorageAccount.setUseCustomEndpoints(specifyCustomEndpointsRadioButton.isSelected());
if (specifyCustomEndpointsRadioButton.isSelected()) {
clientStorageAccount.setBlobsUri(blobURLTextField.getText());
clientStorageAccount.setQueuesUri(queueURLTextField.getText());
clientStorageAccount.setTablesUri(tableURLTextField.getText());
} else {
clientStorageAccount.setProtocol(useHTTPRadioButton.isSelected() ? HTTP : HTTPS);
}
return clientStorageAccount;
}
use of com.microsoft.tooling.msservices.model.storage.ClientStorageAccount in project azure-tools-for-java by Microsoft.
the class ExternalStorageHelper method getList.
public static List<ClientStorageAccount> getList(Object projectObject) {
List<ClientStorageAccount> list = new ArrayList<ClientStorageAccount>();
String[] storageArray = DefaultLoader.getIdeHelper().getProperties(EXTERNAL_STORAGE_LIST, projectObject);
if (storageArray != null) {
for (String json : storageArray) {
ClientStorageAccount clientStorageAccount = new Gson().fromJson(json, ClientStorageAccount.class);
list.add(clientStorageAccount);
}
}
return list;
}
use of com.microsoft.tooling.msservices.model.storage.ClientStorageAccount in project azure-tools-for-java by Microsoft.
the class AttachExternalStorageAccountAction method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
final ExternalStorageAccountForm form = new ExternalStorageAccountForm(PluginUtil.getParentShell(), "Attach External Storage Account");
form.setOnFinish(new Runnable() {
@Override
public void run() {
DefaultLoader.getIdeHelper().invokeLater(new Runnable() {
public void run() {
ClientStorageAccount storageAccount = form.getStorageAccount();
ClientStorageAccount fullStorageAccount = form.getFullStorageAccount();
for (ClientStorageAccount clientStorageAccount : ExternalStorageHelper.getList(null)) {
String name = storageAccount.getName();
if (clientStorageAccount.getName().equals(name)) {
DefaultLoader.getUIHelper().showError("Storage account with name '" + name + "' already exists.", "Service Explorer");
return;
}
}
ExternalStorageNode node = new ExternalStorageNode(storageModule, fullStorageAccount);
storageModule.addChildNode(node);
ExternalStorageHelper.add(storageAccount);
}
});
}
});
form.open();
}
Aggregations