@RpcMethod public void finalizeImage(String imageId,String datastore,String tmpImagePath,AsyncMethodCallback<Host.AsyncClient.finalize_image_call> handler) throws RpcException {
  ensureClient();
  FinalizeImageRequest finalizeImageRequest=new FinalizeImageRequest();
  finalizeImageRequest.setImage_id(imageId);
  finalizeImageRequest.setDatastore(datastore);
  finalizeImageRequest.setTmp_image_path(tmpImagePath);
  clientProxy.setTimeout(FINALIZE_IMAGE_TIMEOUT_MS);
  logger.info("finalize_image target {}, request {}",getHostIp(),finalizeImageRequest);
  try {
    clientProxy.finalize_image(finalizeImageRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void finalizeImage ( String imageId , String datastore , String tmpImagePath , AsyncMethodCallback < Host . AsyncClient . finalize_image_call > handler ) throws RpcException { ensureClient ( ) ; FinalizeImageRequest finalizeImageRequest = new FinalizeImageRequest ( ) ; finalizeImageRequest . setImage_id ( imageId ) ; finalizeImageRequest . setDatastore ( datastore ) ; finalizeImageRequest . setTmp_image_path ( tmpImagePath ) ; clientProxy . setTimeout ( FINALIZE_IMAGE_TIMEOUT_MS ) ; logger . info ( "finalize_image target {}, request {}" , getHostIp ( ) , finalizeImageRequest ) ; try { clientProxy . finalize_image ( finalizeImageRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to create an image by moving the image file from tmp path . on completion , the specified handler is invoked .
