|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
org.norther.tammi.core.realm.AbstractRealm
org.norther.tammi.core.realm.DefaultMemoryRealm
public class DefaultMemoryRealm
A default implementation of MemoryRealm.
Based on MemoryRealm in the Apache Jakarta Tomcat project.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
MODIFIED, SYNCHRONIZED, UNMODIFIED |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.realm.MemoryRealm |
|---|
LOCALE_PROPERTY, PASSWORD_PROPERTY, 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 |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultMemoryRealm()
Constructs a new realm. |
|
| 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. |
protected Principal |
getPrincipal(String domain,
String username,
String password)
Gets the user principal representing the authenticated user. |
List |
getRoles(String username)
Gets roles. |
void |
loadPasswordFile(String path,
boolean shadow)
Loads encrypted passwords from the Unix kind of passwd/shadow file. |
void |
removeRole(String username,
String role)
Removes a role. |
void |
removeUser(String username)
Removes a user. |
void |
setRoles(String username,
List roles)
Sets roles. |
protected void |
updateProperties()
Updates properties. |
| Methods inherited from class org.norther.tammi.core.realm.AbstractRealm |
|---|
addRoles, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, checkProperties, createPrincipal, createPrincipal, digest, generateAuthenticate, getAnonymousUser, getAuthType, getDefaultRole, getDigestAlgorithm, getMemberMap, getMessageDigest, getPublicName, identify, identify, isAuthenticated, isAuthenticated, isCachedPasswords, isUserInRole, setAnonymousUser, setCachedPasswords, setDefaultRole, setDigestAlgorithm, setPublicName |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 |
| Constructor Detail |
|---|
public DefaultMemoryRealm()
| Method Detail |
|---|
public void addUser(String username,
String password)
throws LogException
MemoryRealm
addUser in interface MemoryRealmusername - the username.password - the password.
LogException - if already exists.
public void addUser(String username,
String password,
List roles)
throws LogException
MemoryRealm
addUser in interface MemoryRealmusername - the username.password - the password.roles - a list of roles.
LogException - if already exists.
public void changePassword(String username,
String password)
throws LogException
MemoryRealm
changePassword in interface MemoryRealmusername - the username.password - the password.
LogException - if not found.
public void addRole(String username,
String role)
throws LogException
MemoryRealm
addRole in interface MemoryRealmusername - the username.role - the role to add.
LogException - if not found.
public void removeRole(String username,
String role)
throws LogException
MemoryRealm
removeRole in interface MemoryRealmusername - the username.role - the role to remove.
LogException - if not found.
public List getRoles(String username)
throws LogException
MemoryRealm
getRoles in interface MemoryRealmusername - the username.
LogException - if not found.
public void setRoles(String username,
List roles)
throws LogException
MemoryRealm
setRoles in interface MemoryRealmusername - the username.roles - a list of roles.
LogException - if not found.public void removeUser(String username)
MemoryRealm
removeUser in interface MemoryRealmusername - the username.
public void loadPasswordFile(String path,
boolean shadow)
throws LogException
path - the pathname of the password file either relative to the
config key folder or as an absolute path.shadow - true, if the content is in the shadow format, otherwise
passwd format.
LogException - if problems in accessing the files.
protected Principal getPrincipal(String domain,
String username,
String password)
AbstractRealm
getPrincipal in class AbstractRealmdomain - the domain.username - the username.password - the user password.
protected void updateProperties()
AbstractRealm
updateProperties in class AbstractRealm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||