org.rhq.core.domain.authz
Class Role

java.lang.Object
  extended by org.rhq.core.domain.authz.Role
All Implemented Interfaces:
Serializable

public class Role
extends Object
implements Serializable

A role has zero or more ResourceGroups assigned to it. You can assign a role to zero or more Subjects. A role defines a set of Permissions that the assigned Subjects are authorized for in order to operate on the given resources in the assigned ResourceGroups.

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_ALL
           
static String QUERY_FIND_AVAILABLE_ROLES
           
static String QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION
           
static String QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION_WITH_EXCLUDES
           
static String QUERY_FIND_AVAILABLE_ROLES_WITH_EXCLUDES
           
static String QUERY_FIND_BY_IDS
           
 
Constructor Summary
protected Role()
           
  Role(String name)
           
 
Method Summary
 void addPermission(Permission permission)
           
 void addResourceGroup(ResourceGroup resourceGroup)
           
 void addRoleNotification(RoleNotification roleNotification)
           
 void addSubject(Subject subject)
           
 boolean equals(Object o)
           
 String getDescription()
           
 Boolean getFsystem()
           
 Integer getId()
           
 int getMemberCount()
           
 String getName()
           
 Set<Permission> getPermissions()
           
 Set<ResourceGroup> getResourceGroups()
           
 Set<RoleNotification> getRoleNotifications()
           
 Set<Subject> getSubjects()
           
 int hashCode()
           
 boolean removePermission(Permission permission)
           
 void removeResourceGroup(ResourceGroup resourceGroup)
           
 void removeSubject(Subject subject)
           
 void setDescription(String description)
           
 void setFsystem(Boolean fsystem)
           
 void setId(Integer id)
           
 void setName(String name)
           
 void setPermissions(Set<Permission> permissions)
           
 void setResourceGroups(Set<ResourceGroup> resourceGroups)
           
 void setRoleNotifications(Set<RoleNotification> roleNotifications)
           
 void setSubjects(Set<Subject> subjects)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_ALL

public static final String QUERY_FIND_ALL
See Also:
Constant Field Values

QUERY_FIND_BY_IDS

public static final String QUERY_FIND_BY_IDS
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_ROLES_WITH_EXCLUDES

public static final String QUERY_FIND_AVAILABLE_ROLES_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_ROLES

public static final String QUERY_FIND_AVAILABLE_ROLES
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION_WITH_EXCLUDES

public static final String QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION

public static final String QUERY_FIND_AVAILABLE_ROLES_FOR_ALERT_DEFINITION
See Also:
Constant Field Values
Constructor Detail

Role

protected Role()

Role

public Role(@NotNull
            String name)
Method Detail

getId

public Integer getId()

setId

public void setId(Integer id)

getName

@NotNull
public String getName()

setName

public void setName(@NotNull
                    String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getFsystem

public Boolean getFsystem()

setFsystem

public void setFsystem(Boolean fsystem)

getPermissions

public Set<Permission> getPermissions()

setPermissions

public void setPermissions(Set<Permission> permissions)

addPermission

public void addPermission(Permission permission)

removePermission

public boolean removePermission(Permission permission)

getSubjects

public Set<Subject> getSubjects()

setSubjects

public void setSubjects(Set<Subject> subjects)

addSubject

public void addSubject(Subject subject)

removeSubject

public void removeSubject(Subject subject)

getResourceGroups

public Set<ResourceGroup> getResourceGroups()

setResourceGroups

public void setResourceGroups(Set<ResourceGroup> resourceGroups)

addResourceGroup

public void addResourceGroup(ResourceGroup resourceGroup)

removeResourceGroup

public void removeResourceGroup(ResourceGroup resourceGroup)

getRoleNotifications

public Set<RoleNotification> getRoleNotifications()

setRoleNotifications

public void setRoleNotifications(Set<RoleNotification> roleNotifications)

addRoleNotification

public void addRoleNotification(RoleNotification roleNotification)

getMemberCount

public int getMemberCount()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.