org.opends.server.protocols.ldap
Class CompareResponseProtocolOp

java.lang.Object
  extended by org.opends.server.protocols.ldap.ProtocolOp
      extended by org.opends.server.protocols.ldap.CompareResponseProtocolOp

public class CompareResponseProtocolOp
extends ProtocolOp

This class defines the structures and methods for an LDAP compare response protocol op, which is used to provide information about the result of processing a compare request.


Constructor Summary
CompareResponseProtocolOp(int resultCode)
          Creates a new compare response protocol op with the provided result code.
CompareResponseProtocolOp(int resultCode, Message errorMessage)
          Creates a new compare response protocol op with the provided result code and error message.
CompareResponseProtocolOp(int resultCode, Message errorMessage, DN matchedDN, java.util.List<java.lang.String> referralURLs)
          Creates a new compare response protocol op with the provided information.
 
Method Summary
static CompareResponseProtocolOp decodeCompareResponse(ASN1Element element)
          Decodes the provided ASN.1 element as a compare response protocol op.
 ASN1Element encode()
          Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.
 Message getErrorMessage()
          Retrieves the error message for this response.
 DN getMatchedDN()
          Retrieves the matched DN for this response.
 java.lang.String getProtocolOpName()
          Retrieves the name for this protocol op type.
 java.util.List<java.lang.String> getReferralURLs()
          Retrieves the set of referral URLs for this response.
 int getResultCode()
          Retrieves the result code for this response.
 byte getType()
          Retrieves the BER type for this protocol op.
 void setErrorMessage(Message errorMessage)
          Specifies the error message for this response.
 void setMatchedDN(DN matchedDN)
          Specifies the matched DN for this response.
 void setReferralURLs(java.util.List<java.lang.String> referralURLs)
          Specifies the set of referral URLs for this response.
 void setResultCode(int resultCode)
          Specifies the result code for this response.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP protocol op to the provided buffer.
 void toString(java.lang.StringBuilder buffer, int indent)
          Appends a multi-line string representation of this LDAP protocol op to the provided buffer.
 
Methods inherited from class org.opends.server.protocols.ldap.ProtocolOp
decode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompareResponseProtocolOp

public CompareResponseProtocolOp(int resultCode)
Creates a new compare response protocol op with the provided result code.

Parameters:
resultCode - The result code for this response.

CompareResponseProtocolOp

public CompareResponseProtocolOp(int resultCode,
                                 Message errorMessage)
Creates a new compare response protocol op with the provided result code and error message.

Parameters:
resultCode - The result code for this response.
errorMessage - The error message for this response.

CompareResponseProtocolOp

public CompareResponseProtocolOp(int resultCode,
                                 Message errorMessage,
                                 DN matchedDN,
                                 java.util.List<java.lang.String> referralURLs)
Creates a new compare response protocol op with the provided information.

Parameters:
resultCode - The result code for this response.
errorMessage - The error message for this response.
matchedDN - The matched DN for this response.
referralURLs - The referral URLs for this response.
Method Detail

getResultCode

public int getResultCode()
Retrieves the result code for this response.

Returns:
The result code for this response.

setResultCode

public void setResultCode(int resultCode)
Specifies the result code for this response.

Parameters:
resultCode - The result code for this response.

getErrorMessage

public Message getErrorMessage()
Retrieves the error message for this response.

Returns:
The error message for this response, or null if none is available.

setErrorMessage

public void setErrorMessage(Message errorMessage)
Specifies the error message for this response.

Parameters:
errorMessage - The error message for this response.

getMatchedDN

public DN getMatchedDN()
Retrieves the matched DN for this response.

Returns:
The matched DN for this response, or null if none is available.

setMatchedDN

public void setMatchedDN(DN matchedDN)
Specifies the matched DN for this response.

Parameters:
matchedDN - The matched DN for this response.

getReferralURLs

public java.util.List<java.lang.String> getReferralURLs()
Retrieves the set of referral URLs for this response.

Returns:
The set of referral URLs for this response, or null if none are available.

setReferralURLs

public void setReferralURLs(java.util.List<java.lang.String> referralURLs)
Specifies the set of referral URLs for this response.

Parameters:
referralURLs - The set of referral URLs for this response.

getType

public byte getType()
Retrieves the BER type for this protocol op.

Specified by:
getType in class ProtocolOp
Returns:
The BER type for this protocol op.

getProtocolOpName

public java.lang.String getProtocolOpName()
Retrieves the name for this protocol op type.

Specified by:
getProtocolOpName in class ProtocolOp
Returns:
The name for this protocol op type.

encode

public ASN1Element encode()
Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.

Specified by:
encode in class ProtocolOp
Returns:
The ASN.1 element containing the encoded protocol op.

decodeCompareResponse

public static CompareResponseProtocolOp decodeCompareResponse(ASN1Element element)
                                                       throws LDAPException
Decodes the provided ASN.1 element as a compare response protocol op.

Parameters:
element - The ASN.1 element to decode.
Returns:
The decoded compare response protocol op.
Throws:
LDAPException - If a problem occurs while attempting to decode the ASN.1 element to a protocol op.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in class ProtocolOp
Parameters:
buffer - The buffer to which the string should be appended.

toString

public void toString(java.lang.StringBuilder buffer,
                     int indent)
Appends a multi-line string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in class ProtocolOp
Parameters:
buffer - The buffer to which the information should be appended.
indent - The number of spaces from the margin that the lines should be indented.