Package org.teiid.resource.adapter.ldap
Class LDAPConnectionImpl
- java.lang.Object
-
- org.teiid.resource.spi.BasicConnection
-
- org.teiid.resource.adapter.ldap.LDAPConnectionImpl
-
- All Implemented Interfaces:
Context,DirContext,LdapContext,javax.resource.cci.Connection,Connection,ResourceConnection
public class LDAPConnectionImpl extends BasicConnection implements LdapContext
Represents a connection to an LDAP data source.
-
-
Field Summary
Fields Modifier and Type Field Description static StringLDAP_REFERRAL_MODEstatic StringLDAP_USER_OBJECT_TYPE-
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
-
Fields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
-
Fields inherited from interface javax.naming.ldap.LdapContext
CONTROL_FACTORIES
-
-
Constructor Summary
Constructors Constructor Description LDAPConnectionImpl(LDAPManagedConnectionFactory config)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.teiid.resource.spi.ResourceConnection
cleanUp, createInteraction, getLocalTransaction, getMetaData, getResultSetInfo, getXAResource
-
-
-
-
Field Detail
-
LDAP_USER_OBJECT_TYPE
public static final String LDAP_USER_OBJECT_TYPE
- See Also:
- Constant Field Values
-
LDAP_REFERRAL_MODE
public static final String LDAP_REFERRAL_MODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPConnectionImpl
public LDAPConnectionImpl(LDAPManagedConnectionFactory config) throws javax.resource.ResourceException
- Throws:
javax.resource.ResourceException
-
-
Method Detail
-
close
public void close()
Closes LDAP context, effectively closing the connection to LDAP. (non-Javadoc)- Specified by:
closein interfacejavax.resource.cci.Connection- Specified by:
closein interfaceConnection- Specified by:
closein interfaceContext
-
isAlive
public boolean isAlive()
Description copied from interface:ResourceConnectionTests the connection to see if it is still valid.- Specified by:
isAlivein interfaceResourceConnection- Returns:
-
lookup
public Object lookup(String context) throws NamingException
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
addToEnvironment
public Object addToEnvironment(String propName, Object propVal) throws NamingException
- Specified by:
addToEnvironmentin interfaceContext- Throws:
NamingException
-
bind
public void bind(Name name, Object obj, Attributes attrs) throws NamingException
- Specified by:
bindin interfaceDirContext- Throws:
NamingException
-
bind
public void bind(Name name, Object obj) throws NamingException
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
bind
public void bind(String name, Object obj, Attributes attrs) throws NamingException
- Specified by:
bindin interfaceDirContext- Throws:
NamingException
-
bind
public void bind(String name, Object obj) throws NamingException
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
composeName
public Name composeName(Name name, Name prefix) throws NamingException
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
public String composeName(String name, String prefix) throws NamingException
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
createSubcontext
public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException
- Specified by:
createSubcontextin interfaceDirContext- Throws:
NamingException
-
createSubcontext
public Context createSubcontext(Name name) throws NamingException
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
public DirContext createSubcontext(String name, Attributes attrs) throws NamingException
- Specified by:
createSubcontextin interfaceDirContext- Throws:
NamingException
-
createSubcontext
public Context createSubcontext(String name) throws NamingException
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
public void destroySubcontext(Name name) throws NamingException
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
public void destroySubcontext(String name) throws NamingException
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
extendedOperation
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException
- Specified by:
extendedOperationin interfaceLdapContext- Throws:
NamingException
-
getAttributes
public Attributes getAttributes(Name name, String[] attrIds) throws NamingException
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
public Attributes getAttributes(Name name) throws NamingException
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
public Attributes getAttributes(String name, String[] attrIds) throws NamingException
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
public Attributes getAttributes(String name) throws NamingException
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getConnectControls
public Control[] getConnectControls() throws NamingException
- Specified by:
getConnectControlsin interfaceLdapContext- Throws:
NamingException
-
getEnvironment
public Hashtable<?,?> getEnvironment() throws NamingException
- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException
-
getNameInNamespace
public String getNameInNamespace() throws NamingException
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
getNameParser
public NameParser getNameParser(Name name) throws NamingException
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
getNameParser
public NameParser getNameParser(String name) throws NamingException
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
getRequestControls
public Control[] getRequestControls() throws NamingException
- Specified by:
getRequestControlsin interfaceLdapContext- Throws:
NamingException
-
getResponseControls
public Control[] getResponseControls() throws NamingException
- Specified by:
getResponseControlsin interfaceLdapContext- Throws:
NamingException
-
getSchema
public DirContext getSchema(Name name) throws NamingException
- Specified by:
getSchemain interfaceDirContext- Throws:
NamingException
-
getSchema
public DirContext getSchema(String name) throws NamingException
- Specified by:
getSchemain interfaceDirContext- Throws:
NamingException
-
getSchemaClassDefinition
public DirContext getSchemaClassDefinition(Name name) throws NamingException
- Specified by:
getSchemaClassDefinitionin interfaceDirContext- Throws:
NamingException
-
getSchemaClassDefinition
public DirContext getSchemaClassDefinition(String name) throws NamingException
- Specified by:
getSchemaClassDefinitionin interfaceDirContext- Throws:
NamingException
-
list
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
- Specified by:
listin interfaceContext- Throws:
NamingException
-
list
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
- Specified by:
listin interfaceContext- Throws:
NamingException
-
listBindings
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
listBindings
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
lookup
public Object lookup(Name name) throws NamingException
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookupLink
public Object lookupLink(Name name) throws NamingException
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
lookupLink
public Object lookupLink(String name) throws NamingException
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
modifyAttributes
public void modifyAttributes(Name name, int modOp, Attributes attrs) throws NamingException
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
public void modifyAttributes(String name, int modOp, Attributes attrs) throws NamingException
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
newInstance
public LdapContext newInstance(Control[] reqCtls) throws NamingException
- Specified by:
newInstancein interfaceLdapContext- Throws:
NamingException
-
rebind
public void rebind(Name name, Object obj, Attributes attrs) throws NamingException
- Specified by:
rebindin interfaceDirContext- Throws:
NamingException
-
rebind
public void rebind(Name name, Object obj) throws NamingException
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
rebind
public void rebind(String name, Object obj, Attributes attrs) throws NamingException
- Specified by:
rebindin interfaceDirContext- Throws:
NamingException
-
rebind
public void rebind(String name, Object obj) throws NamingException
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
reconnect
public void reconnect(Control[] connCtls) throws NamingException
- Specified by:
reconnectin interfaceLdapContext- Throws:
NamingException
-
removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
rename
public void rename(Name oldName, Name newName) throws NamingException
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
rename
public void rename(String oldName, String newName) throws NamingException
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, String filter, SearchControls cons) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons) throws NamingException
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
setRequestControls
public void setRequestControls(Control[] requestControls) throws NamingException
- Specified by:
setRequestControlsin interfaceLdapContext- Throws:
NamingException
-
unbind
public void unbind(Name name) throws NamingException
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
unbind
public void unbind(String name) throws NamingException
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
-