Record Class LdapMessage
java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.messages.LdapMessage
- Record Components:
messageId
- The LDAP message ID.protocolOpType
- The LDAP message type.protocolOp
- The LDAP message content.
Encapsulates a
ProtocolOp
with LDAP specific message information.-
Constructor Summary
ConstructorsConstructorDescriptionLdapMessage
(int messageId, byte protocolOpType, ProtocolOp protocolOp) Creates an instance of aLdapMessage
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themessageId
record component.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
.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.Returns the value of theprotocolOp
record component.byte
Returns the value of theprotocolOpType
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LdapMessage
Creates an instance of aLdapMessage
record class.- Parameters:
messageId
- the value for themessageId
record componentprotocolOpType
- the value for theprotocolOpType
record componentprotocolOp
- the value for theprotocolOp
record component
-
-
Method Details
-
newRequestMessage
Builds and returns anLdapMessage
containing aRequest
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aResponse
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aSearchResultEntry
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aSearchResultReference
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aIntermediateResponse
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aBindResult
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aExtendedResult
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
containing aCompareResult
.
This method simplifiesLdapMessage(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
Builds and returns anLdapMessage
for a search result done operation type.
This method simplifiesLdapMessage(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
-
newResponseMessage
Returns a newLdapMessage
containing the providedResponse
.- Parameters:
response
- The response which will be contained in the returned message- Returns:
- a new
LdapMessage
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
messageId
public int messageId()Returns the value of themessageId
record component.- Returns:
- the value of the
messageId
record component
-
protocolOpType
public byte protocolOpType()Returns the value of theprotocolOpType
record component.- Returns:
- the value of the
protocolOpType
record component
-
protocolOp
Returns the value of theprotocolOp
record component.- Returns:
- the value of the
protocolOp
record component
-