private static GetVmNetworkResponse checkGetVmNetworkResponse(GetVmNetworkResponse getVmNetworkResponse) throws RpcException {
  logger.info("Checking {}",getVmNetworkResponse);
switch (getVmNetworkResponse.getResult()) {
case OK:
    break;
case SYSTEM_ERROR:
  throw new SystemErrorException(getVmNetworkResponse.getError());
case VM_NOT_FOUND:
throw new VmNotFoundException(getVmNetworkResponse.getError());
default :
throw new RpcException(String.format("Unknown result: %s",getVmNetworkResponse.getResult()));
}
return getVmNetworkResponse;
}

private static GetVmNetworkResponse checkGetVmNetworkResponse ( GetVmNetworkResponse getVmNetworkResponse ) throws RpcException { logger . info ( "Checking {}" , getVmNetworkResponse ) ; switch ( getVmNetworkResponse . getResult ( ) ) { case OK : break ; case SYSTEM_ERROR : throw new SystemErrorException ( getVmNetworkResponse . getError ( ) ) ; case VM_NOT_FOUND : throw new VmNotFoundException ( getVmNetworkResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unknown result: %s" , getVmNetworkResponse . getResult ( ) ) ) ; } return getVmNetworkResponse ; }
this method validates a getvmnetworkresponse object , raising an exception if the response reflects an operation failure .
