Class UserDelegator

    • Constructor Detail

      • UserDelegator

        public UserDelegator​(IOptionsServer server)
        Instantiate a new UserDelegator, 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 Detail

      • createUser

        public java.lang.String createUser​(@Nonnull
                                           IUser user,
                                           boolean force)
                                    throws ConnectionException,
                                           RequestException,
                                           AccessException
        Description copied from interface: IUserDelegator
        Create a new Perforce user on the Perforce server.
        Specified by:
        createUser in interface IUserDelegator
        Parameters:
        user - non-null IUser defining the new user to be created.
        force - if true, force the creation of any named user; requires admin privileges,
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller
      • createUser

        public java.lang.String createUser​(@Nonnull
                                           IUser user,
                                           UpdateUserOptions opts)
                                    throws P4JavaException
        Description copied from interface: IUserDelegator
        Create a new Perforce user on the Perforce server.
        Specified by:
        createUser in interface IUserDelegator
        Parameters:
        user - non-null IUser defining the new user to be created.
        opts - UpdateUserOptions object describing optional parameters; if null, no options are set
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        P4JavaException - if any error occurs in the processing of this method.
      • updateUser

        public java.lang.String updateUser​(@Nonnull
                                           IUser user,
                                           boolean force)
                                    throws ConnectionException,
                                           RequestException,
                                           AccessException
        Description copied from interface: IUserDelegator
        Update a Perforce user on the Perforce server.
        Specified by:
        updateUser in interface IUserDelegator
        Parameters:
        user - non-null IUser defining the user to be updated
        force - if true, force update for users other than the caller. Requires super user / admin privileges (enforced by the server).
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller
      • updateUser

        public java.lang.String updateUser​(@Nonnull
                                           IUser user,
                                           UpdateUserOptions opts)
                                    throws P4JavaException
        Description copied from interface: IUserDelegator
        Update a Perforce user on the Perforce server.
        Specified by:
        updateUser in interface IUserDelegator
        Parameters:
        user - non-null IUser defining the new user to be updated.
        opts - UpdateUserOptions object describing optional parameters; if null, no options are set
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        P4JavaException - if any error occurs in the processing of this method.
      • deleteUser

        public java.lang.String deleteUser​(java.lang.String userName,
                                           boolean force)
                                    throws ConnectionException,
                                           RequestException,
                                           AccessException
        Description copied from interface: IUserDelegator
        Delete a named Perforce user from the Perforce server.
        Specified by:
        deleteUser in interface IUserDelegator
        Parameters:
        userName - non-null name of the user to be deleted.
        force - if true, force deletion for users other than the caller. Requires super user / admin privileges (enforced by the server).
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller
      • deleteUser

        public java.lang.String deleteUser​(java.lang.String userName,
                                           UpdateUserOptions opts)
                                    throws P4JavaException
        Description copied from interface: IUserDelegator
        Delete a named Perforce user from the Perforce server
        Specified by:
        deleteUser in interface IUserDelegator
        Parameters:
        userName - non-null name of the user to be deleted.
        opts - UpdateUserOptions object describing optional parameters; if null, no options are set
        Returns:
        possibly-null status message string as returned from the server
        Throws:
        P4JavaException - if any error occurs in the processing of this method.
      • getUser

        public IUser getUser​(java.lang.String userName)
                      throws ConnectionException,
                             RequestException,
                             AccessException
        Description copied from interface: IUserDelegator
        Get the user details of a specific Perforce user from the Perforce server.
        Specified by:
        getUser in interface IUserDelegator
        Parameters:
        userName - if null, get the current user details, otherwise use the passed-in user name.
        Returns:
        IUser details for the user, or null if no such user is known.
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller