use of com.emc.storageos.model.protection.ProtectionSystemRPClusterRestRep in project coprhd-controller by CoprHD.
the class ProtectionMapper method map.
public static ProtectionSystemRestRep map(ProtectionSystem from) {
if (from == null) {
return null;
}
ProtectionSystemRestRep to = new ProtectionSystemRestRep();
mapDiscoveredSystemObjectFields(from, to);
to.setInstallationId(from.getInstallationId());
to.setMajorVersion(from.getMajorVersion());
to.setMinorVersion(from.getMinorVersion());
to.setIpAddress(from.getIpAddress());
to.setPortNumber(from.getPortNumber());
to.setReachableStatus(from.getReachableStatus());
to.setUsername(from.getUsername());
to.setNativeGuid(from.getNativeGuid());
if (from.getRpSiteNames() != null) {
List<ProtectionSystemRPClusterRestRep> clusterReps = new ArrayList<>();
for (Map.Entry<String, String> clusterEntry : from.getRpSiteNames().entrySet()) {
ProtectionSystemRPClusterRestRep clusterRep = new ProtectionSystemRPClusterRestRep();
clusterRep.setClusterId(clusterEntry.getKey());
clusterRep.setClusterName(clusterEntry.getValue());
// See if there are assigned virtual arrays for clusters
if (from.getSiteAssignedVirtualArrays() != null && from.getSiteAssignedVirtualArrays().get(clusterEntry.getKey()) != null) {
List<String> assignedVarrays = new ArrayList<>();
assignedVarrays.addAll(from.getSiteAssignedVirtualArrays().get(clusterEntry.getKey()));
clusterRep.setAssignedVarrays(assignedVarrays);
}
clusterReps.add(clusterRep);
}
to.setRpClusters(clusterReps);
}
return to;
}
Aggregations