org.apache.directory.shared.ldap.codec.api
Class DefaultLdapCodecService

java.lang.Object
  extended by org.apache.directory.shared.ldap.codec.api.DefaultLdapCodecService
All Implemented Interfaces:
LdapCodecService

public class DefaultLdapCodecService
extends Object
implements LdapCodecService

The default LdapCodecService implementation.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
DefaultLdapCodecService()
           
 
Method Summary
 Control fromJndiControl(Control control)
          Creates a model control from the JNDI control.
 CodecControl<? extends Control> newControl(Control control)
          Creates a new codec control decorator for the provided control.
 CodecControl<? extends Control> newControl(String oid)
          Creates a new codec control decorator of the specified type.
 Asn1Container newMessageContainer()
          
 org.apache.mina.filter.codec.ProtocolCodecFactory newProtocolCodecFactory(boolean client)
          Creates a new LDAP ProtocolCodecFactory.
 void registerControl(ControlFactory<?,?> factory)
          Registers an ControlFactory with this service.
 Iterator<String> registeredControls()
          Returns an Iterator over the OID Strings of registered controls.
 Iterator<String> registeredExtendedRequests()
          Returns an Iterator over the OID Strings of registered extended requests.
 Iterator<String> registeredExtendedResponses()
          Returns an Iterator over the OID Strings of registered extended responses.
 void registerExtendedOp(ExtendedOpFactory<?,?> factory)
          Registers an ExtendedOpFactory for generating extended request response pairs.
 Control toJndiControl(Control control)
          Creates a JNDI control from the ldap model's control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLdapCodecService

public DefaultLdapCodecService()
Method Detail

registerControl

public void registerControl(ControlFactory<?,?> factory)
Registers an ControlFactory with this service.

Specified by:
registerControl in interface LdapCodecService
Parameters:
factory - The control factory

registeredControls

public Iterator<String> registeredControls()
Returns an Iterator over the OID Strings of registered controls.

Specified by:
registeredControls in interface LdapCodecService
Returns:
The registered control OID Strings

registeredExtendedRequests

public Iterator<String> registeredExtendedRequests()
Returns an Iterator over the OID Strings of registered extended requests.

Specified by:
registeredExtendedRequests in interface LdapCodecService
Returns:
The registered extended request OID Strings

registeredExtendedResponses

public Iterator<String> registeredExtendedResponses()
Returns an Iterator over the OID Strings of registered extended responses.

Specified by:
registeredExtendedResponses in interface LdapCodecService
Returns:
The registered extended response OID Strings

registerExtendedOp

public void registerExtendedOp(ExtendedOpFactory<?,?> factory)
Registers an ExtendedOpFactory for generating extended request response pairs.

Specified by:
registerExtendedOp in interface LdapCodecService
Parameters:
factory - The extended operation factory

newProtocolCodecFactory

public org.apache.mina.filter.codec.ProtocolCodecFactory newProtocolCodecFactory(boolean client)
Creates a new LDAP ProtocolCodecFactory.

Specified by:
newProtocolCodecFactory in interface LdapCodecService
Parameters:
client - if true a factory designed for clients is returned, otherwise one for servers is returned.
Returns:
the client or server specific ProtocolCodecFactory

newControl

public CodecControl<? extends Control> newControl(String oid)
Creates a new codec control decorator of the specified type.

Specified by:
newControl in interface LdapCodecService
Parameters:
oid - The OID of the new control to create.
Returns:
The newly created codec control.

newControl

public CodecControl<? extends Control> newControl(Control control)
Creates a new codec control decorator for the provided control.

Specified by:
newControl in interface LdapCodecService
Parameters:
control - The control the codec control is generated for.
Returns:
The newly created codec control.

toJndiControl

public Control toJndiControl(Control control)
                      throws EncoderException
Creates a JNDI control from the ldap model's control.

Specified by:
toJndiControl in interface LdapCodecService
Parameters:
control - The model's control.
Returns:
The JNDI control.
Throws:
EncoderException - if there are problems encoding the modelControl.

fromJndiControl

public Control fromJndiControl(Control control)
                        throws DecoderException
Creates a model control from the JNDI control.

Specified by:
fromJndiControl in interface LdapCodecService
Parameters:
control - The JNDI control.
Returns:
The model control.
Throws:
DecoderException - if there are problems decoding the value of the JNDI control.

newMessageContainer

public Asn1Container newMessageContainer()

Specified by:
newMessageContainer in interface LdapCodecService


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