|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.auth.SubjectManagerBean
public class SubjectManagerBean
Provides functionality to access and manipulate subjects and principals, mainly for authentication purposes.
| Constructor Summary | |
|---|---|
SubjectManagerBean()
|
|
| Method Summary | |
|---|---|
boolean |
authenticateTemporarySessionPassword(java.lang.String password)
Tests the validity of the given session password. |
void |
changePassword(Subject whoami,
java.lang.String username,
java.lang.String password)
#see {@link SubjectManagerRemote#changePassword(Subject, String, String) |
void |
createPrincipal(Subject whoami,
Principal principal)
Creates a new principal (username and password) in the internal database. |
void |
createPrincipal(Subject whoami,
java.lang.String username,
java.lang.String password)
#see {@link SubjectManagerRemote#createPrincipal(Subject, String, String) |
Subject |
createSubject(Subject whoami,
Subject subject)
#see {@link SubjectManagerRemote#createSubject(Subject, Subject) |
void |
deleteSubjects(Subject sessionSubject,
int[] subjectIds)
#see {@link SubjectManagerRemote#deleteSubjects(Subject, int[]) |
void |
deleteUsers(Subject subject,
int[] subjectIds)
Deletes the given set of users, including both the Subject and Principal objects associated with
those users. |
PageList<Subject> |
findAllSubjects(PageControl pc)
|
java.util.Collection<java.lang.String> |
findAllUsersWithPrincipals()
Get a collection of all user names, where the collection contains the names of all users that have principals only. |
PageList<Subject> |
findAvailableSubjectsForAlertDefinition(Subject whoami,
java.lang.Integer alertDefinitionId,
java.lang.Integer[] pendingSubjectIds,
PageControl pc)
This returns a list of subjects that are available to be assigned to a given alert definition but not yet assigned to that alert definition. |
PageList<Subject> |
findAvailableSubjectsForRole(Subject whoami,
java.lang.Integer roleId,
java.lang.Integer[] pendingSubjectIds,
PageControl pc)
This returns a list of subjects that are available to be assigned to a given role but not yet assigned to that role. |
PageList<Subject> |
findSubjectsByCriteria(Subject subject,
SubjectCriteria criteria)
|
PageList<Subject> |
findSubjectsById(java.lang.Integer[] subjectIds,
PageControl pc)
Given a set of subject Ids, this returns a list of all the subjects. |
java.lang.String |
generateTemporarySessionPassword(int sessionId)
Generates a one-time temporary session password for the given session. |
Subject |
getOverlord()
This returns the system super user subject that can be used to authorize the caller for any other system call. |
Subject |
getSessionSubject(int sessionId)
Returns the actual Subject for the given session. |
Subject |
getSubjectById(int id)
#see SubjectManagerRemote#getSubjectById(Subject, int) |
Subject |
getSubjectByName(java.lang.String username)
Looks up the existing of a subject by the given username. |
boolean |
isLoggedIn(java.lang.String username)
|
boolean |
isUserWithPrincipal(java.lang.String username)
Checks that the user exists and has a Principal associated with it. |
boolean |
isValidSessionId(int session,
java.lang.String username)
Determines if the given session ID is valid and it is associated with the given user. |
Subject |
loadUserConfiguration(java.lang.Integer subjectId)
Loads in the given subject's configuration. |
Subject |
login(java.lang.String username,
java.lang.String password)
Logs a user into the system. |
Subject |
loginUnauthenticated(java.lang.String username,
boolean reattach)
Logs in a user without performing any authentication. |
void |
logout(int sessionId)
Logs out a user. |
void |
logout(Subject subject)
Logs out a user. |
Subject |
updateSubject(Subject whoami,
Subject subjectToModify)
Updates an existing subject with new data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SubjectManagerBean()
| Method Detail |
|---|
public Subject loadUserConfiguration(java.lang.Integer subjectId)
SubjectManagerLocalconfiguration.
loadUserConfiguration in interface SubjectManagerLocalsubjectId - identifies the subject whose user configuration is to be loaded
SubjectManagerLocal.loadUserConfiguration(Integer)
public PageList<Subject> findSubjectsById(java.lang.Integer[] subjectIds,
PageControl pc)
SubjectManagerLocal
findSubjectsById in interface SubjectManagerLocalSubjectManagerLocal.findSubjectsById(Integer[],PageControl)
public Subject updateSubject(Subject whoami,
Subject subjectToModify)
SubjectManagerRemote
updateSubject in interface SubjectManagerLocalupdateSubject in interface SubjectManagerRemotewhoami - The logged in user's subject.subjectToModify - the subject whose data is to be updated (which may or may not be the same as user)
subjectToModifySubjectManagerLocal.updateSubject(Subject, Subject)public Subject getOverlord()
SubjectManagerLocal
getOverlord in interface SubjectManagerLocalSubjectManagerLocal.getOverlord()public Subject getSubjectByName(java.lang.String username)
SubjectManagerRemote
getSubjectByName in interface SubjectManagerLocalgetSubjectByName in interface SubjectManagerRemoteusername - the name of the subject to look for
null if not foundorg.rhq.enterprise.server.auth.SubjectManagerRemote#g(Subject,String)
public Subject createSubject(Subject whoami,
Subject subject)
throws SubjectException
SubjectManagerLocal
createSubject in interface SubjectManagerLocalcreateSubject in interface SubjectManagerRemotewhoami - The logged in user's subject.subject - The subject to be created.
Subject
SubjectExceptionSubjectManagerLocal.createSubject(Subject, Subject)public PageList<Subject> findAllSubjects(PageControl pc)
findAllSubjects in interface SubjectManagerLocalSubjectManagerLocal.findAllSubjects(PageControl)public Subject getSubjectById(int id)
SubjectManagerLocalSubjectManagerRemote#getSubjectById(Subject, int)
getSubjectById in interface SubjectManagerLocalorg.rhq.enterprise.server.auth.SubjectManagerLocal#getSubjectById(org.rhq.core.domain.auth.Subject, int)public java.lang.String generateTemporarySessionPassword(int sessionId)
SubjectManagerLocalNote that this method should only be available on this EJB's local interface.
generateTemporarySessionPassword in interface SubjectManagerLocalsessionId - the session to assign a temporary password to
SubjectManagerLocal.generateTemporarySessionPassword(int)
public boolean authenticateTemporarySessionPassword(java.lang.String password)
throws java.lang.Exception
SubjectManagerLocaltrue if the password is valid and the
session is still valid.
authenticateTemporarySessionPassword in interface SubjectManagerLocalpassword - a temporary session password that was created by SubjectManagerLocal.generateTemporarySessionPassword(int).
true if the given password is valid and its associated session is still valid
java.lang.Exception - if the password was valid but its associated session has either timed out or was invalidatedSubjectManagerLocal.authenticateTemporarySessionPassword(java.lang.String)
public Subject login(java.lang.String username,
java.lang.String password)
throws LoginException
SubjectManagerRemote
login in interface SubjectManagerLocallogin in interface SubjectManagerRemoteusername - The name of the user.password - The password.
LoginException - if the login failed for some reasonSubjectManagerLocal.login(String, String)public void logout(Subject subject)
SubjectManagerRemote
logout in interface SubjectManagerLocallogout in interface SubjectManagerRemoteSubjectManagerLocal.logout(Subject)public void logout(int sessionId)
logout in interface SubjectManagerLocalsessionId - The sessionId for the user to log outpublic boolean isLoggedIn(java.lang.String username)
isLoggedIn in interface SubjectManagerLocalSubjectManagerLocal.isLoggedIn(java.lang.String)
public void createPrincipal(Subject whoami,
java.lang.String username,
java.lang.String password)
throws SubjectException
SubjectManagerLocal
createPrincipal in interface SubjectManagerLocalcreatePrincipal in interface SubjectManagerRemotewhoami - The logged in user's subject.username - The username part of the principalpassword - The password part ofthe principal
SubjectExceptionSubjectManagerLocal.createPrincipal(Subject, String, String)
public void createPrincipal(Subject whoami,
Principal principal)
throws SubjectException
SubjectManagerLocal
createPrincipal in interface SubjectManagerLocalwhoami - The subject of the currently logged in userprincipal - The principal to add
SubjectExceptionSubjectManagerLocal.createPrincipal(Subject, Principal)
public void changePassword(Subject whoami,
java.lang.String username,
java.lang.String password)
SubjectManagerLocal
changePassword in interface SubjectManagerLocalchangePassword in interface SubjectManagerRemotewhoami - The logged in user's subject.username - The user whose password will be changedpassword - The new password for the userSubjectManagerLocal.changePassword(Subject, String, String)public boolean isUserWithPrincipal(java.lang.String username)
SubjectManagerLocalPrincipal associated with it. This means that the user both
exists and is authenticated via JDBC. An LDAP user will not have a Principal because it is authenticated
via the LDAP server, not from the database.
isUserWithPrincipal in interface SubjectManagerLocalusername - the user whose existence is to be checked
true if the user exists and has a Principal, false otherwiseSubjectManagerLocal.isUserWithPrincipal(String)public java.util.Collection<java.lang.String> findAllUsersWithPrincipals()
SubjectManagerLocal
findAllUsersWithPrincipals in interface SubjectManagerLocalSubjectManagerLocal.findAllUsersWithPrincipals()
public Subject loginUnauthenticated(java.lang.String username,
boolean reattach)
throws LoginException
SubjectManagerLocaltrue for the "reattach", this method will
re-attach to an existing session for the user, if one is active already. If one does not exist, this method will
login and create a new session just as if that parameter was false.
loginUnauthenticated in interface SubjectManagerLocalusername - The user to authenticate and loginreattach - If true, will re-attach to an existing login session, if one exists
Subject
LoginException - if failed to create a new session for the given userSubjectManagerLocal.loginUnauthenticated(String, boolean)
public void deleteUsers(Subject subject,
int[] subjectIds)
SubjectManagerLocalSubject and Principal objects associated with
those users.
deleteUsers in interface SubjectManagerLocalsubject - the person requesting the deletionsubjectIds - identifies the subject IDs for all the users that are to be deletedSubjectManagerLocal.deleteUsers(Subject, int[])
public void deleteSubjects(Subject sessionSubject,
int[] subjectIds)
SubjectManagerLocal
deleteSubjects in interface SubjectManagerLocaldeleteSubjects in interface SubjectManagerRemotesessionSubject - The logged in user's subject.subjectIds - identifies the subject IDs for all the users that are to be deletedTODO: A wrapper method for deleteUsers, exposed in remote, both should be merged at some point.
public Subject getSessionSubject(int sessionId)
throws java.lang.Exception
SubjectManagerLocalSubject for the given session.
getSessionSubject in interface SubjectManagerLocalSubject representation of the user that is logged in with that session ID
java.lang.Exception - if the subject could not be retreived for some reasonSubjectManagerLocal.getSessionSubject(int)
public boolean isValidSessionId(int session,
java.lang.String username)
SubjectManagerLocal
isValidSessionId in interface SubjectManagerLocaltrue if the session ID indentifies a valid session; false if it is invalid or
has timed outSubjectManagerLocal.isValidSessionId(int, String)
public PageList<Subject> findAvailableSubjectsForAlertDefinition(Subject whoami,
java.lang.Integer alertDefinitionId,
java.lang.Integer[] pendingSubjectIds,
PageControl pc)
SubjectManagerLocalpendingSubjectIds since it is assumed the pending
subjects will be assigned to the alert definition.
findAvailableSubjectsForAlertDefinition in interface SubjectManagerLocalwhoami - user attempting to make this callalertDefinitionId - the alert definition whose list of available subjects are to be returnedpendingSubjectIds - the list of subjects that are planned to be given to the alert definition
public PageList<Subject> findAvailableSubjectsForRole(Subject whoami,
java.lang.Integer roleId,
java.lang.Integer[] pendingSubjectIds,
PageControl pc)
SubjectManagerLocalpendingSubjectIds since it is assumed the pending subjects will be assigned to the
role.
findAvailableSubjectsForRole in interface SubjectManagerLocalwhoami - user attempting to make this callroleId - the role whose list of available subjects are to be returnedpendingSubjectIds - the list of subjects that are planned to be given to the role
public PageList<Subject> findSubjectsByCriteria(Subject subject,
SubjectCriteria criteria)
findSubjectsByCriteria in interface SubjectManagerLocalfindSubjectsByCriteria in interface SubjectManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||