use of com.emc.storageos.coordinator.client.model.SiteError in project coprhd-controller by CoprHD.
the class DisasterRecoveryServiceTest method testGetSiteError.
@Test
public void testGetSiteError() {
SiteErrorResponse siteError = drService.getSiteError("site-uuid-1");
assertEquals(null, siteError.getCreationTime());
assertEquals(null, siteError.getErrorMessage());
assertEquals(null, siteError.getOperation());
standbySite2.setState(SiteState.STANDBY_ERROR);
standbySite2.setLastState(SiteState.STANDBY_ADDING);
SiteError error = new SiteError(APIException.internalServerErrors.addStandbyFailedTimeout(20), SiteState.STANDBY_PAUSING.name());
doReturn(error).when(coordinator).getTargetInfo(standbySite2.getUuid(), SiteError.class);
siteError = drService.getSiteError(standbySite2.getUuid());
assertEquals(new Date(error.getCreationTime()), siteError.getCreationTime());
assertEquals(error.getErrorMessage(), siteError.getErrorMessage());
assertEquals(error.getOperation(), siteError.getOperation());
try {
drService.getSiteError(NONEXISTENT_ID);
assert false;
} catch (Exception e) {
// ingore expected exception
}
}
use of com.emc.storageos.coordinator.client.model.SiteError in project coprhd-controller by CoprHD.
the class VdcOpHandler method populateStandbySiteErrorIfNecessary.
protected void populateStandbySiteErrorIfNecessary(Site site, InternalServerErrorException e) {
SiteState operation = site.getState();
SiteError error = new SiteError(e, operation.name());
log.info("set site {} state to STANDBY_ERROR, set lastState to {}", site.getName(), site.getState());
coordinator.getCoordinatorClient().setTargetInfo(site.getUuid(), error);
site.setLastState(site.getState());
site.setState(SiteState.STANDBY_ERROR);
coordinator.getCoordinatorClient().persistServiceConfiguration(site.toConfiguration());
}
Aggregations