|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MemoryRealm
An interface to realms keeping their user base in memory. The realm can also be loaded from a property file by using the following syntax:
## # A new user and password. # 'user'.password = 'password' admin.password = secret guest.password = ## # Roles of the user. # 'user'.roles = 'role' admin.roles = admin ## # Locale of the user. # 'user'.locale = 'ln'_'CN' admin.locale = en_US ## # The default role to use. default.role = user ## # An anonymous user. anonymous.user = guest ## # A digest algorithm. digest.algorithm = MD5
Based on Realm in the Apache Jakarta Tomcat project.
| Field Summary | |
|---|---|
static String |
LOCALE_PROPERTY
The locale property. |
static String |
PASSWORD_PROPERTY
The password property. |
static String |
ROLES_PROPERTY
The roles property. |
| Fields inherited from interface org.norther.tammi.core.realm.Realm |
|---|
ANONYMOUS_USER_PROPERTY, CACHED_PASSWORDS_PROPERTY, DEFAULT_ROLE_PROPERTY, DIGEST_ALGORITHM_PROPERTY, MEMBER_PROPERTY, PUBLIC_NAME_PROPERTY |
| Method Summary | |
|---|---|
void |
addRole(String username,
String role)
Adds a role. |
void |
addUser(String username,
String password)
Adds a new user. |
void |
addUser(String username,
String password,
List roles)
Adds a new user with roles. |
void |
changePassword(String username,
String password)
Changes the password. |
List |
getRoles(String username)
Gets roles. |
void |
removeRole(String username,
String role)
Removes a role. |
void |
removeUser(String username)
Removes a user. |
void |
setRoles(String username,
List roles)
Sets roles. |
| Methods inherited from interface org.norther.tammi.core.realm.Realm |
|---|
authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, digest, generateAuthenticate, getAnonymousUser, getAuthType, getDefaultRole, getDigestAlgorithm, getPublicName, identify, identify, isAuthenticated, isAuthenticated, isCachedPasswords, isUserInRole, setAnonymousUser, setCachedPasswords, setDefaultRole, setDigestAlgorithm, setPublicName |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Field Detail |
|---|
static final String PASSWORD_PROPERTY
static final String ROLES_PROPERTY
static final String LOCALE_PROPERTY
| Method Detail |
|---|
void addUser(String username,
String password)
throws LogException
username - the username.password - the password.
LogException - if already exists.
void addUser(String username,
String password,
List roles)
throws LogException
username - the username.password - the password.roles - a list of roles.
LogException - if already exists.
void changePassword(String username,
String password)
throws LogException
username - the username.password - the password.
LogException - if not found.
void addRole(String username,
String role)
throws LogException
username - the username.role - the role to add.
LogException - if not found.
void removeRole(String username,
String role)
throws LogException
username - the username.role - the role to remove.
LogException - if not found.
List getRoles(String username)
throws LogException
username - the username.
LogException - if not found.
void setRoles(String username,
List roles)
throws LogException
username - the username.roles - a list of roles.
LogException - if not found.void removeUser(String username)
username - the username.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||