org.apache.directory.api.ldap.codec.api
Interface LdapApiService

All Known Implementing Classes:
DefaultLdapCodecService, StandaloneLdapApiService

public interface LdapApiService

The service interface for the LDAP codec.

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

Field Summary
static String DEFAULT_PROTOCOL_CODEC_FACTORY
           
 
Method Summary
 ExtendedRequestDecorator<?,?> decorate(ExtendedRequest<?> decoratedMessage)
           
 ExtendedResponseDecorator<?> decorate(ExtendedResponse decoratedMessage)
           
 ExtendedRequest<?> fromJndi(ExtendedRequest jndiRequest)
          Creates a model ExtendedResponse from the JNDI ExtendedResponse.
 ExtendedResponse fromJndi(ExtendedResponse jndiResponse)
          Creates a model ExtendedResponse from the JNDI ExtendedResponse.
 Control fromJndiControl(Control jndiControl)
          Creates a model control from the JNDI control.
 org.apache.mina.filter.codec.ProtocolCodecFactory getProtocolCodecFactory()
          Creates a new LDAP ProtocolCodecFactory.
 boolean isControlRegistered(String oid)
          Checks if a control has been registered.
 boolean isExtendedOperationRegistered(String oid)
          Checks to see if an extended operation, either a standard request response, pair or just an unsolicited response is registered.
 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.
 ExtendedRequest<?> newExtendedRequest(String oid, byte[] value)
          Creates a new ExtendedRequest instance.
<E extends ExtendedResponse>
E
newExtendedResponse(ExtendedRequest<E> req, byte[] serializedResponse)
           
 Asn1Container newMessageContainer()
          Creates a new MessageContainer.
 ControlFactory<?,?> 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> registeredUnsolicitedResponses()
          Returns an Iterator over the OID Strings of registered unsolicited extended responses.
 ExtendedRequestFactory<?,?> registerExtendedRequest(ExtendedRequestFactory<?,?> factory)
          Registers an ExtendedRequestFactory for generating extended request response pairs.
 org.apache.mina.filter.codec.ProtocolCodecFactory registerProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory factory)
          Registers a ProtocolCodecFactory with this LdapCodecService.
 UnsolicitedResponseFactory<?> registerUnsolicitedResponse(UnsolicitedResponseFactory<?> factory)
          Registers an UnsolicitedResponseFactory for generating extended responses sent by servers without an extended request.
 ExtendedRequest toJndi(ExtendedRequest<?> modelRequest)
          Creates a JNDI ExtendedResponse from the model ExtendedResponse.
 ExtendedResponse toJndi(ExtendedResponse modelResponse)
          Creates a JNDI ExtendedResponse from the model ExtendedResponse.
 Control toJndiControl(Control modelControl)
          Creates a JNDI control from the ldap model's control.
 ControlFactory<?,?> unregisterControl(String oid)
          Unregisters an ControlFactory with this service.
 ExtendedRequestFactory<?,?> unregisterExtendedRequest(String oid)
          Unregisters an ExtendedRequestFactory for generating extended request response pairs.
 UnsolicitedResponseFactory<?> unregisterUnsolicitedResponse(String oid)
          Unregisters an UnsolicitedResponseFactory for generating extended responses sent by servers without an extended request.
 

Field Detail

DEFAULT_PROTOCOL_CODEC_FACTORY

static final String DEFAULT_PROTOCOL_CODEC_FACTORY
See Also:
Constant Field Values
Method Detail

registeredControls

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

Returns:
The registered control OID Strings

isControlRegistered

boolean isControlRegistered(String oid)
Checks if a control has been registered.

Returns:
The OID of the control to check for registration

registerControl

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

Parameters:
factory - The control factory

unregisterControl

ControlFactory<?,?> unregisterControl(String oid)
Unregisters an ControlFactory with this service.

Parameters:
oid - The oid of the control the factory is associated with.

newControl

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

Parameters:
oid - The OID of the new control to create.
Returns:
The newly created codec control.

newControl

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

Parameters:
control - The control the codec control is generated for.
Returns:
The newly created codec control.

toJndiControl

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

Parameters:
modelControl - The model's control.
Returns:
The JNDI control.
Throws:
EncoderException - if there are problems encoding the modelControl.

fromJndiControl

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

Parameters:
jndiControl - The JNDI control.
Returns:
The model control.
Throws:
DecoderException - if there are problems decoding the value of the JNDI control.

registeredExtendedRequests

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

Returns:
The registered extended request OID Strings

registerExtendedRequest

ExtendedRequestFactory<?,?> registerExtendedRequest(ExtendedRequestFactory<?,?> factory)
Registers an ExtendedRequestFactory for generating extended request response pairs.

Parameters:
factory - The extended request factory
Returns:
The displaced factory if one existed for the oid

unregisterExtendedRequest

ExtendedRequestFactory<?,?> unregisterExtendedRequest(String oid)
Unregisters an ExtendedRequestFactory for generating extended request response pairs.

Parameters:
oid - The extended request oid
Returns:
The displaced factory if one existed for the oid

isExtendedOperationRegistered

boolean isExtendedOperationRegistered(String oid)
Checks to see if an extended operation, either a standard request response, pair or just an unsolicited response is registered.

Parameters:
oid - The object identifier for the extended operation
Returns:
true if registered, false if not

registeredUnsolicitedResponses

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

Returns:
The registered unsolicited extended response OID Strings

registerUnsolicitedResponse

UnsolicitedResponseFactory<?> registerUnsolicitedResponse(UnsolicitedResponseFactory<?> factory)
Registers an UnsolicitedResponseFactory for generating extended responses sent by servers without an extended request.

Parameters:
factory - The unsolicited response creating factory
Returns:
The displaced factory if one existed for the oid

unregisterUnsolicitedResponse

UnsolicitedResponseFactory<?> unregisterUnsolicitedResponse(String oid)
Unregisters an UnsolicitedResponseFactory for generating extended responses sent by servers without an extended request.

Parameters:
oid - The unsolicited response oid

fromJndi

ExtendedResponse fromJndi(ExtendedResponse jndiResponse)
                          throws DecoderException
Creates a model ExtendedResponse from the JNDI ExtendedResponse.

Parameters:
jndiResponse - The JNDI ExtendedResponse
Returns:
The model ExtendedResponse
Throws:
DecoderException - if the response value cannot be decoded.

toJndi

ExtendedResponse toJndi(ExtendedResponse modelResponse)
                        throws EncoderException
Creates a JNDI ExtendedResponse from the model ExtendedResponse.

Parameters:
modelResponse -
Returns:
Throws:
EncoderException

fromJndi

ExtendedRequest<?> fromJndi(ExtendedRequest jndiRequest)
                            throws DecoderException
Creates a model ExtendedResponse from the JNDI ExtendedResponse.

Parameters:
jndiResponse - The JNDI ExtendedResponse
Returns:
The model ExtendedResponse
Throws:
DecoderException - if the response value cannot be decoded.

toJndi

ExtendedRequest toJndi(ExtendedRequest<?> modelRequest)
                       throws EncoderException
Creates a JNDI ExtendedResponse from the model ExtendedResponse.

Parameters:
modelResponse -
Returns:
Throws:
EncoderException

getProtocolCodecFactory

org.apache.mina.filter.codec.ProtocolCodecFactory getProtocolCodecFactory()
Creates a new LDAP ProtocolCodecFactory.

Returns:
the ProtocolCodecFactory

registerProtocolCodecFactory

org.apache.mina.filter.codec.ProtocolCodecFactory registerProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory factory)
Registers a ProtocolCodecFactory with this LdapCodecService.

Parameters:
factory - The factory being registered.
Returns:
The previously set ProtocolCodecFactory, or null if none had been set earlier.

newMessageContainer

Asn1Container newMessageContainer()
Creates a new MessageContainer.

Returns:
The newly created LDAP MessageContainer instance.

newExtendedResponse

<E extends ExtendedResponse> E newExtendedResponse(ExtendedRequest<E> req,
                                                   byte[] serializedResponse)
                                               throws DecoderException
Throws:
DecoderException

newExtendedRequest

ExtendedRequest<?> newExtendedRequest(String oid,
                                      byte[] value)
Creates a new ExtendedRequest instance.

Parameters:
oid - the extended request's object identifier
value - the encoded value of the extended request
Returns:
The new extended request

decorate

ExtendedRequestDecorator<?,?> decorate(ExtendedRequest<?> decoratedMessage)

decorate

ExtendedResponseDecorator<?> decorate(ExtendedResponse decoratedMessage)


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