|
||||||||||
| 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
DefaultConfigurable.Modified |
| Field Summary |
|---|
| 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_DOMAIN_PROPERTY, DEFAULT_ROLE_PROPERTY, DIGEST_ALGORITHM_PROPERTY, MEMBER_PROPERTY, PUBLIC_NAME_PROPERTY, SECRET_KEY_ALGORITHM, SECRET_KEY_PROPERTY |
| 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 the user search. |
String |
getInitialContextFactory()
Gets the JNDI initial context factory to apply. |
String |
getMsisdnSearchPattern()
Gets the message format pattern for searching MSISDNs in this realm with "{0}" marking the spot where the ISDN goes. |
String |
getPasswordAttribute()
Gets the password attribute used to retrieve the password. |
protected Principal |
getPrincipal(String domain,
String msisdn,
String scheme)
Gets the user principal representing the authenticated user identified by an MSISDN. |
protected Principal |
getPrincipal(String domain,
String username,
String password,
String scheme)
Gets the user principal representing the authenticated user identified by a username and password. |
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 |
getUserGroupAttribute()
Gets the user group attribute used to retrieve the user group. |
String |
getUsernameAttribute()
Gets the username attribute used to retrieve the username. |
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 the 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<SearchResult> |
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 the user search. |
void |
setInitialContextFactory(String factory)
Sets the JNDI initial context factory to apply. |
void |
setMsisdnSearchPattern(String pattern)
Sets the message format pattern for searching MSISDNs in this realm with "{0}" marking the spot where the ISDN goes. |
void |
setPasswordAttribute(String name)
Sets the password attribute used to retrieve the 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 |
setUserGroupAttribute(String name)
Sets the user group attribute used to retrieve the user group. |
void |
setUsernameAttribute(String name)
Sets the username attribute used to retrieve the username. |
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 the 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 |
validateConfiguration(Configuration config)
Validates the configuration. |
| Methods inherited from class org.norther.tammi.core.realm.AbstractRealm |
|---|
addRoles, authenticate, authenticate, authenticate, authenticate, authenticate, createPrincipal, createPrincipal, digest, getAnonymousUser, getChallenge, getDefaultDomain, getDefaultRole, getDigestAlgorithm, getMemberMap, getMessageDigest, getPublicName, handshake, identify, identify, identify, isAuthenticated, isAuthenticated, isCachedPasswords, isUserInRole, release, setAnonymousUser, setCachedPasswords, setDefaultDomain, setDefaultRole, setDigestAlgorithm, setPublicName, setSecretKey |
| 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, digest, getAnonymousUser, getChallenge, getDefaultDomain, getDefaultRole, getDigestAlgorithm, getPublicName, handshake, identify, identify, identify, isAuthenticated, isAuthenticated, isCachedPasswords, isUserInRole, release, setAnonymousUser, setCachedPasswords, setDefaultDomain, setDefaultRole, setDigestAlgorithm, setPublicName, setSecretKey |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties |
| 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 getUsernameAttribute()
JndiRealm
getUsernameAttribute in interface JndiRealmpublic void setUsernameAttribute(String name)
JndiRealm
setUsernameAttribute in interface JndiRealmname - the username attributepublic String getPasswordAttribute()
JndiRealm
getPasswordAttribute in interface JndiRealmpublic void setPasswordAttribute(String name)
JndiRealm
setPasswordAttribute in interface JndiRealmname - the password attributepublic String getUserGroupAttribute()
JndiRealm
getUserGroupAttribute in interface JndiRealmpublic void setUserGroupAttribute(String name)
JndiRealm
setUserGroupAttribute in interface JndiRealmname - the role name attribute.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 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 getMsisdnSearchPattern()
JndiRealm
getMsisdnSearchPattern in interface JndiRealmpublic void setMsisdnSearchPattern(String pattern)
JndiRealm
setMsisdnSearchPattern in interface JndiRealmpattern - the MSISDN search pattern.public String getDefaultLocaleAttribute()
JndiRealm
getDefaultLocaleAttribute in interface JndiRealmpublic void setDefaultLocaleAttribute(String name)
JndiRealm
setDefaultLocaleAttribute in interface JndiRealmname - the default 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<SearchResult> 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 msisdn,
String scheme)
AbstractRealm
getPrincipal in class AbstractRealmdomain - the domain.msisdn - the MSISDN.scheme - the authentication scheme.
protected Principal getPrincipal(String domain,
String username,
String password,
String scheme)
AbstractRealm
getPrincipal in class AbstractRealmdomain - the domain.username - the username.password - the user password.scheme - the authentication scheme.
protected void validateConfiguration(Configuration config)
DefaultConfigurable
validateConfiguration in class AbstractRealmconfig - the configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||