org.apache.directory.api.ldap.codec.api
Interface ExtendedRequestFactory<Q extends ExtendedRequest<P>,P extends ExtendedResponse>

All Known Implementing Classes:
CancelFactory, CertGenerationFactory, GracefulShutdownFactory, StoredProcedureFactory

public interface ExtendedRequestFactory<Q extends ExtendedRequest<P>,P extends ExtendedResponse>

The factor interface, defined by the codec API for creating new ExtendedRequests.

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

Method Summary
 ExtendedRequestDecorator<Q,P> decorate(ExtendedRequest<?> modelRequest)
          Decorates a non-decorated request.
 ExtendedResponseDecorator<P> decorate(ExtendedResponse decoratedMessage)
          Decorates an ExtendedResponse which may or may not be of the expected type.
 String getOid()
          Gets the OID of the extended requests this factory generates.
 Q newRequest()
           
 Q newRequest(byte[] value)
          Returns a new ExtendedRequestDecorator with the following encoded value.
 P newResponse(byte[] encodedValue)
          Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.
 

Method Detail

getOid

String getOid()
Gets the OID of the extended requests this factory generates.

Returns:
the extended request OID

newRequest

Q newRequest()
Returns:
A new instance of the ExtendedRequestDecorator.

newRequest

Q newRequest(byte[] value)
Returns a new ExtendedRequestDecorator with the following encoded value.

Parameters:
value - the encoded value
Returns:
the decorator for the extended request type

decorate

ExtendedRequestDecorator<Q,P> decorate(ExtendedRequest<?> modelRequest)
Decorates a non-decorated request.

Parameters:
modelRequest - the non decorated model request
Returns:
the decorated model request

newResponse

P newResponse(byte[] encodedValue)
                                       throws DecoderException
Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.

Parameters:
encodedValue - The encoded value for the ExtendedResponse instance.
Returns:
The new ExtendedResponse.
Throws:
DecoderException

decorate

ExtendedResponseDecorator<P> decorate(ExtendedResponse decoratedMessage)
Decorates an ExtendedResponse which may or may not be of the expected type. The factory implementor must check and handle appropriately.

Parameters:
decoratedMessage - the message to be decorated.
Returns:
The decorated message


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