org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure
Class StoredProcedureRequestDecorator

java.lang.Object
  extended by org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
      extended by org.apache.directory.api.ldap.codec.decorators.RequestDecorator<M>
          extended by org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator<M,R>
              extended by org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator<Q,P>
                  extended by org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator<StoredProcedureRequest,StoredProcedureResponse>
                      extended by org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureRequestDecorator
All Implemented Interfaces:
Decorator<StoredProcedureRequest>, StoredProcedureRequest, AbandonableRequest, ExtendedRequest<StoredProcedureResponse>, Message, Request, ResultResponseRequest<StoredProcedureResponse>, SingleReplyRequest<StoredProcedureResponse>

public class StoredProcedureRequestDecorator
extends ExtendedRequestDecorator<StoredProcedureRequest,StoredProcedureResponse>
implements StoredProcedureRequest

A Decorator for stored procedure extended operation requests.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator
requestValue
 
Fields inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
messageLength
 
Fields inherited from interface org.apache.directory.api.ldap.extras.extended.StoredProcedureRequest
EXTENSION_OID
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.ExtendedRequest
RESP_TYPE, TYPE
 
Constructor Summary
StoredProcedureRequestDecorator(LdapApiService codec)
           
StoredProcedureRequestDecorator(LdapApiService codec, StoredProcedureRequest decoratedRequest)
           
 
Method Summary
 void addParameter(Object type, Object value)
          Adds the parameter.
 void addParameter(StoredProcedureParameter parameter)
          
 int computeLength()
          Compute the StoredProcedure length 0x30 L1 | +--> 0x04 L2 language +--> 0x04 L3 procedure [+--> 0x30 L4 (parameters) | +--> 0x30 L5-1 (parameter) | | | +--> 0x04 L6-1 type | +--> 0x04 L7-1 value | +--> 0x30 L5-2 (parameter) | | | +--> 0x04 L6-2 type | +--> 0x04 L7-2 value | +--> ...
 ByteBuffer encode()
          Encode the StoredProcedure message to a PDU.
 StoredProcedureParameter getCurrentParameter()
           
 Class<?> getJavaParameterType(int index)
          Gets the java parameter type.
 Object getJavaParameterValue(int index)
          Gets the java parameter value.
 String getLanguage()
          Gets the language.
 List<StoredProcedureParameter> getParameters()
          
 Object getParameterType(int index)
          Gets the parameter type.
 Object getParameterValue(int index)
          Gets the parameter value.
 byte[] getProcedure()
          
 String getProcedureSpecification()
          Gets the procedure specification.
 byte[] getRequestValue()
          
 void setCurrentParameter(StoredProcedureParameter currentParameter)
           
 void setLanguage(String language)
          Sets the language.
 void setProcedure(byte[] procedure)
           
 void setRequestValue(byte[] payload)
          
 int size()
          Size.
 String toString()
          Returns the StoredProcedure string
 
Methods inherited from class org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator
addAllControls, addControl, encode, getExtendedRequestLength, getRequestName, getRequestNameBytes, removeControl, setExtendedRequestLength, setMessageId, setRequestName, setRequestNameBytes
 
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator
abandon, addAbandonListener, getResponseType, isAbandoned
 
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator
getResultResponse, hasResponse
 
Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.ExtendedRequest
addAllControls, addControl, getRequestName, removeControl, setMessageId, setRequestName
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.SingleReplyRequest
getResponseType
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, getType, hasControl, put
 

Constructor Detail

StoredProcedureRequestDecorator

public StoredProcedureRequestDecorator(LdapApiService codec)

StoredProcedureRequestDecorator

public StoredProcedureRequestDecorator(LdapApiService codec,
                                       StoredProcedureRequest decoratedRequest)
Method Detail

getCurrentParameter

public StoredProcedureParameter getCurrentParameter()

setCurrentParameter

public void setCurrentParameter(StoredProcedureParameter currentParameter)

computeLength

public int computeLength()
Compute the StoredProcedure length 0x30 L1 | +--> 0x04 L2 language +--> 0x04 L3 procedure [+--> 0x30 L4 (parameters) | +--> 0x30 L5-1 (parameter) | | | +--> 0x04 L6-1 type | +--> 0x04 L7-1 value | +--> 0x30 L5-2 (parameter) | | | +--> 0x04 L6-2 type | +--> 0x04 L7-2 value | +--> ... | +--> 0x30 L5-m (parameter) | +--> 0x04 L6-m type +--> 0x04 L7-m value

Specified by:
computeLength in interface Decorator<StoredProcedureRequest>
Overrides:
computeLength in class ExtendedRequestDecorator<StoredProcedureRequest,StoredProcedureResponse>
Returns:
The object's computed length

encode

public ByteBuffer encode()
                  throws EncoderException
Encode the StoredProcedure message to a PDU.

Returns:
The PDU.
Throws:
EncoderException

toString

public String toString()
Returns the StoredProcedure string

Overrides:
toString in class MessageDecorator<StoredProcedureRequest>
Returns:
The StoredProcedure string

setProcedure

public void setProcedure(byte[] procedure)
Specified by:
setProcedure in interface StoredProcedureRequest

setRequestValue

public void setRequestValue(byte[] payload)

Overrides:
setRequestValue in class ExtendedRequestDecorator<StoredProcedureRequest,StoredProcedureResponse>

getRequestValue

public byte[] getRequestValue()

Overrides:
getRequestValue in class ExtendedRequestDecorator<StoredProcedureRequest,StoredProcedureResponse>

getLanguage

public String getLanguage()
Gets the language.

Specified by:
getLanguage in interface StoredProcedureRequest
Returns:
the language

setLanguage

public void setLanguage(String language)
Sets the language.

Specified by:
setLanguage in interface StoredProcedureRequest
Parameters:
language - the new language

getProcedureSpecification

public String getProcedureSpecification()
Gets the procedure specification.

Specified by:
getProcedureSpecification in interface StoredProcedureRequest
Returns:
the procedure specification

size

public int size()
Size.

Specified by:
size in interface StoredProcedureRequest
Returns:
the int

getParameterType

public Object getParameterType(int index)
Gets the parameter type.

Specified by:
getParameterType in interface StoredProcedureRequest
Parameters:
index - the index
Returns:
the parameter type

getJavaParameterType

public Class<?> getJavaParameterType(int index)
Gets the java parameter type.

Specified by:
getJavaParameterType in interface StoredProcedureRequest
Parameters:
index - the index
Returns:
the java parameter type

getParameterValue

public Object getParameterValue(int index)
Gets the parameter value.

Specified by:
getParameterValue in interface StoredProcedureRequest
Parameters:
index - the index
Returns:
the parameter value

getJavaParameterValue

public Object getJavaParameterValue(int index)
Gets the java parameter value.

Specified by:
getJavaParameterValue in interface StoredProcedureRequest
Parameters:
index - the index
Returns:
the java parameter value

addParameter

public void addParameter(Object type,
                         Object value)
Adds the parameter.

Specified by:
addParameter in interface StoredProcedureRequest
Parameters:
type - the type
value - the value

getProcedure

public byte[] getProcedure()

Specified by:
getProcedure in interface StoredProcedureRequest

getParameters

public List<StoredProcedureParameter> getParameters()

Specified by:
getParameters in interface StoredProcedureRequest

addParameter

public void addParameter(StoredProcedureParameter parameter)

Specified by:
addParameter in interface StoredProcedureRequest


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