use of com.emc.storageos.model.RestLinkRep in project coprhd-controller by CoprHD.
the class SystemsMapper method mapStorageProviderToSMISRep.
@Deprecated
public static SMISProviderRestRep mapStorageProviderToSMISRep(StorageProvider from) {
if (from == null) {
return null;
}
SMISProviderRestRep to = new SMISProviderRestRep();
mapDataObjectFields(from, to);
// of type base URI generation.
try {
to.setLink(new RestLinkRep("self", RestLinkFactory.simpleServiceLink(ResourceTypeEnum.SMIS_PROVIDER, from.getId())));
} catch (URISyntaxException e) {
// impossible to get exception here.
}
to.setIPAddress(from.getIPAddress());
to.setPortNumber(from.getPortNumber());
if (from.getStorageSystems() != null) {
for (String system : from.getStorageSystems()) {
to.getStorageSystems().add(toRelatedResource(ResourceTypeEnum.STORAGE_SYSTEM, URI.create(system)));
}
}
to.setDescription(from.getDescription());
to.setManufacturer(from.getManufacturer());
to.setVersionString(from.getVersionString());
to.setProviderID(from.getProviderID());
to.setConnectionStatus(from.getConnectionStatus());
to.setUserName(from.getUserName());
to.setUseSSL(from.getUseSSL());
to.setScanStatus(from.getScanStatus());
to.setLastScanStatusMessage(from.getLastScanStatusMessage());
to.setLastScanTime(from.getLastScanTime());
to.setNextScanTime(from.getNextScanTime());
to.setSuccessScanTime(from.getSuccessScanTime());
to.setCompatibilityStatus(from.getCompatibilityStatus());
to.setRegistrationStatus(from.getRegistrationStatus());
return to;
}
use of com.emc.storageos.model.RestLinkRep in project coprhd-controller by CoprHD.
the class SystemsMapper method map.
/**
* Map a StoragePortGroup instance to StoragePortGroupRestRep
*
* @param from
* The StoragePortGroup instance
* @return StoragePortGroupRestRep
*/
public static StoragePortGroupRestRep map(StoragePortGroup from) {
if (from == null) {
return null;
}
StoragePortGroupRestRep to = new StoragePortGroupRestRep();
to.setName(from.getLabel());
to.setId(from.getId());
to.setStorageDevice(toRelatedResource(ResourceTypeEnum.STORAGE_SYSTEM, from.getStorageDevice()));
to.setRegistrationStatus(from.getRegistrationStatus());
to.setNativeGuid(from.getNativeGuid());
to.setLink(new RestLinkRep("self", RestLinkFactory.newLink(from)));
to.setMutable(from.getMutable());
StringMap metrics = from.getMetrics();
if (metrics != null && !metrics.isEmpty()) {
Double portMetric = MetricsKeys.getDoubleOrNull(MetricsKeys.portMetric, metrics);
if (portMetric != null) {
to.setPortMetric(portMetric);
}
Long volumeCount = MetricsKeys.getLong(MetricsKeys.volumeCount, metrics);
if (volumeCount != null) {
to.setVolumeCount(volumeCount);
}
}
mapDiscoveredDataObjectFields(from, to);
return to;
}
Aggregations