Package org.ldaptive
Class AbstractMessage
- java.lang.Object
-
- org.ldaptive.AbstractMessage
-
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
AbstractResult
,IntermediateResponse
,LdapEntry
,SearchResultReference
public abstract class AbstractMessage extends Object implements Message
LDAP message envelope defined as:LDAPMessage ::= SEQUENCE { messageID MessageID, protocolOp CHOICE { ..., controls [0] Controls OPTIONAL } Control ::= SEQUENCE { controlType LDAPOID, criticality BOOLEAN DEFAULT FALSE, controlValue OCTET STRING OPTIONAL }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractMessage.AbstractBuilder<B,T extends AbstractMessage>
protected static class
AbstractMessage.ControlParser
Parses a buffer containing an LDAP control.protected static class
AbstractMessage.ControlsHandler
Parse handler implementation for the message controls.protected static class
AbstractMessage.MessageIDHandler
Parse handler implementation for the message ID.
-
Field Summary
Fields Modifier and Type Field Description private List<ResponseControl>
controls
LDAP controls.private int
messageID
Protocol message ID.
-
Constructor Summary
Constructors Constructor Description AbstractMessage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addControls(ResponseControl... cntrls)
Adds the supplied controls to this message.protected <T extends Message>
voidcopyValues(T message)
Copies the property values from the supplied message to this message.boolean
equals(Object o)
boolean
equalsMessage(Message message)
Returns whether the base properties of this message are equal.ResponseControl[]
getControls()
Returns the response controls for this message.int
getMessageID()
Returns the ID for this message.abstract int
hashCode()
Returns the hash code for this object.protected void
setMessageID(int id)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.Message
getControl
-
-
-
-
Field Detail
-
controls
private final List<ResponseControl> controls
LDAP controls.
-
messageID
private int messageID
Protocol message ID.
-
-
Method Detail
-
getMessageID
public final int getMessageID()
Description copied from interface:Message
Returns the ID for this message.- Specified by:
getMessageID
in interfaceMessage
- Returns:
- message ID
-
setMessageID
protected void setMessageID(int id)
-
getControls
public final ResponseControl[] getControls()
Description copied from interface:Message
Returns the response controls for this message.- Specified by:
getControls
in interfaceMessage
- Returns:
- response controls
-
addControls
protected final void addControls(ResponseControl... cntrls)
Adds the supplied controls to this message.- Parameters:
cntrls
- to add
-
copyValues
protected <T extends Message> void copyValues(T message)
Copies the property values from the supplied message to this message.- Type Parameters:
T
- type of message- Parameters:
message
- to copy from
-
equalsMessage
public final boolean equalsMessage(Message message)
Returns whether the base properties of this message are equal. Those include message ID and controls.- Parameters:
message
- to compare- Returns:
- whether message properties are equal
-
hashCode
public abstract int hashCode()
Returns the hash code for this object.
-
-