All LDAP Classes
Internal LDAP Classes

com.novell.ldap.rfc2251
Class RfcLDAPMessage

java.lang.Object
  extended bycom.novell.ldap.asn1.ASN1Object
      extended bycom.novell.ldap.asn1.ASN1Structured
          extended bycom.novell.ldap.asn1.ASN1Sequence
              extended bycom.novell.ldap.rfc2251.RfcLDAPMessage
All Implemented Interfaces:
java.io.Serializable

public class RfcLDAPMessage
extends ASN1Sequence

Represents an LDAP Message.

       LDAPMessage ::= SEQUENCE {
               messageID       MessageID,
               protocolOp      CHOICE {
                   bindRequest     BindRequest,
                   bindResponse    BindResponse,
                   unbindRequest   UnbindRequest,
                   searchRequest   SearchRequest,
                   searchResEntry  SearchResultEntry,
                   searchResDone   SearchResultDone,
                   searchResRef    SearchResultReference,
                   modifyRequest   ModifyRequest,
                   modifyResponse  ModifyResponse,
                   addRequest      AddRequest,
                   addResponse     AddResponse,
                   delRequest      DelRequest,
                   delResponse     DelResponse,
                   modDNRequest    ModifyDNRequest,
                   modDNResponse   ModifyDNResponse,
                   compareRequest  CompareRequest,
                   compareResponse CompareResponse,
                   abandonRequest  AbandonRequest,
                   extendedReq     ExtendedRequest,
                   extendedResp    ExtendedResponse },
                controls       [0] Controls OPTIONAL }


Note: The creation of a MessageID should be hidden within the creation of an RfcLDAPMessage. The MessageID needs to be in sequence, and has an upper and lower limit. There is never a case when a user should be able to specify the MessageID for an RfcLDAPMessage. The MessageID() constructor should be package protected. (So the MessageID value isn't arbitrarily run up.)

See Also:
Serialized Form

Field Summary
private  RfcControls controls
           
private  ASN1Object op
           
private  LDAPMessage requestMessage
           
 
Fields inherited from class com.novell.ldap.asn1.ASN1Sequence
TAG
 
Fields inherited from class com.novell.ldap.asn1.ASN1Structured
 
Fields inherited from class com.novell.ldap.asn1.ASN1Object
 
Constructor Summary
  RfcLDAPMessage(ASN1Decoder dec, java.io.InputStream in, int len)
          Will decode an RfcLDAPMessage directly from an InputStream.
(package private) RfcLDAPMessage(ASN1Object[] origContent, RfcRequest origRequest, java.lang.String dn, java.lang.String filter, boolean reference)
          Create an RfcLDAPMessage by copying the content array
  RfcLDAPMessage(ASN1Sequence op)
          Create an RfcLDAPMessage using the specified LDAP Response.
  RfcLDAPMessage(ASN1SequenceOf op)
          Create an RfcLDAPMessage using the specified LDAP Response when the return type is a ASN1SequenceOf .
  RfcLDAPMessage(ASN1Sequence op, RfcControls controls)
          Create an RfcLDAPMessage response from input parameters.
  RfcLDAPMessage(RfcRequest op)
          Create an RfcLDAPMessage using the specified LDAP Request.
  RfcLDAPMessage(RfcRequest op, RfcControls controls)
          Create an RfcLDAPMessage request from input parameters.
 
Method Summary
 java.lang.Object dupMessage(java.lang.String dn, java.lang.String filter, boolean reference)
          Duplicate this message, replacing base dn, filter, and scope if supplied
 RfcControls getControls()
          Returns the optional Controls for this RfcLDAPMessage.
 int getMessageID()
          Returns this RfcLDAPMessage's messageID as an int.
 RfcRequest getRequest()
          Returns the request associated with this RfcLDAPMessage.
 java.lang.String getRequestDN()
          Returns the dn of the request, may be null
 LDAPMessage getRequestingMessage()
          returns the original request in this message
 ASN1Object getResponse()
          Returns the response associated with this RfcLDAPMessage.
 int getType()
          Returns this RfcLDAPMessage's message type
 boolean isRequest()
           
 void setRequestingMessage(LDAPMessage msg)
          sets the original request in this message
 
Methods inherited from class com.novell.ldap.asn1.ASN1Sequence
toString
 
Methods inherited from class com.novell.ldap.asn1.ASN1Structured
add, decodeStructured, encode, get, set, size, toArray, toString
 
Methods inherited from class com.novell.ldap.asn1.ASN1Object
getEncoding, getIdentifier, setIdentifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

op

private ASN1Object op

controls

private RfcControls controls

requestMessage

private LDAPMessage requestMessage
Constructor Detail

RfcLDAPMessage

RfcLDAPMessage(ASN1Object[] origContent,
               RfcRequest origRequest,
               java.lang.String dn,
               java.lang.String filter,
               boolean reference)
         throws LDAPException
Create an RfcLDAPMessage by copying the content array

Parameters:
origContent - the array list to copy

RfcLDAPMessage

public RfcLDAPMessage(RfcRequest op)
Create an RfcLDAPMessage using the specified LDAP Request.


RfcLDAPMessage

public RfcLDAPMessage(RfcRequest op,
                      RfcControls controls)
Create an RfcLDAPMessage request from input parameters.


RfcLDAPMessage

public RfcLDAPMessage(ASN1Sequence op)
Create an RfcLDAPMessage using the specified LDAP Response.


RfcLDAPMessage

public RfcLDAPMessage(ASN1SequenceOf op)
Create an RfcLDAPMessage using the specified LDAP Response when the return type is a ASN1SequenceOf .

Parameters:
op - an object of type ASN1SequenceOf.

RfcLDAPMessage

public RfcLDAPMessage(ASN1Sequence op,
                      RfcControls controls)
Create an RfcLDAPMessage response from input parameters.


RfcLDAPMessage

public RfcLDAPMessage(ASN1Decoder dec,
                      java.io.InputStream in,
                      int len)
               throws java.io.IOException
Will decode an RfcLDAPMessage directly from an InputStream.

Method Detail

getMessageID

public final int getMessageID()
Returns this RfcLDAPMessage's messageID as an int.


getType

public final int getType()
Returns this RfcLDAPMessage's message type


getResponse

public final ASN1Object getResponse()
Returns the response associated with this RfcLDAPMessage. Can be one of RfcLDAPResult, RfcBindResponse, RfcExtendedResponse all which extend RfcResponse. It can also be RfcSearchResultEntry, or RfcSearchResultReference


getRequest

public final RfcRequest getRequest()
Returns the request associated with this RfcLDAPMessage. Throws a class cast exception if the RfcLDAPMessage is not a request.


isRequest

public boolean isRequest()

getControls

public final RfcControls getControls()
Returns the optional Controls for this RfcLDAPMessage.


dupMessage

public final java.lang.Object dupMessage(java.lang.String dn,
                                         java.lang.String filter,
                                         boolean reference)
                                  throws LDAPException
Duplicate this message, replacing base dn, filter, and scope if supplied

Parameters:
dn - the base dn

filter - the filter

reference - true if a search reference
Returns:
the object representing the new message
Throws:
LDAPException

getRequestDN

public final java.lang.String getRequestDN()
Returns the dn of the request, may be null


setRequestingMessage

public final void setRequestingMessage(LDAPMessage msg)
sets the original request in this message

Parameters:
msg - the original request for this response

getRequestingMessage

public final LDAPMessage getRequestingMessage()
returns the original request in this message

Returns:
the original msg request for this response

All LDAP Classes
Internal LDAP Classes

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000