Class UsersDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.UsersDelegator
-
- All Implemented Interfaces:
IUsersDelegator
public class UsersDelegator extends BaseDelegator implements IUsersDelegator
Implementation to handle the Users 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
Constructors Constructor Description UsersDelegator(IOptionsServer server)
Instantiate a new UsersDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<IUserSummary>
getUsers(java.util.List<java.lang.String> userList, int maxUsers)
Get a list of Perforce users known to this Perforce server.java.util.List<IUserSummary>
getUsers(java.util.List<java.lang.String> userList, GetUsersOptions opts)
Get a list of Perforce users known to this Perforce server.
-
-
-
Constructor Detail
-
UsersDelegator
public UsersDelegator(IOptionsServer server)
Instantiate a new UsersDelegator, 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
-
getUsers
public java.util.List<IUserSummary> getUsers(java.util.List<java.lang.String> userList, GetUsersOptions opts) throws P4JavaException
Description copied from interface:IUsersDelegator
Get a list of Perforce users known to this Perforce server. Note that maxUsers and the user list are supposed to be mutually exclusive in usage, but this is not enforced by P4Java as the restriction doesn't make much sense and may be lifted in the Perforce server later.Note that this implementation differs a bit from the p4 command line version in that it simply doesn't return any output for unmatched users.
- Specified by:
getUsers
in interfaceIUsersDelegator
- Parameters:
userList
- if non-null, restrict output to users matching the passed-in list of users.opts
- GetUsersOptions object describing optional parameters; if null, no options are set- Returns:
- non-null (but possibly empty) list of non-null IUserSummary objects representing the underlying Perforce users (if any).
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
getUsers
public java.util.List<IUserSummary> getUsers(java.util.List<java.lang.String> userList, int maxUsers) throws ConnectionException, RequestException, AccessException
Description copied from interface:IUsersDelegator
Get a list of Perforce users known to this Perforce server. Note that maxUsers and the user list are supposed to be mutually exclusive in usage, but this is not enforced by P4Java as the restriction doesn't make much sense and may be lifted in the Perforce server later.Note that this implementation differs a bit from the p4 command line version in that it simply doesn't return any output for unmatched users.
- Specified by:
getUsers
in interfaceIUsersDelegator
- Parameters:
userList
- if non-null, restrict output to users matching the passed-in list of users.maxUsers
- if positive, only return the first maxUsers users.- Returns:
- non-null (but possibly empty) list of non-null IUserSummary objects representing the underlying Perforce users (if any).
- 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
-
-