class OMKeyRenameRequest extends OMKeyRequest {

  @Override
  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {

    RenameKeyRequest renameKeyRequest = getOmRequest().getRenameKeyRequest();
    Preconditions.checkNotNull(renameKeyRequest);

    // Verify key name
    final boolean checkKeyNameEnabled = ozoneManager.getConfiguration()
         .getBoolean(OMConfigKeys.OZONE_OM_KEYNAME_CHARACTER_CHECK_ENABLED_KEY,
                 OMConfigKeys.OZONE_OM_KEYNAME_CHARACTER_CHECK_ENABLED_DEFAULT);
    if(checkKeyNameEnabled){
      OmUtils.validateKeyName(renameKeyRequest.getToKeyName());
    }

    KeyArgs renameKeyArgs = renameKeyRequest.getKeyArgs();

    // Set modification time.
    KeyArgs.Builder newKeyArgs = renameKeyArgs.toBuilder()
            .setModificationTime(Time.now());

    return getOmRequest().toBuilder()
        .setRenameKeyRequest(renameKeyRequest.toBuilder()
            .setKeyArgs(newKeyArgs))
        .setUserInfo(getUserInfo()).build();

  }

  public  OMKeyRenameRequest(OMRequest omRequest);

}