Search in sources :

Example 1 with ResourceTypeEnum

use of com.emc.storageos.model.ResourceTypeEnum in project coprhd-controller by CoprHD.

the class VirtualPoolMapper method mapVirtualPoolFields.

private static <T extends VirtualPoolCommonRestRep> T mapVirtualPoolFields(VirtualPool from, T to, Map<URI, VpoolProtectionVarraySettings> protectionSettings) {
    mapDataObjectFieldsNoLink(from, to);
    ResourceTypeEnum type = ResourceTypeEnum.BLOCK_VPOOL;
    switch(VirtualPool.Type.valueOf(from.getType())) {
        case block:
            type = ResourceTypeEnum.BLOCK_VPOOL;
            break;
        case file:
            type = ResourceTypeEnum.FILE_VPOOL;
            break;
        case object:
            type = ResourceTypeEnum.OBJECT_VPOOL;
    }
    to.setLink(new RestLinkRep("self", RestLinkFactory.newLink(type, from.getId())));
    to.setType(from.getType());
    to.setDescription(from.getDescription());
    to.setProtocols(from.getProtocols());
    to.setProvisioningType(from.getSupportedProvisioningType());
    to.setNumPaths(from.getNumPaths());
    if (from.getArrayInfo() != null) {
        StringSetMap arrayInfo = from.getArrayInfo();
        // System Type
        StringSet systemTypes = arrayInfo.get(VirtualPoolCapabilityValuesWrapper.SYSTEM_TYPE);
        if (systemTypes != null) {
            // TODO: CD - This does not seem right. Do we support many?
            for (String systemType : systemTypes) {
                to.setSystemType(systemType);
            }
        }
    }
    if (!VdcUtil.isRemoteObject(from)) {
        mapVirtualPoolCommonLocalMappings(from, to);
    }
    return to;
}
Also used : StringSetMap(com.emc.storageos.db.client.model.StringSetMap) ResourceTypeEnum(com.emc.storageos.model.ResourceTypeEnum) RestLinkRep(com.emc.storageos.model.RestLinkRep) StringSet(com.emc.storageos.db.client.model.StringSet)

Aggregations

StringSet (com.emc.storageos.db.client.model.StringSet)1 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)1 ResourceTypeEnum (com.emc.storageos.model.ResourceTypeEnum)1 RestLinkRep (com.emc.storageos.model.RestLinkRep)1