|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.authentication.credentialsmanagers.MemoryUsers
public class MemoryUsers
| Field Summary | |
|---|---|
static String |
DEFAULT_PARTICIPANT_NAME
|
protected StringEncryptor |
mPasswordEncryptor
|
| Constructor Summary | |
|---|---|
MemoryUsers()
|
|
MemoryUsers(String xmlPath,
ResourceFinder resourceFinder)
|
|
| Method Summary | |
|---|---|
MemoryUsers |
addRole(String role)
|
MemoryUsers |
addUser(String login,
RoleUserAttributes attributes)
|
void |
clearUsers()
|
boolean |
containsRole(String role)
|
boolean |
containsUser(String login)
|
long |
countRoles()
|
long |
countUsers()
|
RoleUserAttributes |
getAttributes(String login)
Retrieves the attributes of a particular user according to its unique login. |
String |
getLogin(long userId)
Retrieves the login of a particular user according to its unique ID. |
StringEncryptor |
getPasswordEncryptor()
|
static MemoryUsers |
getRepInstance()
|
long |
getUserId(String login)
|
String |
getXmlPath()
Retrieves the path of the XML document that populated this MemoryUsers instance. |
static boolean |
hasRepInstance()
|
boolean |
isUserInRole(long userId,
String role)
|
boolean |
listRoles(ListRoles processor)
|
boolean |
listUserRoles(String login,
ListRoles processor)
|
boolean |
listUsers(ListUsers processor)
|
boolean |
listUsers(ListUsers processor,
int limit,
int offset)
|
boolean |
listUsersInRole(ListUsers processor,
String role)
|
boolean |
removeRole(String name)
|
boolean |
removeUser(long userId)
|
boolean |
removeUser(String login)
|
void |
setPasswordEncryptor(StringEncryptor passwordEncryptor)
Sets the password encryptor to use to encrypt this credentials manager's passwords. |
void |
storeToXml()
|
void |
storeToXml(File destination)
|
String |
toXml()
|
boolean |
updateUser(String login,
RoleUserAttributes attributes)
|
long |
verifyCredentials(Credentials credentials)
Verifies the validity of the provided Credentials
instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PARTICIPANT_NAME
protected StringEncryptor mPasswordEncryptor
| Constructor Detail |
|---|
public MemoryUsers()
public MemoryUsers(String xmlPath,
ResourceFinder resourceFinder)
throws CredentialsManagerException
CredentialsManagerException| Method Detail |
|---|
public String getXmlPath()
MemoryUsers instance.
MemoryUsers instancepublic StringEncryptor getPasswordEncryptor()
public void setPasswordEncryptor(StringEncryptor passwordEncryptor)
PasswordEncrypting
setPasswordEncryptor in interface PasswordEncryptingpasswordEncryptor - the password ecryptor that will be usedpublic static boolean hasRepInstance()
public static MemoryUsers getRepInstance()
public long verifyCredentials(Credentials credentials)
throws CredentialsManagerException
CredentialsManagerCredentials
instance.
verifyCredentials in interface CredentialsManagercredentials - The Credentials instance that needs to
be verified.
long that uniquely identifies the user that
corresponds to the validated credentials; or
-1 if the credentials are invalid.
CredentialsManagerException - An undefined number of
exceptional cases or error situations can occur when credentials are
verified. They are all indicated by throwing an instance of
CredentialsManagerException. It's up to the
implementations of this interface to give more specific meanings to
these exceptions.
public MemoryUsers addRole(String role)
throws CredentialsManagerException
addRole in interface RoleUsersManagerCredentialsManagerExceptionpublic long countRoles()
countRoles in interface RoleUsersManagerpublic boolean containsRole(String role)
containsRole in interface RoleUsersManager
public MemoryUsers addUser(String login,
RoleUserAttributes attributes)
throws CredentialsManagerException
addUser in interface RoleUsersManagerCredentialsManagerExceptionpublic RoleUserAttributes getAttributes(String login)
IdentifiableUsersManager
getAttributes in interface IdentifiableUsersManagerlogin - the login of the user whose attributes need to be retrieved
null if the user couldn't be found
public long countUsers()
countUsers in interface RoleUsersManagerpublic boolean listRoles(ListRoles processor)
listRoles in interface RoleUsersManagerpublic boolean listUsers(ListUsers processor)
listUsers in interface RoleUsersManager
public boolean listUsers(ListUsers processor,
int limit,
int offset)
listUsers in interface RoleUsersManagerpublic boolean containsUser(String login)
containsUser in interface RoleUsersManager
public boolean listUsersInRole(ListUsers processor,
String role)
throws CredentialsManagerException
listUsersInRole in interface RoleUsersManagerCredentialsManagerException
public boolean isUserInRole(long userId,
String role)
isUserInRole in interface RoleUsersManagerpublic String getLogin(long userId)
IdentifiableUsersManager
getLogin in interface IdentifiableUsersManageruserId - the ID of the user whose login will be retrieved
null if the user couldn't be found
public long getUserId(String login)
getUserId in interface RoleUsersManager
public boolean updateUser(String login,
RoleUserAttributes attributes)
throws CredentialsManagerException
updateUser in interface RoleUsersManagerCredentialsManagerExceptionpublic boolean removeUser(String login)
removeUser in interface RoleUsersManagerpublic boolean removeUser(long userId)
removeUser in interface RoleUsersManagerpublic boolean removeRole(String name)
removeRole in interface RoleUsersManagerpublic void clearUsers()
clearUsers in interface RoleUsersManager
public boolean listUserRoles(String login,
ListRoles processor)
throws CredentialsManagerException
listUserRoles in interface RoleUsersManagerCredentialsManagerExceptionpublic String toXml()
public void storeToXml()
throws CredentialsManagerException
CredentialsManagerException
public void storeToXml(File destination)
throws CredentialsManagerException
CredentialsManagerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||