Search in sources :

Example 6 with SiteErrorResponse

use of com.emc.storageos.model.dr.SiteErrorResponse in project coprhd-controller by CoprHD.

the class DisasterRecoveryService method resumePrecheck.

/**
 * This is internal API to do precheck for resume
 */
@POST
@Path("/internal/resumeprecheck")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public SiteErrorResponse resumePrecheck() {
    log.info("Precheck for resume internally");
    SiteErrorResponse response = new SiteErrorResponse();
    try {
        precheckForResumeLocalStandby();
    } catch (APIException e) {
        log.warn("Failed to precheck switchover", e);
        response.setErrorMessage(e.getMessage());
        response.setServiceCode(e.getServiceCode().ordinal());
        return response;
    } catch (Exception e) {
        log.error("Failed to precheck switchover", e);
        response.setErrorMessage(e.getMessage());
        return response;
    }
    return response;
}
Also used : APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) SiteErrorResponse(com.emc.storageos.model.dr.SiteErrorResponse) APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) InternalServerErrorException(com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException) CoordinatorException(com.emc.storageos.coordinator.exceptions.CoordinatorException) RetryableCoordinatorException(com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException) UnknownHostException(java.net.UnknownHostException) Path(javax.ws.rs.Path) ZkPath(com.emc.storageos.coordinator.common.impl.ZkPath) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces)

Example 7 with SiteErrorResponse

use of com.emc.storageos.model.dr.SiteErrorResponse in project coprhd-controller by CoprHD.

the class SiteError method toResponse.

public SiteErrorResponse toResponse() {
    SiteErrorResponse response = new SiteErrorResponse();
    response.setCreationTime(this.creationTime);
    response.setServiceCode(this.serviceCode.ordinal());
    response.setServiceCodeName(this.serviceCode.name());
    response.setErrorMessage(this.errorMessage);
    response.setOperation(this.operation);
    return response;
}
Also used : SiteErrorResponse(com.emc.storageos.model.dr.SiteErrorResponse)

Aggregations

SiteErrorResponse (com.emc.storageos.model.dr.SiteErrorResponse)7 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)5 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)3 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)3 ZkPath (com.emc.storageos.coordinator.common.impl.ZkPath)2 RetryableCoordinatorException (com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException)2 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)2 WebResource (com.sun.jersey.api.client.WebResource)2 UnknownHostException (java.net.UnknownHostException)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 SiteError (com.emc.storageos.coordinator.client.model.SiteError)1 SiteState (com.emc.storageos.coordinator.client.model.SiteState)1 SiteDetailRestRep (com.emc.storageos.model.dr.SiteDetailRestRep)1 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)1 BadRequestException (com.emc.storageos.svcs.errorhandling.resources.BadRequestException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 Date (java.util.Date)1 DateTime (org.joda.time.DateTime)1