Class RenameUserDelegator

java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.RenameUserDelegator
All Implemented Interfaces:
IRenameUserDelegator

public class RenameUserDelegator extends BaseDelegator implements IRenameUserDelegator
Implementation to handle the RenameUser command.
  • Constructor Details

    • RenameUserDelegator

      public RenameUserDelegator(IOptionsServer server)
      Instantiate a new RenameUserDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
      Parameters:
      server - a concrete implementation of a Perforce Helix Server
  • Method Details

    • renameUser

      public String renameUser(String oldUserName, String newUserName) throws P4JavaException
      Description copied from interface: IRenameUserDelegator
      Completely renames a user, modifying all database records which mention the user.

      This includes all workspaces, labels, branches, streams, etc. which are owned by the user, all pending, shelved, and committed changes created by the user, any files that the user has opened or shelved, any fixes that the user made to jobs, any properties that apply to the user, any groups that the user is in, and the user record itself.

      The username is not changed in descriptive text fields (such as job descriptions, change descriptions, or workspace descriptions), only where it appears as the owner or user field of the database record.

      Protection table entries that apply to the user are updated only if the Name: field exactly matches the user name; if the Name: field contains wildcards, it is not modified.

      The only job field that is processed is attribute code 103. If you have included the username in other job fields they will have to be processed separately.

      The full semantics of this operation are found in the main 'p4 help' documentation.

      This method requires 'super' access granted by 'p4 protect'.

      Specified by:
      renameUser in interface IRenameUserDelegator
      Parameters:
      oldUserName - the old user name to be changed.
      newUserName - the new user name to be changed to.
      Returns:
      non-null result message string from the reload operation.
      Throws:
      P4JavaException - if an error occurs processing this method and its parameters.