Class UserDelegator
java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.UserDelegator
- All Implemented Interfaces:
IUserDelegator
Implementation to handle the User command.
-
Field Summary
Fields inherited from class com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionUserDelegator(IOptionsServer server) Instantiate a new UserDelegator, providing the server object that will be used to execute Perforce Helix attribute commands. -
Method Summary
Modifier and TypeMethodDescriptioncreateUser(IUser user, boolean force) Create a new Perforce user on the Perforce server.createUser(IUser user, UpdateUserOptions opts) Create a new Perforce user on the Perforce server.deleteUser(String userName, boolean force) Delete a named Perforce user from the Perforce server.deleteUser(String userName, UpdateUserOptions opts) Delete a named Perforce user from the Perforce serverGet the user details of a specific Perforce user from the Perforce server.updateUser(IUser user, boolean force) Update a Perforce user on the Perforce server.updateUser(IUser user, UpdateUserOptions opts) Update a Perforce user on the Perforce server.
-
Constructor Details
-
UserDelegator
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 Details
-
createUser
public String createUser(@Nonnull IUser user, boolean force) throws ConnectionException, RequestException, AccessException Description copied from interface:IUserDelegatorCreate a new Perforce user on the Perforce server.- Specified by:
createUserin interfaceIUserDelegator- 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 requestAccessException- if the Perforce server denies access to the caller
-
createUser
Description copied from interface:IUserDelegatorCreate a new Perforce user on the Perforce server.- Specified by:
createUserin interfaceIUserDelegator- 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 String updateUser(@Nonnull IUser user, boolean force) throws ConnectionException, RequestException, AccessException Description copied from interface:IUserDelegatorUpdate a Perforce user on the Perforce server.- Specified by:
updateUserin interfaceIUserDelegator- Parameters:
user- non-null IUser defining the user to be updatedforce- 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 requestAccessException- if the Perforce server denies access to the caller
-
updateUser
Description copied from interface:IUserDelegatorUpdate a Perforce user on the Perforce server.- Specified by:
updateUserin interfaceIUserDelegator- 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 String deleteUser(String userName, boolean force) throws ConnectionException, RequestException, AccessException Description copied from interface:IUserDelegatorDelete a named Perforce user from the Perforce server.- Specified by:
deleteUserin interfaceIUserDelegator- 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 requestAccessException- if the Perforce server denies access to the caller
-
deleteUser
Description copied from interface:IUserDelegatorDelete a named Perforce user from the Perforce server- Specified by:
deleteUserin interfaceIUserDelegator- 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
Description copied from interface:IUserDelegatorGet the user details of a specific Perforce user from the Perforce server.- Specified by:
getUserin interfaceIUserDelegator- 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 requestAccessException- if the Perforce server denies access to the caller
-