public class SearchRequestDecorator extends MessageDecorator<SearchRequest> implements SearchRequest
RESPONSE_TYPES
Constructor and Description |
---|
SearchRequestDecorator(LdapApiService codec,
SearchRequest decoratedMessage)
Makes a SearchRequest encodable.
|
Modifier and Type | Method and Description |
---|---|
void |
abandon()
Abandons this request.
|
SearchRequest |
addAbandonListener(AbandonListener listener)
Adds listener to be notified if this request gets abandoned.
|
SearchRequest |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
SearchRequest |
addAttributes(String... attributes)
Adds some attributes to the set of entry attributes to return.
|
SearchRequest |
addControl(Control control)
Adds a control to this Message.
|
void |
addCurrentFilter(Filter localFilter)
Add a current filter.
|
int |
computeLength()
Compute the SearchRequest length
SearchRequest : |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the SearchRequest message to a PDU.
|
boolean |
equals(Object o) |
SearchRequest |
followReferrals()
Tells the client to follow referrals instead of throwing exceptions
|
List<String> |
getAttributes()
Gets a list of the attributes to be returned from each entry which
matches the search filter.
|
Dn |
getBase()
Gets the search base as a distinguished name.
|
Filter |
getCodecFilter()
Gets the search filter associated with this search request.
|
Filter |
getCurrentFilter() |
AliasDerefMode |
getDerefAliases()
Gets the alias handling parameter.
|
ExprNode |
getFilter()
Gets the search filter associated with this search request.
|
ExprNode |
getFilterNode()
Gets the search filter associated with this search request.
|
MessageTypeEnum[] |
getResponseTypes()
Gets the different response types generated by a search request.
|
SearchResultDone |
getResultResponse()
If called for the first time, this method creates a result containing
response object for this request.
|
SearchScope |
getScope()
Gets the search scope parameter enumeration.
|
long |
getSizeLimit()
A sizelimit that restricts the maximum number of entries to be returned
as a result of the search.
|
Filter |
getTerminalFilter()
Get the terminal filter
|
int |
getTimeLimit()
Gets the timelimit that restricts the maximum time (in seconds) allowed
for a search.
|
boolean |
getTypesOnly()
An indicator as to whether search results will contain both attribute
types and values, or just attribute types.
|
int |
hashCode() |
boolean |
hasResponse()
Tests to see if this Request produces one or more response types.
|
SearchRequest |
ignoreReferrals()
Tells the client to ignore referrals instead of throwing exceptions.
|
boolean |
isAbandoned()
Checks to see if this request has been abandoned.
|
boolean |
isFollowReferrals()
Tells the client if it should follow referrals instead of throwing exceptions
|
boolean |
isIgnoreReferrals()
Tells the client if it should ignore referrals instead of throwing exceptions
|
SearchRequest |
removeAttribute(String attribute)
Removes an attribute to the set of entry attributes to return.
|
SearchRequest |
removeControl(Control control)
Deletes a control removing it from this Message.
|
SearchRequest |
setBase(Dn baseDn)
Sets the search base as a distinguished name.
|
void |
setCurrentFilter(Filter filter)
Set the current filter
|
SearchRequest |
setDerefAliases(AliasDerefMode aliasDerefAliases)
Sets the alias handling parameter.
|
SearchRequest |
setFilter(ExprNode filter)
Sets the search filter associated with this search request.
|
SearchRequest |
setFilter(String filter)
Sets the search filter associated with this search request.
|
SearchRequest |
setMessageId(int messageId)
Sets the Message ID for this request
|
SearchRequest |
setScope(SearchScope scope)
Sets the search scope parameter enumeration.
|
SearchRequest |
setSizeLimit(long entriesMax)
Sets sizelimit that restricts the maximum number of entries to be
returned as a result of the search.
|
void |
setTerminalFilter(Filter terminalFilter)
Set the terminal filter
|
SearchRequest |
setTimeLimit(int secondsMax)
Sets the timelimit that restricts the maximum time (in seconds) allowed
for a search.
|
void |
setTlvId(int tlvId)
Set the SearchRequest PDU TLV's Id
|
SearchRequest |
setTypesOnly(boolean typesOnly)
An indicator as to whether search results will contain both attribute
types and values, or just attribute types.
|
void |
unstackFilters(Asn1Container container)
This method is used to clear the filter's stack for terminated elements.
|
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toString
get, getControl, getControls, getMessageId, getType, hasControl, put
public SearchRequestDecorator(LdapApiService codec, SearchRequest decoratedMessage)
codec
- The LDAP service instancedecoratedMessage
- the decorated SearchRequestpublic void setTlvId(int tlvId)
tlvId
- The TLV idpublic Filter getCurrentFilter()
public Filter getCodecFilter()
public ExprNode getFilterNode()
public Filter getTerminalFilter()
public void setTerminalFilter(Filter terminalFilter)
terminalFilter
- the teminalFilter.public SearchRequest setFilter(ExprNode filter)
setFilter
in interface SearchRequest
filter
- the expression node for the root of the filter expression tree.public SearchRequest setFilter(String filter) throws LdapException
setFilter
in interface SearchRequest
filter
- the expression node for the root of the filter expression tree.LdapException
- If the filter can't be addedpublic void setCurrentFilter(Filter filter)
filter
- The filter to set.public void addCurrentFilter(Filter localFilter) throws DecoderException
localFilter
- The filter to set.DecoderException
- If the filter is invalidpublic void unstackFilters(Asn1Container container)
container
- The container being decodedpublic int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public MessageTypeEnum[] getResponseTypes()
getResponseTypes
in interface ManyReplyRequest
getResponseTypes
in interface SearchRequest
SearchRequest.RESPONSE_TYPES
public Dn getBase()
getBase
in interface SearchRequest
public SearchRequest setBase(Dn baseDn)
setBase
in interface SearchRequest
baseDn
- the search basepublic SearchScope getScope()
getScope
in interface SearchRequest
public SearchRequest setScope(SearchScope scope)
setScope
in interface SearchRequest
scope
- the scope enumeration parameter.public AliasDerefMode getDerefAliases()
getDerefAliases
in interface SearchRequest
public SearchRequest setDerefAliases(AliasDerefMode aliasDerefAliases)
setDerefAliases
in interface SearchRequest
aliasDerefAliases
- the alias handling parameter enumeration.public long getSizeLimit()
getSizeLimit
in interface SearchRequest
public SearchRequest setSizeLimit(long entriesMax)
setSizeLimit
in interface SearchRequest
entriesMax
- maximum search result entries to return.public int getTimeLimit()
getTimeLimit
in interface SearchRequest
public SearchRequest setTimeLimit(int secondsMax)
setTimeLimit
in interface SearchRequest
secondsMax
- the search time limit in seconds.public boolean getTypesOnly()
getTypesOnly
in interface SearchRequest
public SearchRequest setTypesOnly(boolean typesOnly)
setTypesOnly
in interface SearchRequest
typesOnly
- true for only types, false for types and values.public ExprNode getFilter()
getFilter
in interface SearchRequest
public List<String> getAttributes()
getAttributes
in interface SearchRequest
public SearchRequest addAttributes(String... attributes)
addAttributes
in interface SearchRequest
attributes
- the attributes description or identifier.public SearchRequest removeAttribute(String attribute)
removeAttribute
in interface SearchRequest
attribute
- the attribute description or identifier.public int computeLength()
0x63 L1 | +--> 0x04 L2 baseObject +--> 0x0A 0x01 scope +--> 0x0A 0x01 derefAliases +--> 0x02 0x0(1..4) sizeLimit +--> 0x02 0x0(1..4) timeLimit +--> 0x01 0x01 typesOnly +--> filter.computeLength() +--> 0x30 L3 (Attribute description list) | +--> 0x04 L4-1 Attribute description +--> 0x04 L4-2 Attribute description +--> ... +--> 0x04 L4-i Attribute description +--> ... +--> 0x04 L4-n Attribute description
computeLength
in interface Asn1Object
computeLength
in interface Decorator<SearchRequest>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
0x63 LL 0x04 LL baseObject 0x0A 01 scope 0x0A 01 derefAliases 0x02 0N sizeLimit 0x02 0N timeLimit 0x01 0x01 typesOnly filter.encode() 0x30 LL attributeDescriptionList 0x04 LL attributeDescription ... 0x04 LL attributeDescription
encode
in interface Asn1Object
encode
in interface Decorator<SearchRequest>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic SearchResultDone getResultResponse()
getResultResponse
in interface ResultResponseRequest
public boolean hasResponse()
hasResponse
in interface Request
public void abandon()
abandon
in interface AbandonableRequest
public boolean isAbandoned()
isAbandoned
in interface AbandonableRequest
public SearchRequest addAbandonListener(AbandonListener listener)
addAbandonListener
in interface AbandonableRequest
listener
- to be notified if this request gets abandoned.public SearchRequest setMessageId(int messageId)
setMessageId
in interface Message
setMessageId
in interface SearchRequest
setMessageId
in class MessageDecorator<SearchRequest>
messageId
- The message Idpublic SearchRequest addControl(Control control)
addControl
in interface Message
addControl
in interface SearchRequest
addControl
in class MessageDecorator<SearchRequest>
control
- the control to add.public SearchRequest addAllControls(Control[] controls)
addAllControls
in interface Message
addAllControls
in interface SearchRequest
addAllControls
in class MessageDecorator<SearchRequest>
controls
- the controls to add.public SearchRequest removeControl(Control control)
removeControl
in interface Message
removeControl
in interface SearchRequest
removeControl
in class MessageDecorator<SearchRequest>
control
- the control to remove.public boolean isFollowReferrals()
isFollowReferrals
in interface SearchRequest
public SearchRequest followReferrals()
followReferrals
in interface SearchRequest
public boolean isIgnoreReferrals()
isIgnoreReferrals
in interface SearchRequest
public SearchRequest ignoreReferrals()
ignoreReferrals
in interface SearchRequest
Copyright © 2003–2018 The Apache Software Foundation. All rights reserved.