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;
}
Aggregations