public static StartImageScanResponse checkStartImageScanResponse(StartImageScanResponse response) throws RpcException {
  logger.info("Checking {}",response);
switch (response.getResult()) {
case OK:
    break;
case SYSTEM_ERROR:
  throw new SystemErrorException(response.getError());
case DATASTORE_NOT_FOUND:
throw new DatastoreNotFoundException(response.getError());
case SCAN_IN_PROGRESS:
throw new ScanInProgressException(response.getError());
case SWEEP_IN_PROGRESS:
throw new SweepInProgressException(response.getError());
default :
throw new RpcException(String.format("Unexpected return code: %s",response.getResult()));
}
return response;
}

public static StartImageScanResponse checkStartImageScanResponse ( StartImageScanResponse response ) throws RpcException { logger . info ( "Checking {}" , response ) ; switch ( response . getResult ( ) ) { case OK : break ; case SYSTEM_ERROR : throw new SystemErrorException ( response . getError ( ) ) ; case DATASTORE_NOT_FOUND : throw new DatastoreNotFoundException ( response . getError ( ) ) ; case SCAN_IN_PROGRESS : throw new ScanInProgressException ( response . getError ( ) ) ; case SWEEP_IN_PROGRESS : throw new SweepInProgressException ( response . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unexpected return code: %s" , response . getResult ( ) ) ) ; } return response ; }
validates a startimagescanresponse object , raising an exception if the response code is not ' ok ' .
