Package org.ldaptive
Class AbstractRequestMessage
- java.lang.Object
-
- org.ldaptive.AbstractRequestMessage
-
- All Implemented Interfaces:
Request
- Direct Known Subclasses:
AbandonRequest
,AddRequest
,AnonymousBindRequest
,CompareRequest
,DeleteRequest
,ExtendedRequest
,ModifyDnRequest
,ModifyRequest
,SaslBindRequest
,SearchRequest
,SimpleBindRequest
,UnbindRequest
public abstract class AbstractRequestMessage extends Object implements Request
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
AbstractRequestMessage.AbstractBuilder<B,T extends AbstractRequestMessage>
Base class for request builders.
-
Field Summary
Fields Modifier and Type Field Description private RequestControl[]
controls
LDAP controls.protected Logger
logger
Logger for this class.private Duration
responseTimeout
Duration of time to wait for a response.
-
Constructor Summary
Constructors Constructor Description AbstractRequestMessage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]
encode(int id)
Encode this request as asn.1.private DEREncoder
getControlEncoder()
Returns the encoder to any controls that may be set on this message.RequestControl[]
getControls()
protected abstract DEREncoder[]
getRequestEncoders(int id)
Returns the request encoders for this message.Duration
getResponseTimeout()
Returns the response timeout.void
setControls(RequestControl... cntrls)
void
setResponseTimeout(Duration time)
Sets the maximum amount of time to wait for a response from this request.String
toString()
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
controls
private RequestControl[] controls
LDAP controls.
-
responseTimeout
private Duration responseTimeout
Duration of time to wait for a response. This property is not part of the request specification.
-
-
Method Detail
-
getControls
public RequestControl[] getControls()
-
setControls
public void setControls(RequestControl... cntrls)
-
getResponseTimeout
public Duration getResponseTimeout()
Returns the response timeout.- Returns:
- timeout
-
setResponseTimeout
public void setResponseTimeout(Duration time)
Sets the maximum amount of time to wait for a response from this request.- Parameters:
time
- timeout for a response
-
encode
public byte[] encode(int id)
Description copied from interface:Request
Encode this request as asn.1.
-
getRequestEncoders
protected abstract DEREncoder[] getRequestEncoders(int id)
Returns the request encoders for this message.- Parameters:
id
- message ID- Returns:
- request encoders
-
getControlEncoder
private DEREncoder getControlEncoder()
Returns the encoder to any controls that may be set on this message.- Returns:
- control encoder
-
-