|
||||||||||
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 Manageable
postmanaged
in class Adaptee
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class Adaptee
Exception
- if the adaptee refused to be unmanaged.public String getInitialContextFactory()
JndiRealm
getInitialContextFactory
in interface JndiRealm
public void setInitialContextFactory(String factory)
JndiRealm
setInitialContextFactory
in interface JndiRealm
factory
- the initial context factory.public String getProviderURL()
JndiRealm
getProviderURL
in interface JndiRealm
public void setProviderURL(String URL)
JndiRealm
setProviderURL
in interface JndiRealm
URL
- the provider URL.public String getSecurityPrincipal()
JndiRealm
getSecurityPrincipal
in interface JndiRealm
public void setSecurityPrincipal(String username)
JndiRealm
setSecurityPrincipal
in interface JndiRealm
username
- the security principal.public void setSecurityCredentials(String password)
JndiRealm
setSecurityCredentials
in interface JndiRealm
password
- the security credentials.public String getSecurityAuthentication()
JndiRealm
getSecurityAuthentication
in interface JndiRealm
public void setSecurityAuthentication(String authentication)
JndiRealm
javax.naming.Context
interface, e.g.
"none", "simple" or a SASL mechanism like "DIGEST-MD5".
setSecurityAuthentication
in interface JndiRealm
authentication
- the security authentication.public String getSecurityProtocol()
JndiRealm
getSecurityProtocol
in interface JndiRealm
public void setSecurityProtocol(String protocol)
JndiRealm
setSecurityProtocol
in interface JndiRealm
protocol
- the security protocol.public String getReferral()
JndiRealm
getReferral
in interface JndiRealm
public void setReferral(String instruction)
JndiRealm
javax.naming.Context
inteface, e.g. "follow", "ignore" or
"throw".
setReferral
in interface JndiRealm
instruction
- the referrals processing instruction.public String getUserBase()
JndiRealm
getUserBase
in interface JndiRealm
public void setUserBase(String base)
JndiRealm
setUserBase
in interface JndiRealm
base
- the user base name.public int getUserSearchScope()
JndiRealm
getUserSearchScope
in interface JndiRealm
public void setUserSearchScope(int scope)
JndiRealm
javax.naming.directory.SearchControls
.
setUserSearchScope
in interface JndiRealm
scope
- the user search scope.public String getUserSearchPattern()
JndiRealm
getUserSearchPattern
in interface JndiRealm
public void setUserSearchPattern(String pattern)
JndiRealm
setUserSearchPattern
in interface JndiRealm
pattern
- the user search pattern.public String getUsernamePattern()
JndiRealm
getUsernamePattern
in interface JndiRealm
public void setUsernamePattern(String pattern)
JndiRealm
setUsernamePattern
in interface JndiRealm
pattern
- the username pattern.public String getUsernameAttribute()
JndiRealm
getUsernameAttribute
in interface JndiRealm
public void setUsernameAttribute(String name)
JndiRealm
setUsernameAttribute
in interface JndiRealm
name
- the username attributepublic String getPasswordAttribute()
JndiRealm
getPasswordAttribute
in interface JndiRealm
public void setPasswordAttribute(String name)
JndiRealm
setPasswordAttribute
in interface JndiRealm
name
- the password attributepublic String getUserGroupAttribute()
JndiRealm
getUserGroupAttribute
in interface JndiRealm
public void setUserGroupAttribute(String name)
JndiRealm
setUserGroupAttribute
in interface JndiRealm
name
- the role name attribute.public String getRoleBase()
JndiRealm
getRoleBase
in interface JndiRealm
public void setRoleBase(String base)
JndiRealm
setRoleBase
in interface JndiRealm
base
- the role base name.public int getRoleSearchScope()
JndiRealm
getRoleSearchScope
in interface JndiRealm
public void setRoleSearchScope(int scope)
JndiRealm
javax.naming.directory.SearchControls
.
setRoleSearchScope
in interface JndiRealm
scope
- the role search scope.public String getRoleSearchPattern()
JndiRealm
getRoleSearchPattern
in interface JndiRealm
public void setRoleSearchPattern(String pattern)
JndiRealm
setRoleSearchPattern
in interface JndiRealm
pattern
- the new role search pattern.public String getRoleNameAttribute()
JndiRealm
getRoleNameAttribute
in interface JndiRealm
public void setRoleNameAttribute(String name)
JndiRealm
setRoleNameAttribute
in interface JndiRealm
name
- the role name attribute.public String getUserRoleNameAttribute()
JndiRealm
getUserRoleNameAttribute
in interface JndiRealm
public void setUserRoleNameAttribute(String name)
JndiRealm
setUserRoleNameAttribute
in interface JndiRealm
name
- the user role name attribute.public String getMsisdnSearchPattern()
JndiRealm
getMsisdnSearchPattern
in interface JndiRealm
public void setMsisdnSearchPattern(String pattern)
JndiRealm
setMsisdnSearchPattern
in interface JndiRealm
pattern
- the MSISDN search pattern.public String getDefaultLocaleAttribute()
JndiRealm
getDefaultLocaleAttribute
in interface JndiRealm
public void setDefaultLocaleAttribute(String name)
JndiRealm
setDefaultLocaleAttribute
in interface JndiRealm
name
- the default locale attribute.public Attributes getAttributes(String name) throws NamingException
JndiRealm
getAttributes
in interface JndiRealm
name
- the name of the object.
NamingException
- if a naming exception is encountered.public List<SearchResult> search(String name, String filter, int scope) throws NamingException
JndiRealm
javax.naming.directory.SearchControls
. A
list of javax.naming.directory.SearchResult
objects is
returned as the result.
search
in interface JndiRealm
name
- 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 JndiRealm
NamingException
- if a naming exception is encountered.protected Principal getPrincipal(String domain, String msisdn, String scheme)
AbstractRealm
getPrincipal
in class AbstractRealm
domain
- the domain.msisdn
- the MSISDN.scheme
- the authentication scheme.
protected Principal getPrincipal(String domain, String username, String password, String scheme)
AbstractRealm
getPrincipal
in class AbstractRealm
domain
- the domain.username
- the username.password
- the user password.scheme
- the authentication scheme.
protected void validateConfiguration(Configuration config)
DefaultConfigurable
validateConfiguration
in class AbstractRealm
config
- the configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |