use of com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception in project coprhd-controller by CoprHD.
the class RecoverPointUtils method enableNewConsistencyGroup.
/**
* @param impl - RP handle to use for RP operations
* @param cgUID - Consistency Group UID
* @param localCopyUID
* @param remoteCopiesUID
* @throws FunctionalAPIActionFailedException_Exception
* @throws FunctionalAPIInternalError_Exception
* @throws RecoverPointException
* @throws FunctionalAPIValidationException_Exception
*/
public static void enableNewConsistencyGroup(FunctionalAPIImpl impl, ConsistencyGroupUID cgUID, List<ConsistencyGroupCopyUID> localCopiesUID, List<ConsistencyGroupCopyUID> remoteCopiesUID) throws FunctionalAPIActionFailedException_Exception, FunctionalAPIInternalError_Exception, RecoverPointException, FunctionalAPIValidationException_Exception {
logger.info("Start enableNewConsistencyGroup...");
if (remoteCopiesUID != null && !remoteCopiesUID.isEmpty()) {
for (ConsistencyGroupCopyUID remoteCopyUID : remoteCopiesUID) {
try {
logger.info("Validate Remote copy...");
// CG validation warnings will be caught, logged, and
// processing will continue
impl.validateEnableConsistencyGroupCopy(remoteCopyUID, true);
} catch (FunctionalAPIValidationException_Exception e) {
logger.warn(e.getMessage(), e);
}
}
}
if (localCopiesUID != null && !localCopiesUID.isEmpty()) {
for (ConsistencyGroupCopyUID localCopyUID : localCopiesUID) {
try {
logger.info("Validate Local copy...");
// CG validation warnings will be caught, logged, and
// processing will continue
impl.validateEnableConsistencyGroupCopy(localCopyUID, true);
} catch (FunctionalAPIValidationException_Exception e) {
logger.warn(e.getMessage(), e);
}
}
}
// Last thing to do is enable the CG
logger.info("Enable Consistency Group and all copies");
try {
// CG validation warnings will be caught, logged, and
// processing will continue
impl.validateEnableConsistencyGroup(cgUID, true);
} catch (FunctionalAPIValidationException_Exception e) {
logger.warn(e.getMessage(), e);
}
impl.enableConsistencyGroup(cgUID, true);
// Make sure the CG is ready
RecoverPointImageManagementUtils imageManager = new RecoverPointImageManagementUtils();
imageManager.waitForCGLinkState(impl, cgUID, RecoverPointImageManagementUtils.getPipeActiveState(impl, cgUID));
logger.info("End enableNewConsistencyGroup.");
}
Aggregations