Search in sources :

Example 21 with StringOption

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;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 22 with StringOption

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;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 23 with StringOption

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;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 24 with StringOption

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;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 25 with StringOption

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;
}
Also used : StringOption(util.StringOption) URI(java.net.URI)

Aggregations

StringOption (util.StringOption)44 ArrayList (java.util.ArrayList)26 StorageSystemTypeRestRep (com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep)20 StorageSystemTypeList (com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)19 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)4 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)3 FlashException (controllers.util.FlashException)3 ComputeImageServerRestRep (com.emc.storageos.model.compute.ComputeImageServerRestRep)2 ComputeSystemRestRep (com.emc.storageos.model.compute.ComputeSystemRestRep)2 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 URI (java.net.URI)2 DataObjectRestRep (com.emc.storageos.model.DataObjectRestRep)1 AuthnProviderRestRep (com.emc.storageos.model.auth.AuthnProviderRestRep)1 CustomServicesPrimitiveResourceList (com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList)1 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)1 BucketRestRep (com.emc.storageos.model.object.BucketRestRep)1 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 ComputeVirtualPoolRestRep (com.emc.storageos.model.vpool.ComputeVirtualPoolRestRep)1 TruststoreSettings (com.emc.vipr.model.keystore.TruststoreSettings)1