org.rhq.core.domain.auth
Class Subject

java.lang.Object
  extended by org.rhq.core.domain.auth.Subject
All Implemented Interfaces:
Externalizable, Serializable

public class Subject
extends Object
implements Externalizable

See Also:
Serialized Form

Field Summary
static String QUERY_CAN_VIEW_GROUP
           
static String QUERY_CAN_VIEW_RESOURCE
           
static String QUERY_FIND_ALL
           
static String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ALERT_DEFINITION
           
static String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ALERT_DEFINITION_WITH_EXCLUDES
           
static String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE
           
static String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE_WITH_EXCLUDES
           
static String QUERY_FIND_BY_IDS
           
static String QUERY_FIND_BY_NAME
           
static String QUERY_GET_GLOBAL_PERMISSIONS
           
static String QUERY_GET_PERMISSIONS_BY_GROUP_ID
           
static String QUERY_GET_PERMISSIONS_BY_RESOURCE_ID
           
static String QUERY_GET_RESOURCES_BY_PERMISSION
           
static String QUERY_GET_SUBJECTS_ASSIGNED_TO_ROLE
           
static String QUERY_HAS_GLOBAL_PERMISSION
           
static String QUERY_HAS_GROUP_PERMISSION
           
static String QUERY_HAS_RESOURCE_PERMISSION
           
 
Constructor Summary
Subject()
          Creates a new instance of Subject
Subject(String name, boolean factive, boolean fsystem)
           
 
Method Summary
 void addRole(Role role)
           
 void addSubjectNotification(SubjectNotification subjectNotification)
           
 boolean equals(Object obj)
           
 String getDepartment()
           
 String getEmailAddress()
           
 boolean getFactive()
           
 String getFirstName()
           
 boolean getFsystem()
           
 int getId()
           
 String getLastName()
           
 String getName()
           
 String getPhoneNumber()
           
 Set<Role> getRoles()
           
 Integer getSessionId()
          If not null, you can assume the user associated with this Subject has been authenticated.
 String getSmsAddress()
           
 Set<SubjectNotification> getSubjectNotifications()
           
 Configuration getUserConfiguration()
           
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 void readExternalAgent(ObjectInput in)
           
 void readExternalRemote(ObjectInput in)
           
 void removeRole(Role role)
           
 void setDepartment(String department)
           
 void setEmailAddress(String emailAddress)
           
 void setFactive(boolean factive)
           
 void setFirstName(String firstName)
           
 void setFsystem(boolean fsystem)
           
 void setId(int id)
           
 void setLastName(String lastName)
           
 void setName(String name)
           
 void setPhoneNumber(String phoneNumber)
           
 void setRoles(Set<Role> roles)
           
 void setSessionId(Integer sessionId)
          When a user successfully logs in, the user will be assigned a session ID.
 void setSmsAddress(String smsAddress)
           
 void setSubjectNotifications(Set<SubjectNotification> subjectNotifications)
           
 void setUserConfiguration(Configuration configuration)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 void writeExternalAgent(ObjectOutput out)
           
 void writeExternalRemote(ObjectOutput out)
           
 
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_BY_NAME

public static final String QUERY_FIND_BY_NAME
See Also:
Constant Field Values

QUERY_GET_SUBJECTS_ASSIGNED_TO_ROLE

public static final String QUERY_GET_SUBJECTS_ASSIGNED_TO_ROLE
See Also:
Constant Field Values

QUERY_GET_GLOBAL_PERMISSIONS

public static final String QUERY_GET_GLOBAL_PERMISSIONS
See Also:
Constant Field Values

QUERY_GET_PERMISSIONS_BY_GROUP_ID

public static final String QUERY_GET_PERMISSIONS_BY_GROUP_ID
See Also:
Constant Field Values

QUERY_GET_PERMISSIONS_BY_RESOURCE_ID

public static final String QUERY_GET_PERMISSIONS_BY_RESOURCE_ID
See Also:
Constant Field Values

QUERY_HAS_GLOBAL_PERMISSION

public static final String QUERY_HAS_GLOBAL_PERMISSION
See Also:
Constant Field Values

QUERY_HAS_GROUP_PERMISSION

public static final String QUERY_HAS_GROUP_PERMISSION
See Also:
Constant Field Values

QUERY_HAS_RESOURCE_PERMISSION

public static final String QUERY_HAS_RESOURCE_PERMISSION
See Also:
Constant Field Values

QUERY_CAN_VIEW_RESOURCE

public static final String QUERY_CAN_VIEW_RESOURCE
See Also:
Constant Field Values

QUERY_CAN_VIEW_GROUP

public static final String QUERY_CAN_VIEW_GROUP
See Also:
Constant Field Values

QUERY_GET_RESOURCES_BY_PERMISSION

public static final String QUERY_GET_RESOURCES_BY_PERMISSION
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE_WITH_EXCLUDES

public static final String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE

public static final String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ROLE
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ALERT_DEFINITION_WITH_EXCLUDES

public static final String QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ALERT_DEFINITION_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_FIND_AVAILABLE_SUBJECTS_FOR_ALERT_DEFINITION

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

Subject

public Subject()
Creates a new instance of Subject


Subject

public Subject(@NotNull
               String name,
               boolean factive,
               boolean fsystem)
Method Detail

getId

public int getId()

setSessionId

public void setSessionId(Integer sessionId)
When a user successfully logs in, the user will be assigned a session ID. This is that session ID - when not null, you can assume this user has been authenticated and is currently logged into the system.

Parameters:
sessionId -

getSessionId

public Integer getSessionId()
If not null, you can assume the user associated with this Subject has been authenticated.

Returns:
the logged in user's session ID

setId

public void setId(int id)

getName

@NotNull
public String getName()

setName

public void setName(@NotNull
                    String name)

getFirstName

public String getFirstName()

setFirstName

public void setFirstName(String firstName)

getLastName

public String getLastName()

setLastName

public void setLastName(String lastName)

getEmailAddress

public String getEmailAddress()

setEmailAddress

public void setEmailAddress(String emailAddress)

getSmsAddress

public String getSmsAddress()

setSmsAddress

public void setSmsAddress(String smsAddress)

getPhoneNumber

public String getPhoneNumber()

setPhoneNumber

public void setPhoneNumber(String phoneNumber)

getDepartment

public String getDepartment()

setDepartment

public void setDepartment(String department)

getFactive

public boolean getFactive()

setFactive

public void setFactive(boolean factive)

getFsystem

public boolean getFsystem()

setFsystem

public void setFsystem(boolean fsystem)

getUserConfiguration

public Configuration getUserConfiguration()

setUserConfiguration

public void setUserConfiguration(Configuration configuration)

getRoles

public Set<Role> getRoles()

setRoles

public void setRoles(Set<Role> roles)

addRole

public void addRole(Role role)

removeRole

public void removeRole(Role role)

getSubjectNotifications

public Set<SubjectNotification> getSubjectNotifications()

setSubjectNotifications

public void setSubjectNotifications(Set<SubjectNotification> subjectNotifications)

addSubjectNotification

public void addSubjectNotification(SubjectNotification subjectNotification)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternalAgent

public void writeExternalAgent(ObjectOutput out)
                        throws IOException
Throws:
IOException

readExternalAgent

public void readExternalAgent(ObjectInput in)
                       throws IOException,
                              ClassNotFoundException
Throws:
IOException
ClassNotFoundException

writeExternalRemote

public void writeExternalRemote(ObjectOutput out)
                         throws IOException
Throws:
IOException

readExternalRemote

public void readExternalRemote(ObjectInput in)
                        throws IOException,
                               ClassNotFoundException
Throws:
IOException
ClassNotFoundException


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