public class UserGroup extends ServerResource implements IUserGroup
refreshable, server, updateable
UNDEFINED, UNLIMITED, UNSET
Constructor and Description |
---|
UserGroup()
Default constructor.
|
UserGroup(java.util.Map<java.lang.String,java.lang.Object> map)
Construct a new user group impl from the passed-in map.
|
Modifier and Type | Method and Description |
---|---|
UserGroup |
addOwner(java.lang.String owner) |
UserGroup |
addSubgroup(java.lang.String subgroup) |
UserGroup |
addUser(java.lang.String user) |
int |
getMaxLockTime()
Get the maximum lock time for queries by members of this group.
|
int |
getMaxMemory()
Get Maximum amount of megabytes of random-access memory that a command can use when
run by any member of the group.
|
int |
getMaxOpenFiles()
Get the maximum files that can be opened by members of this group.
|
int |
getMaxResults()
Get the maximum number of results returned for queries by members
of this group.
|
int |
getMaxScanRows()
Get the maximum number of scan rows returned for queries by members
of this group.
|
java.lang.String |
getName()
Get the group's name.
|
java.util.List<java.lang.String> |
getOwners()
Get a list of owner names for this group.
|
int |
getPasswordTimeout()
Get the password timeout value associated with this user group.
|
java.util.List<java.lang.String> |
getSubgroups()
Get the list of known subgroups of this groups.
|
int |
getTimeout()
Get the timeout value for commands by members of this group.
|
java.util.List<java.lang.String> |
getUsers()
Get a list of user names for this group.
|
boolean |
isSubGroup()
Return true if this group is a sub group of another group on this server.
|
static UserGroup |
newUserGroup(java.lang.String name,
java.util.List<java.lang.String> users)
Simple convenience factory method to return a new local UserGroup object.
|
int |
parseGroupIntValue(java.lang.String str)
Parse a Perforce server-side string representing a user group integer
value (such as timeout).
|
void |
refresh()
Refresh the underlying object from the Perforce server.
|
void |
setMaxLockTime(int maxLockTimeOfMilliSeconds)
Set the maximum lock time for queries by members of this group.
|
void |
setMaxMemory(int maxMemory)
Set Maximum amount of megabytes of random-access memory that a command can use when
run by any member of the group.
|
void |
setMaxOpenFiles(int maxOpenFiles)
Set maximum files that can be opened by members of this group.
|
void |
setMaxResults(int maxResults)
Set the maximum number of results returned for queries by members
of this group.
|
void |
setMaxScanRows(int maxScanRows)
Set the maximum number of scan rows returned for queries by members
of this group.
|
void |
setName(java.lang.String name)
Set the group's name.
|
void |
setOwners(java.util.List<java.lang.String> owners)
Deprecated.
Please use method
addOwner(String owner) |
void |
setPasswordTimeout(int passwordTimeoutOfSeconds)
Set the password timeout value associated with this user group.
|
void |
setSubGroup(boolean subGroup)
Set whether this group is a sub group of another group on this server.
|
void |
setSubgroups(java.util.List<java.lang.String> subgroups)
Deprecated.
Please use method
addSubgroup(String subgroup) |
void |
setTimeout(int timeoutOfSeconds)
Set the timeout value for commands by members of this group.
|
void |
setUsers(java.util.List<java.lang.String> users)
Deprecated.
Please use method
addUser(String user) |
void |
update()
Update the Perforce server object associated with the underlying P4Java object,
if possible.
|
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, update, update
public UserGroup()
public UserGroup(@Nullable java.util.Map<java.lang.String,java.lang.Object> map)
Sets superclass IServerResource fields complete, completeable, refereable and updateable to true.
map
- spec mappublic static UserGroup newUserGroup(@Nonnull java.lang.String name, @Nonnull java.util.List<java.lang.String> users)
All fields not passed as parameters here default to the defaults applied by the associated default UserGroup constructor.
name
- non-null name for the UserGroup.users
- possibly-null list of users to be associated with the group.public void setUsers(java.util.List<java.lang.String> users)
addUser(String user)
IUserGroup
setUsers
in interface IUserGroup
users
- userspublic int parseGroupIntValue(java.lang.String str)
str
- stringpublic int getMaxLockTime()
IUserGroup
getMaxLockTime
in interface IUserGroup
public void setMaxLockTime(int maxLockTimeOfMilliSeconds)
IUserGroup
setMaxLockTime
in interface IUserGroup
maxLockTimeOfMilliSeconds
- - millisecondspublic int getMaxResults()
IUserGroup
getMaxResults
in interface IUserGroup
public void setMaxResults(int maxResults)
IUserGroup
setMaxResults
in interface IUserGroup
maxResults
- max resultspublic int getMaxScanRows()
IUserGroup
getMaxScanRows
in interface IUserGroup
public void setMaxScanRows(int maxScanRows)
IUserGroup
setMaxScanRows
in interface IUserGroup
maxScanRows
- max rowspublic java.lang.String getName()
IUserGroup
getName
in interface IUserGroup
public void setName(java.lang.String name)
IUserGroup
setName
in interface IUserGroup
name
- namepublic java.util.List<java.lang.String> getOwners()
IUserGroup
getOwners
in interface IUserGroup
public int getPasswordTimeout()
IUserGroup
getPasswordTimeout
in interface IUserGroup
public void setPasswordTimeout(int passwordTimeoutOfSeconds)
IUserGroup
setPasswordTimeout
in interface IUserGroup
passwordTimeoutOfSeconds
- - secondspublic java.util.List<java.lang.String> getSubgroups()
IUserGroup
getSubgroups
in interface IUserGroup
public int getTimeout()
IUserGroup
getTimeout
in interface IUserGroup
public void setTimeout(int timeoutOfSeconds)
IUserGroup
setTimeout
in interface IUserGroup
timeoutOfSeconds
- - secondspublic java.util.List<java.lang.String> getUsers()
IUserGroup
getUsers
in interface IUserGroup
public boolean isSubGroup()
IUserGroup
Note that this method will always return false on an IUserGroup object retrieved from the IServer.getUserGroup() method (this is a restriction imposed by the Perforce server).
isSubGroup
in interface IUserGroup
public void setSubGroup(boolean subGroup)
IUserGroup
setSubGroup
in interface IUserGroup
subGroup
- sub grouppublic int getMaxOpenFiles()
IUserGroup
getMaxOpenFiles
in interface IUserGroup
public void setMaxOpenFiles(int maxOpenFiles)
IUserGroup
setMaxOpenFiles
in interface IUserGroup
maxOpenFiles
- max open filespublic int getMaxMemory()
IUserGroup
getMaxMemory
in interface IUserGroup
public void setMaxMemory(int maxMemory)
IUserGroup
setMaxMemory
in interface IUserGroup
maxMemory
- - in MBpublic void refresh() throws ConnectionException, RequestException, AccessException
IServerResource
The details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server.
The results of calling this method on objects whose canRefresh method returns false are undefined (but will generally result in a UnimplementedError being thrown).
refresh
in interface IServerResource
refresh
in class ServerResource
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 callerIServerResource.refresh()
public void update() throws ConnectionException, RequestException, AccessException
IServerResource
The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
update
in interface IServerResource
update
in class ServerResource
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 callerIServerResource.update()
public void setSubgroups(java.util.List<java.lang.String> subgroups)
addSubgroup(String subgroup)
IUserGroup
setSubgroups
in interface IUserGroup
subgroups
- list of subgroupspublic void setOwners(java.util.List<java.lang.String> owners)
addOwner(String owner)
IUserGroup
setOwners
in interface IUserGroup
owners
- list of ownerspublic UserGroup addOwner(java.lang.String owner)
public UserGroup addSubgroup(java.lang.String subgroup)
public UserGroup addUser(java.lang.String user)