class OMVolumeSetOwnerResponse extends OMClientResponse {

  @Override
  protected void addToDBBatch(OMMetadataManager omMetadataManager,
      BatchOperation batchOperation) throws IOException {

    String oldOwnerKey = omMetadataManager.getUserKey(oldOwner);
    String newOwnerKey =
        omMetadataManager.getUserKey(newOwnerVolumeArgs.getOwnerName());
    if (oldOwnerVolumeList.getVolumeNamesList().size() == 0) {
      omMetadataManager.getUserTable().deleteWithBatch(batchOperation,
          oldOwnerKey);
    } else {
      omMetadataManager.getUserTable().putWithBatch(batchOperation,
          oldOwnerKey, oldOwnerVolumeList);
    }
    omMetadataManager.getUserTable().putWithBatch(batchOperation, newOwnerKey,
        newOwnerVolumeList);

    String dbVolumeKey =
        omMetadataManager.getVolumeKey(newOwnerVolumeArgs.getVolume());
    omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
        dbVolumeKey, newOwnerVolumeArgs);
  }

  public  OMVolumeSetOwnerResponse(@Nonnull OMResponse omResponse,
      @Nonnull String oldOwner, @Nonnull UserVolumeInfo oldOwnerVolumeList,
      @Nonnull UserVolumeInfo newOwnerVolumeList,
      @Nonnull OmVolumeArgs newOwnerVolumeArgs);
  public  OMVolumeSetOwnerResponse(@Nonnull OMResponse omResponse);

}