org.apache.directory.server.ldap
Class LdapServer

java.lang.Object
  extended by org.apache.directory.server.protocol.shared.AbstractProtocolService
      extended by org.apache.directory.server.protocol.shared.DirectoryBackedService
          extended by org.apache.directory.server.ldap.LdapServer
All Implemented Interfaces:
ProtocolService

public class LdapServer
extends DirectoryBackedService

An LDAP protocol provider implementation which dynamically associates handlers.

Version:
$Rev: 674863 $
Author:
Apache Directory Project
XBean

Field Summary
static java.lang.String SERVICE_NAME
          the constant service name of this ldap protocol provider
 
Constructor Summary
LdapServer()
          Creates an LDAP protocol provider.
 
Method Summary
 void addExtendedOperationHandler(ExtendedOperationHandler eoh)
          Registeres the specified ExtendedOperationHandler to this protocol provider to provide a specific LDAP extended operation.
 MechanismHandler addSaslMechanismHandler(java.lang.String mechanism, MechanismHandler handler)
           
 AbandonHandler getAbandonHandler()
           
 AddHandler getAddHandler()
           
 BindHandler getBindHandler()
           
 org.apache.mina.filter.codec.ProtocolCodecFactory getCodecFactory()
           
 CompareHandler getCompareHandler()
           
 DeleteHandler getDeleteHandler()
           
 ExtendedHandler getExtendedHandler()
           
 ExtendedOperationHandler getExtendedOperationHandler(java.lang.String oid)
          Returns an ExtendedOperationHandler with the specified oid which is registered to this protocol provider.
 java.util.Map<java.lang.String,ExtendedOperationHandler> getExtendedOperationHandlerMap()
          Returns a Map of all registered OID-ExtendedOperationHandler pairs.
 java.util.Collection<ExtendedOperationHandler> getExtendedOperationHandlers()
          Gets the ExtendedOperationHandlers.
 org.apache.mina.common.IoHandler getHandler()
           
 int getMaxSizeLimit()
          Returns the maximum size limit in number of entries to return for search.
 int getMaxTimeLimit()
          Returns the maximum time limit in milliseonds to conduct a search.
 MechanismHandler getMechanismHandler(java.lang.String mechanism)
           
 ModifyDnHandler getModifyDnHandler()
           
 ModifyHandler getModifyHandler()
           
 java.lang.String getName()
           
 SessionRegistry getRegistry()
           
 java.lang.String getSaslHost()
          Returns the FQDN of this SASL host, validated during SASL negotiation.
 java.util.Map<java.lang.String,MechanismHandler> getSaslMechanismHandlers()
           
 java.lang.String getSaslPrincipal()
          Returns the Kerberos principal name for this LDAP service, used by GSSAPI.
 java.util.Set<java.lang.String> getSaslQop()
          Returns the Set of quality-of-protection, used by DIGEST-MD5 and GSSAPI.
 java.lang.String getSaslQopString()
          Returns the quality-of-protection, used by DIGEST-MD5 and GSSAPI.
 java.util.List<java.lang.String> getSaslRealms()
          Returns the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.
 SearchHandler getSearchHandler()
           
 java.util.Set<java.lang.String> getSupportedControls()
           
 java.util.Set<java.lang.String> getSupportedMechanisms()
           
 UnbindHandler getUnbindHandler()
           
 boolean isAllowAnonymousAccess()
          Returns true if anonymous access is allowed.
 boolean isConfidentialityRequired()
          Gets whether or not TLS secured connections are required to perform operations on this LdapServer.
 boolean isEnableLdaps()
          Returns true if LDAPS is enabled.
 boolean isStarted()
           
 void removeExtendedOperationHandler(java.lang.String oid)
          Deregisteres an ExtendedOperationHandler with the specified oid from this protocol provider.
 MechanismHandler removeSaslMechanismHandler(java.lang.String mechanism)
           
 void setAbandonHandler(AbandonHandler abandonHandler)
           
 void setAddHandler(AddHandler addHandler)
           
 void setAllowAnonymousAccess(boolean enableAnonymousAccess)
          Sets whether to allow anonymous access or not.
 void setBindHandler(BindHandler bindHandler)
           
 void setCompareHandler(CompareHandler compareHandler)
           
 void setConfidentialityRequired(boolean confidentialityRequired)
          Sets the mode for this LdapServer to accept requests with or without a TLS secured connection via either StartTLS extended operations or using LDAPS.
 void setDeleteHandler(DeleteHandler deleteHandler)
           
 void setDirectoryService(DirectoryService directoryService)
           
 void setEnableLdaps(boolean enableLdaps)
          Sets if LDAPS is enabled or not.
 void setExtendedHandler(ExtendedHandler extendedHandler)
           
 void setExtendedOperationHandlers(java.util.Collection<ExtendedOperationHandler> handlers)
          Sets the ExtendedOperationHandlers.
 void setMaxSizeLimit(int maxSizeLimit)
          Sets the maximum size limit in number of entries to return for search.
 void setMaxTimeLimit(int maxTimeLimit)
          Sets the maximum time limit in miliseconds to conduct a search.
 void setModifyDnHandler(ModifyDnHandler modifyDnHandler)
           
 void setModifyHandler(ModifyHandler modifyHandler)
           
 void setSaslHost(java.lang.String saslHost)
          Sets the FQDN of this SASL host, validated during SASL negotiation.
 void setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> saslMechanismHandlers)
           
 void setSaslPrincipal(java.lang.String saslPrincipal)
          Sets the Kerberos principal name for this LDAP service, used by GSSAPI.
 void setSaslQop(java.util.Set<java.lang.String> saslQop)
          Sets the desired quality-of-protection, used by DIGEST-MD5 and GSSAPI.
 void setSaslRealms(java.util.List<java.lang.String> saslRealms)
          Sets the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.
 void setSearchHandler(SearchHandler searchHandler)
           
 void setStarted(boolean started)
           
 void setSupportedControls(java.util.Set<java.lang.String> supportedControls)
           
 void setUnbindHandler(UnbindHandler unbindHandler)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.directory.server.protocol.shared.DirectoryBackedService
getSearchBaseDn, isCatelogBased, setCatelogBased, setSearchBaseDn
 
Methods inherited from class org.apache.directory.server.protocol.shared.AbstractProtocolService
getDatagramAcceptor, getDirectoryService, getIpAddress, getIpPort, getServiceId, getServiceName, getSocketAcceptor, getTransportProtocols, isEnabled, setDatagramAcceptor, setEnabled, setIpAddress, setIpPort, setServiceId, setServiceName, setSocketAcceptor, setTransportProtocols
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
the constant service name of this ldap protocol provider

See Also:
Constant Field Values
Constructor Detail

LdapServer

public LdapServer()
Creates an LDAP protocol provider.

Method Detail

start

public void start()
           throws javax.naming.NamingException,
                  java.io.IOException
Throws:
java.io.IOException - if we cannot bind to the specified port
javax.naming.NamingException - if the LDAP server cannot be started

stop

public void stop()

getName

public java.lang.String getName()

getCodecFactory

public org.apache.mina.filter.codec.ProtocolCodecFactory getCodecFactory()

getHandler

public org.apache.mina.common.IoHandler getHandler()

addExtendedOperationHandler

public void addExtendedOperationHandler(ExtendedOperationHandler eoh)
                                 throws javax.naming.NamingException
Registeres the specified ExtendedOperationHandler to this protocol provider to provide a specific LDAP extended operation.

Parameters:
eoh - an extended operation handler
Throws:
javax.naming.NamingException - on failure to add the handler

removeExtendedOperationHandler

public void removeExtendedOperationHandler(java.lang.String oid)
Deregisteres an ExtendedOperationHandler with the specified oid from this protocol provider.

Parameters:
oid - the numeric identifier for the extended operation associated with the handler to remove

getExtendedOperationHandler

public ExtendedOperationHandler getExtendedOperationHandler(java.lang.String oid)
Returns an ExtendedOperationHandler with the specified oid which is registered to this protocol provider.

Parameters:
oid - the oid of the extended request of associated with the extended request handler
Returns:
the exnteded operation handler

getExtendedOperationHandlerMap

public java.util.Map<java.lang.String,ExtendedOperationHandler> getExtendedOperationHandlerMap()
Returns a Map of all registered OID-ExtendedOperationHandler pairs.

Returns:
map of all extended operation handlers

isEnableLdaps

public boolean isEnableLdaps()
Returns true if LDAPS is enabled.

Returns:
True if LDAPS is enabled.

setEnableLdaps

public void setEnableLdaps(boolean enableLdaps)
Sets if LDAPS is enabled or not.

Parameters:
enableLdaps - Whether LDAPS is enabled.

isAllowAnonymousAccess

public boolean isAllowAnonymousAccess()
Returns true if anonymous access is allowed.

Returns:
True if anonymous access is allowed.

setAllowAnonymousAccess

public void setAllowAnonymousAccess(boolean enableAnonymousAccess)
Sets whether to allow anonymous access or not.

Parameters:
enableAnonymousAccess - Set true to allow anonymous access.

setMaxSizeLimit

public void setMaxSizeLimit(int maxSizeLimit)
Sets the maximum size limit in number of entries to return for search.

Parameters:
maxSizeLimit - the maximum number of entries to return for search

getMaxSizeLimit

public int getMaxSizeLimit()
Returns the maximum size limit in number of entries to return for search.

Returns:
The maximum size limit.

setMaxTimeLimit

public void setMaxTimeLimit(int maxTimeLimit)
Sets the maximum time limit in miliseconds to conduct a search.

Parameters:
maxTimeLimit - the maximum length of time in milliseconds for search

getMaxTimeLimit

public int getMaxTimeLimit()
Returns the maximum time limit in milliseonds to conduct a search.

Returns:
The maximum time limit in milliseconds for search

getExtendedOperationHandlers

public java.util.Collection<ExtendedOperationHandler> getExtendedOperationHandlers()
Gets the ExtendedOperationHandlers.

Returns:
A collection of ExtendedOperationHandlers.

setExtendedOperationHandlers

public void setExtendedOperationHandlers(java.util.Collection<ExtendedOperationHandler> handlers)
Sets the ExtendedOperationHandlers.

Parameters:
handlers - A collection of ExtendedOperationHandlers.
XBean Property
nestedType="org.apache.directory.server.ldap.ExtendedOperationHandler"

getSaslHost

public java.lang.String getSaslHost()
Returns the FQDN of this SASL host, validated during SASL negotiation.

Returns:
The FQDN of this SASL host, validated during SASL negotiation.

setSaslHost

public void setSaslHost(java.lang.String saslHost)
Sets the FQDN of this SASL host, validated during SASL negotiation.

Parameters:
saslHost - The FQDN of this SASL host, validated during SASL negotiation.

getSaslPrincipal

public java.lang.String getSaslPrincipal()
Returns the Kerberos principal name for this LDAP service, used by GSSAPI.

Returns:
The Kerberos principal name for this LDAP service, used by GSSAPI.

setSaslPrincipal

public void setSaslPrincipal(java.lang.String saslPrincipal)
Sets the Kerberos principal name for this LDAP service, used by GSSAPI.

Parameters:
saslPrincipal - The Kerberos principal name for this LDAP service, used by GSSAPI.

getSaslQopString

public java.lang.String getSaslQopString()
Returns the quality-of-protection, used by DIGEST-MD5 and GSSAPI.

Returns:
The quality-of-protection, used by DIGEST-MD5 and GSSAPI.

getSaslQop

public java.util.Set<java.lang.String> getSaslQop()
Returns the Set of quality-of-protection, used by DIGEST-MD5 and GSSAPI.

Returns:
The quality-of-protection, used by DIGEST-MD5 and GSSAPI.

setSaslQop

public void setSaslQop(java.util.Set<java.lang.String> saslQop)
Sets the desired quality-of-protection, used by DIGEST-MD5 and GSSAPI. We build a string from this list, where QoP are comma delimited

Parameters:
saslQop - The desired quality-of-protection, used by DIGEST-MD5 and GSSAPI.
XBean Property
nestedType="java.lang.String"

getSaslRealms

public java.util.List<java.lang.String> getSaslRealms()
Returns the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.

Returns:
The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.

setSaslRealms

public void setSaslRealms(java.util.List<java.lang.String> saslRealms)
Sets the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.

Parameters:
saslRealms - The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.
XBean Property
nestedType="java.lang.String"

getSaslMechanismHandlers

public java.util.Map<java.lang.String,MechanismHandler> getSaslMechanismHandlers()

setSaslMechanismHandlers

public void setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> saslMechanismHandlers)

addSaslMechanismHandler

public MechanismHandler addSaslMechanismHandler(java.lang.String mechanism,
                                                MechanismHandler handler)

removeSaslMechanismHandler

public MechanismHandler removeSaslMechanismHandler(java.lang.String mechanism)

getMechanismHandler

public MechanismHandler getMechanismHandler(java.lang.String mechanism)

getSupportedMechanisms

public java.util.Set<java.lang.String> getSupportedMechanisms()

setDirectoryService

public void setDirectoryService(DirectoryService directoryService)
Specified by:
setDirectoryService in interface ProtocolService
Overrides:
setDirectoryService in class AbstractProtocolService

getSupportedControls

public java.util.Set<java.lang.String> getSupportedControls()

setSupportedControls

public void setSupportedControls(java.util.Set<java.lang.String> supportedControls)

getAbandonHandler

public AbandonHandler getAbandonHandler()

setAbandonHandler

public void setAbandonHandler(AbandonHandler abandonHandler)

getAddHandler

public AddHandler getAddHandler()

setAddHandler

public void setAddHandler(AddHandler addHandler)

getBindHandler

public BindHandler getBindHandler()

setBindHandler

public void setBindHandler(BindHandler bindHandler)

getCompareHandler

public CompareHandler getCompareHandler()

setCompareHandler

public void setCompareHandler(CompareHandler compareHandler)

getDeleteHandler

public DeleteHandler getDeleteHandler()

setDeleteHandler

public void setDeleteHandler(DeleteHandler deleteHandler)

getExtendedHandler

public ExtendedHandler getExtendedHandler()

setExtendedHandler

public void setExtendedHandler(ExtendedHandler extendedHandler)

getModifyHandler

public ModifyHandler getModifyHandler()

setModifyHandler

public void setModifyHandler(ModifyHandler modifyHandler)

getModifyDnHandler

public ModifyDnHandler getModifyDnHandler()

setModifyDnHandler

public void setModifyDnHandler(ModifyDnHandler modifyDnHandler)

getSearchHandler

public SearchHandler getSearchHandler()

setSearchHandler

public void setSearchHandler(SearchHandler searchHandler)

getUnbindHandler

public UnbindHandler getUnbindHandler()

setUnbindHandler

public void setUnbindHandler(UnbindHandler unbindHandler)

getRegistry

public SessionRegistry getRegistry()

isStarted

public boolean isStarted()
Specified by:
isStarted in interface ProtocolService
Overrides:
isStarted in class AbstractProtocolService

setStarted

public void setStarted(boolean started)
Overrides:
setStarted in class AbstractProtocolService

setConfidentialityRequired

public void setConfidentialityRequired(boolean confidentialityRequired)
Sets the mode for this LdapServer to accept requests with or without a TLS secured connection via either StartTLS extended operations or using LDAPS.

Parameters:
confidentialityRequired - true to require confidentiality

isConfidentialityRequired

public boolean isConfidentialityRequired()
Gets whether or not TLS secured connections are required to perform operations on this LdapServer.

Returns:
true if TLS secured connections are required, false otherwise


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.