Class LdapMessage
- java.lang.Object
-
- org.forgerock.opendj.ldap.messages.LdapMessage
-
public final class LdapMessage extends Object
Encapsulates aProtocolOp
with LDAP specific message information.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMessageId()
Returns the message-id.ProtocolOp
getProtocolOp()
Returns the protocol-op contained in this message.byte
getProtocolOpType()
Returns the protocol-op type.static LdapMessage
newLdapMessage(int messageId, byte protocolOpType, ProtocolOp protocolOp)
Creates a newProtocolOp
containing a fully decoded LDAP message.static LdapMessage
newRequestMessage(int messageId, Request request)
Builds and returns anLdapMessage
containing aRequest
.static LdapMessage
newResponseMessage(int messageId, BindResult response)
Builds and returns anLdapMessage
containing aBindResult
.static LdapMessage
newResponseMessage(int messageId, CompareResult response)
Builds and returns anLdapMessage
containing aCompareResult
.static LdapMessage
newResponseMessage(int messageId, ExtendedResult response)
Builds and returns anLdapMessage
containing aExtendedResult
.static LdapMessage
newResponseMessage(int messageId, IntermediateResponse response)
Builds and returns anLdapMessage
containing aIntermediateResponse
.static LdapMessage
newResponseMessage(int messageId, Request forRequest, Response response)
Builds and returns anLdapMessage
containing aResponse
.static LdapMessage
newResponseMessage(int messageId, SearchResultEntry response)
Builds and returns anLdapMessage
containing aSearchResultEntry
.static LdapMessage
newResponseMessage(int messageId, SearchResultReference response)
Builds and returns anLdapMessage
containing aSearchResultReference
.LdapMessage
newResponseMessage(Response response)
Returns a newLdapMessage
containing the providedResponse
.static LdapMessage
newSearchResultDoneMessage(int messageId, Result result)
Builds and returns anLdapMessage
for a search result done operation type.String
toString()
-
-
-
Method Detail
-
newLdapMessage
public static LdapMessage newLdapMessage(int messageId, byte protocolOpType, ProtocolOp protocolOp)
Creates a newProtocolOp
containing a fully decoded LDAP message.- Parameters:
messageId
- Unique identifier of this messageprotocolOpType
- Type of protocol-op contained in this messageprotocolOp
- The fully decodedProtocolOp
- Returns:
- A new
LdapMessage
-
newRequestMessage
public static LdapMessage newRequestMessage(int messageId, Request request)
Builds and returns anLdapMessage
containing aRequest
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
from the actual type ofrequest
.- Parameters:
messageId
- Identifier of this messagerequest
- The fully decodedRequest
- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, Request forRequest, Response response)
Builds and returns anLdapMessage
containing aResponse
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
from the actual type ofrequest
thisresponse
respond to.- Parameters:
messageId
- Identifier of this messageforRequest
- TheRequest
theresponse
is responding to.response
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, SearchResultEntry response)
Builds and returns anLdapMessage
containing aSearchResultEntry
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, SearchResultReference response)
Builds and returns anLdapMessage
containing aSearchResultReference
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, IntermediateResponse response)
Builds and returns anLdapMessage
containing aIntermediateResponse
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, BindResult response)
Builds and returns anLdapMessage
containing aBindResult
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, ExtendedResult response)
Builds and returns anLdapMessage
containing aExtendedResult
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newResponseMessage
public static LdapMessage newResponseMessage(int messageId, CompareResult response)
Builds and returns anLdapMessage
containing aCompareResult
.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by inferring theprotocolOpType
.- Parameters:
messageId
- Identifier of this messageresponse
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
newSearchResultDoneMessage
public static LdapMessage newSearchResultDoneMessage(int messageId, Result result)
Builds and returns anLdapMessage
for a search result done operation type.
This method simplifiesnewLdapMessage(int, byte, ProtocolOp)
by removing theprotocolOpType
parameter when it can be inferred from the actual type ofprotocolOp
.- Parameters:
messageId
- Unique identifier of this messageresult
- The search result done result- Returns:
- a new
LdapMessage
-
getMessageId
public int getMessageId()
Returns the message-id.- Returns:
- The message-id
-
getProtocolOpType
public byte getProtocolOpType()
Returns the protocol-op type.- Returns:
- the protocol-op type
-
getProtocolOp
public ProtocolOp getProtocolOp()
Returns the protocol-op contained in this message.- Returns:
- the
ProtocolOp
-
newResponseMessage
public LdapMessage newResponseMessage(Response response)
Returns a newLdapMessage
containing the providedResponse
.- Parameters:
response
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
-