Search in sources :

Example 6 with ReplicationGroup

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

the class HDSApiProtectionManager method getReplicationGroupObjectId.

/**
 * Returns ViPR-Replication-Group objectID collected from Device manager to create ShadowImage pair on
 * Hitachi StorageSystem.
 *
 * @return replicationGroup's objectID
 * @throws Exception
 */
public String getReplicationGroupObjectId() throws Exception {
    List<HDSHost> hostList = getHDSHostList();
    String replicationGroupObjectId = null;
    HDSHost pairMgmtServer = null;
    if (hostList != null) {
        outerloop: for (HDSHost hdsHost : hostList) {
            log.info("HDSHost :{}", hdsHost.toXMLString());
            if (hdsHost != null && hdsHost.getConfigFileList() != null && !hdsHost.getConfigFileList().isEmpty()) {
                for (ConfigFile configFile : hdsHost.getConfigFileList()) {
                    if (configFile != null) {
                        ReplicationGroup replicationGroup = configFile.getReplicationGroup();
                        if (replicationGroup != null && HDSConstants.VIPR_REPLICATION_GROUP_NAME.equalsIgnoreCase(replicationGroup.getGroupName())) {
                            pairMgmtServer = hdsHost;
                            log.info("Pair management server {} found", pairMgmtServer.getName());
                            replicationGroupObjectId = replicationGroup.getObjectID();
                            log.info("ViPR Replication Group {} found", replicationGroup.toXMLString());
                            break outerloop;
                        }
                    }
                }
            }
        }
    }
    return replicationGroupObjectId;
}
Also used : HDSHost(com.emc.storageos.hds.model.HDSHost) ConfigFile(com.emc.storageos.hds.model.ConfigFile) ReplicationGroup(com.emc.storageos.hds.model.ReplicationGroup)

Aggregations

ReplicationGroup (com.emc.storageos.hds.model.ReplicationGroup)6 ReplicationInfo (com.emc.storageos.hds.model.ReplicationInfo)5 HashMap (java.util.HashMap)4 ConfigFile (com.emc.storageos.hds.model.ConfigFile)3 HDSHost (com.emc.storageos.hds.model.HDSHost)3 ClientResponse (com.sun.jersey.api.client.ClientResponse)3 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 URI (java.net.URI)3 JavaResult (org.milyn.payload.JavaResult)3 Add (com.emc.storageos.hds.model.Add)1 Delete (com.emc.storageos.hds.model.Delete)1 EchoCommand (com.emc.storageos.hds.model.EchoCommand)1 Error (com.emc.storageos.hds.model.Error)1 Modify (com.emc.storageos.hds.model.Modify)1