|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.client.dbo.AccessGroup
public final class AccessGroup
An object representing an access group within the Build Forge system. An access group is a collection of member users. It may also inherit the rights of other access groups within the system. Access groups are also used to identify the recipients of status messages from the console, such as when a build fails.
When a new user is created, by default that user will be a member of all access groups that are marked as defaults. For installations that use LDAP for user management, group membership in the LDAP domain may be used to identify initial group membership, but thereafter, group membership is managed by Build Forge.
Field Summary | |
---|---|
static java.lang.Class<AccessGroup> |
CLASS
|
static java.util.regex.Pattern |
REGEX_NUMBER
|
Constructor Summary | |
---|---|
AccessGroup(APIClientConnection conn)
Define a new access group object. |
Method Summary | |
---|---|
void |
addInheritedGroup(int groupId)
Sets this access group to inherit users and permissions from another access group. |
void |
addMemberUser(int userId)
Adds a user to this access group as a direct member. |
boolean |
checkPermission(Permission perm)
Determines if a specific Permission is or is not already granted
to this AccessGroup. |
AccessGroup |
create()
Creates a new access group as defined by this object. |
void |
delete()
Deletes this access group from the system. |
static void |
deleteById(APIClientConnection conn,
int level)
Deletes the access group with the specified ID. |
void |
deleteInheritedGroup(int groupId)
Sets this access group to stop inheriting users and permissions from another access group. |
void |
deleteMemberUser(int userId)
Removes a user from direct membership in this access group. |
static java.util.List<AccessGroup> |
findAll(APIClientConnection conn)
Finds all access groups that are defined within the system. |
static java.util.List<AccessGroup> |
findAllChildren(APIClientConnection conn,
int parentLevel)
Finds all access groups that are children of the provided AccessGroup's identifier. |
static AccessGroup |
findById(APIClientConnection conn,
int level)
Finds an access groups by its identifier (level) as provided by the Build Forge system at the time the access group was created. |
static AccessGroup |
findByName(APIClientConnection conn,
java.lang.String name)
Finds an access groups by its descriptive name, as supplied by the user that created it. |
static java.util.BitSet |
findByUser(APIClientConnection conn,
int userId,
boolean direct)
Finds all access groups for a user. |
static java.util.BitSet |
findDefault(APIClientConnection conn)
Finds all default access groups. |
int |
getControlLevel()
Returns the access group ID (level) of the access group that controls this group. |
boolean |
getDefault()
Returns whether or not this access group is granted by default. |
java.util.List<AccessGroup> |
getInheritedGroups()
Retrieves a list of access groups from which this access group inherits users and permissions. |
java.lang.String |
getLdapDN()
Returns the LDAP distinguished name that grants membership to new users. |
int |
getLevel()
Returns the access group ID (level) of this access group. |
java.util.List<User> |
getMemberUsers()
Retrieves a list of users who are direct members of this access group. |
java.lang.String |
getName()
Returns the descriptive name of this access group, as supplied by the user at the time the access group was created. |
void |
grantPermission(Permission perm)
Grants a specified permission to the members of this access group, as well as to all access groups that inherit from this one. |
java.util.EnumSet<Permission> |
listPermissions()
Returns the complete list of Permission s that are granted to this
AccessGroup and any AccessGroups from which this AccessGroup inherits. |
void |
revokePermission(Permission perm)
Revokes the specified permission from the members of this access group, as well as from all access groups that inherit from this one. |
void |
setControlLevel(int controlLevel)
Sets the ID of the control group for this access group. |
void |
setDefault(boolean def)
Sets whether or not this access group is granted by default. |
void |
setLdapDN(java.lang.String dn)
Sets the LDAP distinguished name for the LDAP group that implies default membership in this access group. |
void |
setName(java.lang.String name)
Sets the descriptive name of this access group. |
java.lang.String |
toString()
|
AccessGroup |
update()
Updates this existing access group to use the modified values in this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<AccessGroup> CLASS
public static final java.util.regex.Pattern REGEX_NUMBER
Constructor Detail |
---|
public AccessGroup(APIClientConnection conn)
create()
method.
conn
- the services layer connection that the access group
object should use when submitting requestsMethod Detail |
---|
public static java.util.List<AccessGroup> findAll(APIClientConnection conn) throws java.io.IOException, ServiceException
conn
- the API client connection to use
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.List<AccessGroup> findAllChildren(APIClientConnection conn, int parentLevel) throws java.io.IOException, ServiceException
conn
- the API client connection to use
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.BitSet findDefault(APIClientConnection conn) throws java.io.IOException, ServiceException
getDefault()
returns
true
. These access groups are granted to users
by default. This method does not take into account any
additional access groups that may be granted by LDAP.
conn
- the API client connection to use
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.BitSet findByUser(APIClientConnection conn, int userId, boolean direct) throws java.io.IOException, ServiceException
conn
- the API client connection to useuserId
- the user ID
of the user
for which to retrieve the list of groupsdirect
- if true, then only the groups to which the
user has direct access are included; if false then
any groups the user has inherited are also included.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static AccessGroup findById(APIClientConnection conn, int level) throws java.io.IOException, ServiceException
conn
- the API client connection to uselevel
- the access group ID to find
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static AccessGroup findByName(APIClientConnection conn, java.lang.String name) throws java.io.IOException, ServiceException
conn
- the API client connection to usename
- the descriptive name of the access group to find
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void grantPermission(Permission perm) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.UpdatePermMember
,
as well as direct or indirect membership in the
control level
of this access group.
perm
- the permission to grant
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void revokePermission(Permission perm) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.UpdatePermMember
,
as well as direct or indirect membership in the
control level
of this access group.
perm
- the permission to revoke
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic boolean checkPermission(Permission perm) throws java.io.IOException, ServiceException
Permission
is or is not already granted
to this AccessGroup.
Retrictions: Requires direct or indirect membership in the
control level
of this access group.
perm
- the permission to check
Permission
or false if it has not
java.io.IOException
ServiceException
public java.util.EnumSet<Permission> listPermissions() throws java.io.IOException, ServiceException
Permission
s that are granted to this
AccessGroup and any AccessGroups from which this AccessGroup inherits.
Retrictions: Requires direct or indirect membership in the
control level
of this access group.
Permission
s that are granted to this
AccessGroup and any AccessGroups from which this AccessGroup inherits.
java.io.IOException
ServiceException
public java.util.List<User> getMemberUsers() throws java.io.IOException, ServiceException
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void addMemberUser(int userId) throws java.io.IOException, ServiceException
Restrictions: Requires either Permission.AddAccessMember
or
Permission.UpdateAccessMember
, as well as direct or indirect
membership in the control level
of this
access group.
userId
- the user ID (as returned by User.getUserId()
of
the user to add to this access group
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void deleteMemberUser(int userId) throws java.io.IOException, ServiceException
Restrictions: Requires either Permission.DeleteAccessMember
or
Permission.UpdateAccessMember
, as well as direct or indirect
membership in the control level
of this
access group.
userId
- the user ID (as returned by User.getUserId()
of
the user to remove from this access group
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic java.util.List<AccessGroup> getInheritedGroups() throws java.io.IOException, ServiceException
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void addInheritedGroup(int groupId) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.AddAccess
, as well as direct
or indirect membership in the control level
of both access groups.
groupId
- the access group id
of the access group
from which this group will now inherit users and permissions
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void deleteInheritedGroup(int groupId) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.AddAccess
, as well as direct
or indirect membership in the control level
of both access groups.
groupId
- the access group id
of the access group
from which this group will no longer inherit users and permissions
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic AccessGroup create() throws java.io.IOException, ServiceException
Restrictions: Requires Permission.AddLevel
and direct or
indirect membership in the control level
.
The descriptive name
of the access group must
be unique.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic AccessGroup update() throws java.io.IOException, ServiceException
Restrictions: Requires Permission.EditLevel
and direct or
indirect membership in the control level
.
The descriptive name
of the access group must
be unique.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void delete() throws java.io.IOException, ServiceException
Restrictions: Requires Permission.DeleteAccess
and direct or
indirect membership in the control level
.
The access group must have been defined by a user; the access groups
that are defined by Build Forge may not be deleted. There must not
be any access groups that inherit from this group, nor may it have
any direct member users. The access group must not be used as the
access setting for any
Build
,
Result
,
Step
,
BuildClass
,
Environment
,
Filter
,
Interface
,
Project
,
Selector
, or
Server
.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static void deleteById(APIClientConnection conn, int level) throws java.io.IOException, ServiceException
Restrictions: As for delete()
conn
- the connection to use for the requestlevel
- the access group ID of the access group to delete
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic int getControlLevel()
public boolean getDefault()
public java.lang.String getLdapDN()
public int getLevel()
public java.lang.String getName()
public void setControlLevel(int controlLevel)
controlLevel
- the new control group for this access groupgetControlLevel()
public void setDefault(boolean def)
def
- true to grant membership in this access group to new
users, or false if membership should not be granted
automatically.getDefault()
public void setLdapDN(java.lang.String dn)
dn
- the distinguished name of the LDAP groupgetLdapDN()
public void setName(java.lang.String name)
name
- the new descriptive name for the access groupgetName()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |