@RpcMethod public void copyImage(String imageId,String source,String destination,AsyncMethodCallback<Host.AsyncClient.copy_image_call> handler) throws RpcException {
  ensureClient();
  CopyImageRequest copyImageRequest=new CopyImageRequest();
  copyImageRequest.setSource(Util.constructImage(source,imageId));
  copyImageRequest.setDestination(Util.constructImage(destination,imageId));
  logger.info("copy_image target {}, request {}",getHostIp(),copyImageRequest);
  try {
    clientProxy.copy_image(copyImageRequest,handler);
  }
 catch (  TException e) {
    throw new RpcException(e.getMessage());
  }
}

@ RpcMethod public void copyImage ( String imageId , String source , String destination , AsyncMethodCallback < Host . AsyncClient . copy_image_call > handler ) throws RpcException { ensureClient ( ) ; CopyImageRequest copyImageRequest = new CopyImageRequest ( ) ; copyImageRequest . setSource ( Util . constructImage ( source , imageId ) ) ; copyImageRequest . setDestination ( Util . constructImage ( destination , imageId ) ) ; logger . info ( "copy_image target {}, request {}" , getHostIp ( ) , copyImageRequest ) ; try { clientProxy . copy_image ( copyImageRequest , handler ) ; } catch ( TException e ) { throw new RpcException ( e . getMessage ( ) ) ; } }
this method performs an asynchronous thrift call to copy an image from one data store to another . on completion , the specified handler is invoked .
