public interface SubjectManagerLocal extends SubjectManagerRemote
| Modifier and Type | Method and Description |
|---|---|
org.rhq.core.domain.auth.Subject |
checkAuthentication(String username,
String password)
Checks whether a user would successfully login with the provided credentials.
|
void |
createPrincipal(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Principal principal)
Creates a new principal (username and password) in the internal database.
|
org.rhq.core.domain.auth.Subject |
createSubject(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Subject subjectToCreate,
String password)
Creates a new subject, including their assigned roles, as well as an associated principal with the specified
password.
|
void |
deleteUsers(org.rhq.core.domain.auth.Subject subject,
int[] subjectIds)
Deletes the given set of users, including both the
Subject and Principal objects associated with
those users. |
Collection<String> |
findAllUsersWithPrincipals()
Get a collection of all user names, where the collection contains the names of all users that have principals
only.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> |
findAvailableSubjectsForRole(org.rhq.core.domain.auth.Subject whoami,
Integer roleId,
Integer[] pendingSubjectIds,
org.rhq.core.domain.util.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.
|
org.rhq.core.domain.auth.Subject |
getOverlord()
This returns the system super user subject that can be used to authorize the caller for any other system call.
|
org.rhq.core.domain.auth.Subject |
getSubjectById(int id) |
org.rhq.core.domain.auth.Subject |
getSubjectBySessionId(int sessionId) |
boolean |
isUserWithPrincipal(String username)
Checks that the user exists and has a
Principal associated with it. |
boolean |
isValidSessionId(int session,
String username,
int userid)
Determines if the given session ID is valid and it is associated with the given username and user ID.
|
org.rhq.core.domain.auth.Subject |
loadUserConfiguration(Integer subjectId)
Loads in the given subject's
preferences and
roles. |
org.rhq.core.domain.auth.Subject |
loginLocal(String username,
String password)
Logs in a user performing the authentication.
|
org.rhq.core.domain.auth.Subject |
loginUnauthenticated(String username)
Logs in a user without performing any authentication.
|
void |
logout(int sessionId) |
org.rhq.core.domain.auth.Subject |
processSubjectForLdap(org.rhq.core.domain.auth.Subject subject,
String subjectPassword) |
void |
scheduleSessionPurgeJob()
For internal use only - used by the StartupBean only - don't call this.
|
org.rhq.core.domain.auth.Subject |
updateSubject(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Subject subjectToModify,
String newPassword)
Updates an existing subject, including their assigned roles, and optionally their password.
|
changePassword, createPrincipal, createSubject, deleteSubjects, findSubjectsByCriteria, getSubjectByName, getSubjectByNameAndSessionId, login, logout, updateSubjectorg.rhq.core.domain.auth.Subject loadUserConfiguration(Integer subjectId)
preferences and
roles.subjectId - identifies the subject whose preferences and roles are to be loadedorg.rhq.core.domain.auth.Subject getOverlord()
org.rhq.core.domain.auth.Subject loginUnauthenticated(String username) throws LoginException
username - The user to loginLoginException - if failed to create a new session for the given userorg.rhq.core.domain.auth.Subject loginLocal(String username, String password) throws LoginException
SubjectManagerRemote.login(String, String) method is that the latter is meant to be used only for CLI,
because if LDAP user without any role is trying to log in (and it is disabled) this one lets the user in
because of the LDAP registration form.username - The user to loginLoginException - if failed to create a new session for the given uservoid createPrincipal(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Principal principal)
throws SubjectException
subject - The subject of the currently logged in userprincipal - The principal to addException - if the principal could not be addedSubjectExceptionboolean isUserWithPrincipal(String username)
Principal 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.username - the user whose existence is to be checkedtrue if the user exists and has a Principal, false otherwiseCollection<String> findAllUsersWithPrincipals()
void deleteUsers(org.rhq.core.domain.auth.Subject subject,
int[] subjectIds)
Subject and Principal objects associated with
those users.subject - the person requesting the deletionsubjectIds - identifies the subject IDs for all the users that are to be deletedException - if failed to delete one or more usersboolean isValidSessionId(int session,
String username,
int userid)
session - username - userid - true if the session ID indentifies a valid session; false if it is invalid or
has timed outorg.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> findAvailableSubjectsForRole(org.rhq.core.domain.auth.Subject whoami,
Integer roleId,
Integer[] pendingSubjectIds,
org.rhq.core.domain.util.PageControl pc)
pendingSubjectIds since it is assumed the pending subjects will be assigned to the
role.whoami - 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 rolepc - void logout(int sessionId)
org.rhq.core.domain.auth.Subject getSubjectById(int id)
org.rhq.core.domain.auth.Subject getSubjectBySessionId(int sessionId)
throws Exception
Exceptionorg.rhq.core.domain.auth.Subject createSubject(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Subject subjectToCreate,
String password)
throws SubjectException,
javax.persistence.EntityExistsException
subject - the logged in user's subjectsubjectToCreate - the subject to be created (which will never be the same as subject)password - the password for the principal to be created for the new userSubjectExceptionjavax.persistence.EntityExistsExceptionorg.rhq.core.domain.auth.Subject updateSubject(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.auth.Subject subjectToModify,
String newPassword)
subject - the logged in user's subjectsubjectToModify - the subject whose data is to be updated (which may or may not be the same as subject)newPassword - if non-null, a new password to be set on the user's associated principalsubjectToModify instanceorg.rhq.core.domain.auth.Subject checkAuthentication(String username, String password)
username - the usernamepassword - the passwordvoid scheduleSessionPurgeJob()
org.rhq.core.domain.auth.Subject processSubjectForLdap(org.rhq.core.domain.auth.Subject subject,
String subjectPassword)
throws LoginException
LoginExceptionCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.