Class GroupDelegator
java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.GroupDelegator
- All Implemented Interfaces:
IGroupDelegator
- Since:
- 12/09/2016
-
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
ConstructorsConstructorDescriptionGroupDelegator(IOptionsServer server) Instantiate a new GroupDelegator for the given server implementation. -
Method Summary
Modifier and TypeMethodDescriptioncreateUserGroup(IUserGroup group) Implemented on behalf of IServer for backwards compatibility.createUserGroup(IUserGroup group, UpdateUserGroupOptions opts) Create a new Perforce user group on the Perforce server.deleteUserGroup(IUserGroup group) Implemented on behalf of IServer for backwards compatibility.deleteUserGroup(IUserGroup group, UpdateUserGroupOptions opts) Delete a Perforce user group from the Perforce server.getUserGroup(String name) Get the named Perforce user group.updateUserGroup(IUserGroup group, boolean updateIfOwner) Implemented on behalf of IServer for backwards compatibility.updateUserGroup(IUserGroup group, UpdateUserGroupOptions opts) Update a Perforce user group on the Perforce server.
-
Constructor Details
-
GroupDelegator
Instantiate a new GroupDelegator for the given server implementation.- Parameters:
server- the server to delegate for
-
-
Method Details
-
getUserGroup
public IUserGroup getUserGroup(@Nonnull String name) throws ConnectionException, RequestException, AccessException Description copied from interface:IGroupDelegatorGet the named Perforce user group. Note that since the Perforce server usually interprets asking for a non-existent group as equivalent to asking for a template for a new user group, you will normally always get back a result here. It is best to first use the getUserGroups method to see if the group exists, then use this method to retrieve a specific group once you know it exists. TODO: once we have finished the delegators, IOptionServer should be made to extend IServer this definition can then be removed as there is no Options object for getUserGroup- Specified by:
getUserGroupin interfaceIGroupDelegator- Parameters:
name- non-null group name.- Returns:
- IUserGroup representing the named user group if it exists on the server; null otherwise (but see note in main comments above).
- 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.
-
deleteUserGroup
public String deleteUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaException Description copied from interface:IGroupDelegatorDelete a Perforce user group from the Perforce server.- Specified by:
deleteUserGroupin interfaceIGroupDelegator- Parameters:
group- non-null group to be deleted.opts- which delete options to be applied- 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.P4JavaException
-
createUserGroup
public String createUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaException Description copied from interface:IGroupDelegatorCreate a new Perforce user group on the Perforce server.- Specified by:
createUserGroupin interfaceIGroupDelegator- Parameters:
group- non-null IUserGroup to be created.opts- which create options to be applied- 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.P4JavaException
-
updateUserGroup
public String updateUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaException Description copied from interface:IGroupDelegatorUpdate a Perforce user group on the Perforce server.- Specified by:
updateUserGroupin interfaceIGroupDelegator- Parameters:
group- non-null user group to be updated.opts- which update options to be applied- 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.P4JavaException
-
createUserGroup
public String createUserGroup(@Nonnull IUserGroup group) throws ConnectionException, RequestException, AccessException Implemented on behalf of IServer for backwards compatibility.- Parameters:
group- group- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-
updateUserGroup
public String updateUserGroup(@Nonnull IUserGroup group, boolean updateIfOwner) throws ConnectionException, RequestException, AccessException Implemented on behalf of IServer for backwards compatibility.- Parameters:
group- groupupdateIfOwner- updateIfOwner- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-
deleteUserGroup
public String deleteUserGroup(@Nonnull IUserGroup group) throws ConnectionException, RequestException, AccessException Implemented on behalf of IServer for backwards compatibility.- Parameters:
group- group- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-