Search in sources :

Example 1 with SupportedReplication

use of com.emc.storageos.storagedriver.model.StorageSystem.SupportedReplication in project coprhd-controller by CoprHD.

the class DellSCUtil method getStorageSystemFromStorageCenter.

/**
 * Populate a StorageSystem object with Storage Center info.
 *
 * @param api The SC API connection.
 * @param sc The Storage Center.
 * @param storageSystemOrNull The StorageSystem to populate or null.
 * @return The StorageSystem.
 */
public StorageSystem getStorageSystemFromStorageCenter(StorageCenterAPI api, StorageCenter sc, StorageSystem storageSystemOrNull) {
    StorageSystem storageSystem = storageSystemOrNull;
    if (storageSystem == null) {
        storageSystem = new StorageSystem();
    }
    storageSystem.setSerialNumber(sc.scSerialNumber);
    storageSystem.setAccessStatus(AccessStatus.READ_WRITE);
    storageSystem.setModel(sc.modelSeries);
    storageSystem.setProvisioningType(SupportedProvisioningType.THIN);
    storageSystem.setNativeId(sc.scSerialNumber);
    // Parse out version information
    String[] version = sc.version.split("\\.");
    storageSystem.setMajorVersion(version[0]);
    storageSystem.setMinorVersion(version[1]);
    storageSystem.setFirmwareVersion(sc.version);
    storageSystem.setIsSupportedVersion(true);
    storageSystem.setDeviceLabel(sc.scName);
    storageSystem.setDisplayName(sc.name);
    // Make sure it's reported that we support CGs
    Set<SupportedReplication> supportedReplications = new HashSet<>();
    supportedReplications.add(SupportedReplication.elementReplica);
    supportedReplications.add(SupportedReplication.groupReplica);
    storageSystem.setSupportedReplications(supportedReplications);
    // Check the supported protocols for this array
    List<String> protocols = getSupportedProtocols(api, sc.scSerialNumber);
    storageSystem.setProtocols(protocols);
    return storageSystem;
}
Also used : SupportedReplication(com.emc.storageos.storagedriver.model.StorageSystem.SupportedReplication) StorageSystem(com.emc.storageos.storagedriver.model.StorageSystem) HashSet(java.util.HashSet)

Aggregations

StorageSystem (com.emc.storageos.storagedriver.model.StorageSystem)1 SupportedReplication (com.emc.storageos.storagedriver.model.StorageSystem.SupportedReplication)1 HashSet (java.util.HashSet)1