|
||||||||||
| 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.DefaultJndiRealm
public class DefaultJndiRealm
A default implementation of JndiRealm.
Based on JNDIRealm in the Apache Jakarta Tomcat project.
| Field Summary | |
|---|---|
static String |
DEFAULT_LOCALE_ATTRIBUTE_PROPERTY
The default locale attribute property. |
static String |
PASSWORD_ATTRIBUTE_PROPERTY
The password attribute property. |
static String |
ROLE_BASE_PROPERTY
The role base property. |
static String |
ROLE_NAME_ATTRIBUTE_PROPERTY
The role name attribute property. |
static String |
ROLE_SEARCH_PATTERN_PROPERTY
The role search pattern property. |
static String |
ROLE_SEARCH_SCOPE_PROPERTY
The role search scope property. |
static String |
USER_BASE_PROPERTY
The user base property. |
static String |
USER_ROLE_NAME_ATTRIBUTE_PROPERTY
The user role name attribute property. |
static String |
USER_SEARCH_PATTERN_PROPERTY
The user search pattern property. |
static String |
USER_SEARCH_SCOPE_PROPERTY
The user search scope property. |
static String |
USERNAME_PATTERN_PROPERTY
The username pattern property. |
| 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.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 | |
|---|---|
DefaultJndiRealm()
Constructs a new realm. |
|
DefaultJndiRealm(String digest)
Constructs a new realm with a digest. |
|
| Method Summary | |
|---|---|
Attributes |
getAttributes(String name)
Gets all attributes associated with the named directory object. |
String |
getDefaultLocaleAttribute()
Gets the default locale attribute used to retrieve user locale from the result of of user search. |
String |
getInitialContextFactory()
Gets the JNDI initial context factory to apply. |
String |
getPasswordAttribute()
Gets the password attribute used to retrieve the user password. |
protected Principal |
getPrincipal(String domain,
String username,
String password)
Gets the user principal representing the authenticated user. |
String |
getProviderURL()
Gets the provider URL to the directory of this realm. |
String |
getReferral()
Gets the referrals processing instruction. |
String |
getRoleBase()
Gets the base name for role searches. |
String |
getRoleNameAttribute()
Gets the role name attribute used to retrieve user roles from the result of the role search. |
String |
getRoleSearchPattern()
Gets the message format used to select roles for a user, with "{0}" marking the spot where the distinguished name of the user goes, and/or "{1}" marking the spot for the username of the principal. |
int |
getRoleSearchScope()
Gets the scope for role searches. |
String |
getSecurityAuthentication()
Gets the authentication level of the connection to the directory. |
String |
getSecurityPrincipal()
Gets the principal for authenticating the connection to the directory. |
String |
getSecurityProtocol()
Gets the protocol of the connection to the directory. |
String |
getUserBase()
Gets the base name for user searches. |
String |
getUsernamePattern()
Gets the message format pattern used to form the distinguished name of a user with "{0}" marking the spot where the specified username goes. |
String |
getUserRoleNameAttribute()
Gets the user role name attribute used to retrieve user roles from the result of of user search. |
String |
getUserSearchPattern()
Gets the message format pattern for searching users in this realm with "{0}" marking the spot where the username goes. |
int |
getUserSearchScope()
Gets the scope for user searches. |
DirContext |
lookup()
Returns a new connection to the directory that can be accessed concurrently. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
List |
search(String name,
String filter,
int scope)
Searches in the named context or object for entries that satisfy the given search filter and within the given scope. |
void |
setDefaultLocaleAttribute(String name)
Sets the default locale attribute used to retrieve user locale from the result of of user search. |
void |
setInitialContextFactory(String factory)
Sets the JNDI initial context factory to apply. |
void |
setPasswordAttribute(String name)
Sets the password attribute used to retrieve the user password. |
void |
setProviderURL(String URL)
Sets the provider URL to the directory of this realm. |
void |
setReferral(String instruction)
Sets the referrals processing instruction as specified by the javax.naming.Context inteface, e.g. |
void |
setRoleBase(String base)
Sets the base name for role searches. |
void |
setRoleNameAttribute(String name)
Sets the role name attribute used to retrieve user roles from the result of the role search. |
void |
setRoleSearchPattern(String pattern)
Sets the message format used to select roles for a user, with "{0}" marking the spot where the distinguished name of the user goes, and/or "{1}" marking the spot for the username of the principal. |
void |
setRoleSearchScope(int scope)
Sets the role search scope as specified by javax.naming.directory.SearchControls. |
void |
setSecurityAuthentication(String authentication)
Sets the authentication level of the connection to the directory as specified by the javax.naming.Context interface, e.g. |
void |
setSecurityCredentials(String password)
Sets the credentials for authenticating the connection to the directory. |
void |
setSecurityPrincipal(String username)
Sets the principal for authenticating the connection to the directory. |
void |
setSecurityProtocol(String protocol)
Sets the protocol of the connection to the directory, e.g. |
void |
setUserBase(String base)
Sets the base name for user searches. |
void |
setUsernamePattern(String pattern)
Sets the message format pattern used to form the distinguished name of a user with "{0}" marking the spot where the specified username goes. |
void |
setUserRoleNameAttribute(String name)
Sets the user role name attribute used to retrieve user roles from the result of of user search. |
void |
setUserSearchPattern(String pattern)
Sets the message format pattern for searching users in this realm with "{0}" marking the spot where the username goes. |
void |
setUserSearchScope(int scope)
Sets the user search scope as specified by javax.naming.directory.SearchControls. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
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, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, 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 |
| Field Detail |
|---|
public static final String USER_BASE_PROPERTY
public static final String USER_SEARCH_SCOPE_PROPERTY
public static final String USER_SEARCH_PATTERN_PROPERTY
public static final String USERNAME_PATTERN_PROPERTY
public static final String PASSWORD_ATTRIBUTE_PROPERTY
public static final String ROLE_BASE_PROPERTY
public static final String ROLE_SEARCH_SCOPE_PROPERTY
public static final String ROLE_SEARCH_PATTERN_PROPERTY
public static final String ROLE_NAME_ATTRIBUTE_PROPERTY
public static final String USER_ROLE_NAME_ATTRIBUTE_PROPERTY
public static final String DEFAULT_LOCALE_ATTRIBUTE_PROPERTY
| Constructor Detail |
|---|
public DefaultJndiRealm()
public DefaultJndiRealm(String digest)
digest - the digest algorithm.| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public String getInitialContextFactory()
JndiRealm
getInitialContextFactory in interface JndiRealmpublic void setInitialContextFactory(String factory)
JndiRealm
setInitialContextFactory in interface JndiRealmfactory - the initial context factory.public String getProviderURL()
JndiRealm
getProviderURL in interface JndiRealmpublic void setProviderURL(String URL)
JndiRealm
setProviderURL in interface JndiRealmURL - the provider URL.public String getSecurityPrincipal()
JndiRealm
getSecurityPrincipal in interface JndiRealmpublic void setSecurityPrincipal(String username)
JndiRealm
setSecurityPrincipal in interface JndiRealmusername - the security principal.public void setSecurityCredentials(String password)
JndiRealm
setSecurityCredentials in interface JndiRealmpassword - the security credentials.public String getSecurityAuthentication()
JndiRealm
getSecurityAuthentication in interface JndiRealmpublic void setSecurityAuthentication(String authentication)
JndiRealmjavax.naming.Context interface, e.g.
"none", "simple" or a SASL mechanism like "DIGEST-MD5".
setSecurityAuthentication in interface JndiRealmauthentication - the security authentication.public String getSecurityProtocol()
JndiRealm
getSecurityProtocol in interface JndiRealmpublic void setSecurityProtocol(String protocol)
JndiRealm
setSecurityProtocol in interface JndiRealmprotocol - the security protocol.public String getReferral()
JndiRealm
getReferral in interface JndiRealmpublic void setReferral(String instruction)
JndiRealmjavax.naming.Context inteface, e.g. "follow", "ignore" or
"throw".
setReferral in interface JndiRealminstruction - the referrals processing instruction.public String getUserBase()
JndiRealm
getUserBase in interface JndiRealmpublic void setUserBase(String base)
JndiRealm
setUserBase in interface JndiRealmbase - the user base name.public int getUserSearchScope()
JndiRealm
getUserSearchScope in interface JndiRealmpublic void setUserSearchScope(int scope)
JndiRealmjavax.naming.directory.SearchControls.
setUserSearchScope in interface JndiRealmscope - the user search scope.public String getUserSearchPattern()
JndiRealm
getUserSearchPattern in interface JndiRealmpublic void setUserSearchPattern(String pattern)
JndiRealm
setUserSearchPattern in interface JndiRealmpattern - the user search pattern.public String getUsernamePattern()
JndiRealm
getUsernamePattern in interface JndiRealmpublic void setUsernamePattern(String pattern)
JndiRealm
setUsernamePattern in interface JndiRealmpattern - the username pattern.public String getRoleBase()
JndiRealm
getRoleBase in interface JndiRealmpublic void setRoleBase(String base)
JndiRealm
setRoleBase in interface JndiRealmbase - the role base name.public int getRoleSearchScope()
JndiRealm
getRoleSearchScope in interface JndiRealmpublic void setRoleSearchScope(int scope)
JndiRealmjavax.naming.directory.SearchControls.
setRoleSearchScope in interface JndiRealmscope - the role search scope.public String getRoleSearchPattern()
JndiRealm
getRoleSearchPattern in interface JndiRealmpublic void setRoleSearchPattern(String pattern)
JndiRealm
setRoleSearchPattern in interface JndiRealmpattern - the new role search pattern.public String getPasswordAttribute()
JndiRealm
getPasswordAttribute in interface JndiRealmpublic void setPasswordAttribute(String name)
JndiRealm
setPasswordAttribute in interface JndiRealmname - the password attributepublic String getRoleNameAttribute()
JndiRealm
getRoleNameAttribute in interface JndiRealmpublic void setRoleNameAttribute(String name)
JndiRealm
setRoleNameAttribute in interface JndiRealmname - the role name attribute.public String getUserRoleNameAttribute()
JndiRealm
getUserRoleNameAttribute in interface JndiRealmpublic void setUserRoleNameAttribute(String name)
JndiRealm
setUserRoleNameAttribute in interface JndiRealmname - the user role name attribute.public String getDefaultLocaleAttribute()
JndiRealm
getDefaultLocaleAttribute in interface JndiRealmpublic void setDefaultLocaleAttribute(String name)
JndiRealm
setDefaultLocaleAttribute in interface JndiRealmname - the deafult locale attribute.
public Attributes getAttributes(String name)
throws NamingException
JndiRealm
getAttributes in interface JndiRealmname - the name of the object.
NamingException - if a naming exception is encountered.
public List search(String name,
String filter,
int scope)
throws NamingException
JndiRealmjavax.naming.directory.SearchControls. A list
of javax.naming.directory.SearchResult objects is returned
as the result.
search in interface JndiRealmname - the name of context or object.filter - the search filter.scope - the scope of the search.
NamingException - if a naming exception is encountered.
public DirContext lookup()
throws NamingException
JndiRealm
lookup in interface JndiRealmNamingException - if a naming exception is encountered.
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 | |||||||||