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
public class GroupDelegator extends BaseDelegator implements 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
Constructors Constructor Description GroupDelegator(IOptionsServer server)Instantiate a new GroupDelegator for the given server implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateUserGroup(IUserGroup group)Implemented on behalf of IServer for backwards compatibility.java.lang.StringcreateUserGroup(IUserGroup group, UpdateUserGroupOptions opts)Create a new Perforce user group on the Perforce server.java.lang.StringdeleteUserGroup(IUserGroup group)Implemented on behalf of IServer for backwards compatibility.java.lang.StringdeleteUserGroup(IUserGroup group, UpdateUserGroupOptions opts)Delete a Perforce user group from the Perforce server.IUserGroupgetUserGroup(java.lang.String name)Get the named Perforce user group.java.lang.StringupdateUserGroup(IUserGroup group, boolean updateIfOwner)Implemented on behalf of IServer for backwards compatibility.java.lang.StringupdateUserGroup(IUserGroup group, UpdateUserGroupOptions opts)Update a Perforce user group on the Perforce server.
-
-
-
Constructor Detail
-
GroupDelegator
public GroupDelegator(IOptionsServer server)
Instantiate a new GroupDelegator for the given server implementation.- Parameters:
server- the server to delegate for
-
-
Method Detail
-
getUserGroup
public IUserGroup getUserGroup(@Nonnull java.lang.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 java.lang.String deleteUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaExceptionDescription 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 java.lang.String createUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaExceptionDescription 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 java.lang.String updateUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaExceptionDescription 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 java.lang.String createUserGroup(@Nonnull IUserGroup group) throws ConnectionException, RequestException, AccessExceptionImplemented on behalf of IServer for backwards compatibility.- Parameters:
group- group- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-
updateUserGroup
public java.lang.String updateUserGroup(@Nonnull IUserGroup group, boolean updateIfOwner) throws ConnectionException, RequestException, AccessExceptionImplemented on behalf of IServer for backwards compatibility.- Parameters:
group- groupupdateIfOwner- updateIfOwner- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-
deleteUserGroup
public java.lang.String deleteUserGroup(@Nonnull IUserGroup group) throws ConnectionException, RequestException, AccessExceptionImplemented on behalf of IServer for backwards compatibility.- Parameters:
group- group- Returns:
- response
- Throws:
ConnectionException- on errorRequestException- on errorAccessException- on error
-
-