use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystemTypes method getBlockStorageOptions.
public static List<StringOption> getBlockStorageOptions() {
List<StringOption> options = new ArrayList<StringOption>(Arrays.asList(StringOption.NONE_OPTION));
StorageSystemTypeList typeList = StorageSystemTypeUtils.getAllStorageSystemTypes(StorageSystemTypeUtils.ALL_TYPE);
for (StorageSystemTypeRestRep type : typeList.getStorageSystemTypes()) {
// ignore those whose type is not block
if (!StorageSystemTypeUtils.BLOCK_TYPE.equalsIgnoreCase(type.getMetaType()) && !StorageSystemTypeUtils.BLOCK_AND_FILE_TYPE.equalsIgnoreCase(type.getMetaType())) {
continue;
}
// no need further check for non-SMIS providers
if (!type.getIsSmiProvider()) {
options.add(new StringOption(type.getStorageTypeName(), type.getStorageTypeDispName()));
continue;
}
if ((StringUtils.equals(SCALEIO, type.getStorageTypeName()) || StringUtils.equals(IBMXIV, type.getStorageTypeName()) || StringUtils.equals(XTREMIO, type.getStorageTypeName())) || StringUtils.equals(CEPH, type.getStorageTypeName())) {
options.add(new StringOption(type.getStorageTypeName(), type.getStorageTypeDispName()));
}
}
return options;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystemTypes method getProvidersWithoutSSL.
public static List<StringOption> getProvidersWithoutSSL() {
String alltypes = "all";
List<StringOption> allproviders = new ArrayList<StringOption>();
StorageSystemTypeList storagetypelist = StorageSystemTypeUtils.getAllStorageSystemTypes(alltypes);
for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
if (!storagetypeRest.getIsDefaultSsl()) {
allproviders.add(new StringOption(storagetypeRest.getStorageTypeName(), storagetypeRest.getStorageTypeDispName()));
}
}
return allproviders;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystemTypes method getObjectStorageOptions.
public static List<StringOption> getObjectStorageOptions() {
List<StringOption> options = new ArrayList<StringOption>(Arrays.asList(StringOption.NONE_OPTION));
StorageSystemTypeList typeList = StorageSystemTypeUtils.getAllStorageSystemTypes(StorageSystemTypeUtils.ALL_TYPE);
for (StorageSystemTypeRestRep type : typeList.getStorageSystemTypes()) {
if (!StorageSystemTypeUtils.OBJECT_TYPE.equalsIgnoreCase(type.getMetaType())) {
continue;
}
options.add(new StringOption(type.getStorageTypeName(), type.getStorageTypeDispName()));
}
return options;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class StorageSystemTypes method getProvidersWithSecretKey.
public static List<StringOption> getProvidersWithSecretKey() {
String alltypes = "all";
List<StringOption> allproviders = new ArrayList<StringOption>();
StorageSystemTypeList storagetypelist = StorageSystemTypeUtils.getAllStorageSystemTypes(alltypes);
for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
if (storagetypeRest.getIsSecretKey()) {
allproviders.add(new StringOption(storagetypeRest.getStorageTypeName(), storagetypeRest.getStorageTypeDispName()));
}
}
return allproviders;
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class Events method getAccessibleTenants.
/**
* Returns the tenants that the logged in user has access to
*
* @return list of tenants
*/
private static Set<URI> getAccessibleTenants() {
List<StringOption> tenants = Lists.newArrayList();
if (Security.isSecurityAdmin()) {
tenants = TenantUtils.getSubTenantOptions();
} else if (Security.isTenantAdmin()) {
tenants = TenantUtils.getUserSubTenantOptions();
}
Set<URI> results = Sets.newHashSet();
for (StringOption tenant : tenants) {
results.add(URI.create(tenant.id));
}
results.add(TenantUtils.getUserTenant().getId());
return results;
}
Aggregations