org.apache.directory.shared.ldap.codec.intermediate
Class IntermediateResponseCodec

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.LdapMessageCodec
          extended by org.apache.directory.shared.ldap.codec.LdapResponseCodec
              extended by org.apache.directory.shared.ldap.codec.intermediate.IntermediateResponseCodec
All Implemented Interfaces:
Asn1Object

public class IntermediateResponseCodec
extends LdapResponseCodec

A IntermediateResponse Message. Its syntax is : IntermediateResponse ::= [APPLICATION 25] SEQUENCE { responseName [0] LDAPOID OPTIONAL, responseValue [1] OCTET STRING OPTIONAL }

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sat, 07 Jun 2008) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
IntermediateResponseCodec()
          Creates a new IntermediateResponse object.
 
Method Summary
 int computeLength()
          Compute the intermediateResponse length intermediateResponse : 0x79 L1 | [+--> 0x80 L2 name [+--> 0x81 L3 response]] L1 = [ + Length(0x80) + Length(L2) + L2 [ + Length(0x81) + Length(L3) + L3]] Length(IntermediateResponse) = Length(0x79) + Length(L1) + L1
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the IntermediateResponse message to a PDU.
 int getMessageType()
          Get the message type
 java.lang.String getResponseName()
          Get the intermediate response name
 byte[] getResponseValue()
          Get the intermediate response value
 void setResponseName(OID responseName)
          Set the intermediate response name
 void setResponseValue(byte[] responseValue)
          Set the intermediate response value
 java.lang.String toString()
          Get a String representation of an IntermediateResponse
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapResponseCodec
getLdapResponseLength, getLdapResult, setLdapResult
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec
addControl, getAbandonRequest, getAddRequest, getAddResponse, getBindRequest, getBindResponse, getCompareRequest, getCompareResponse, getControls, getControls, getCurrentControl, getDelRequest, getDelResponse, getExtendedRequest, getExtendedResponse, getIntermediateResponse, getLdapResponse, getMessageId, getMessageTypeName, getModifyDNRequest, getModifyDNResponse, getModifyRequest, getModifyResponse, getSearchRequest, getSearchResultDone, getSearchResultEntry, getSearchResultReference, getUnBindRequest, initControls, setMessageId, setProtocolOP
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntermediateResponseCodec

public IntermediateResponseCodec()
Creates a new IntermediateResponse object.

Method Detail

getMessageType

public int getMessageType()
Get the message type

Overrides:
getMessageType in class LdapMessageCodec
Returns:
Returns the type.

getResponseName

public java.lang.String getResponseName()
Get the intermediate response name

Returns:
Returns the name.

setResponseName

public void setResponseName(OID responseName)
Set the intermediate response name

Parameters:
responseName - The name to set.

getResponseValue

public byte[] getResponseValue()
Get the intermediate response value

Returns:
Returns the intermediate response value.

setResponseValue

public void setResponseValue(byte[] responseValue)
Set the intermediate response value

Parameters:
responseValue - The intermediate response value to set.

computeLength

public int computeLength()
Compute the intermediateResponse length intermediateResponse : 0x79 L1 | [+--> 0x80 L2 name [+--> 0x81 L3 response]] L1 = [ + Length(0x80) + Length(L2) + L2 [ + Length(0x81) + Length(L3) + L3]] Length(IntermediateResponse) = Length(0x79) + Length(L1) + L1

Specified by:
computeLength in interface Asn1Object
Overrides:
computeLength in class LdapResponseCodec
Returns:
The IntermediateResponse length

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws EncoderException
Encode the IntermediateResponse message to a PDU. IntermediateResponse : 0x79 LL [0x80 LL response name] [0x81 LL responseValue]

Specified by:
encode in interface Asn1Object
Overrides:
encode in class LdapResponseCodec
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Get a String representation of an IntermediateResponse

Overrides:
toString in class LdapResponseCodec
Returns:
An IntermediateResponse String


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.