Package org.ldaptive.ad.control.util
Class NotificationClient
- java.lang.Object
-
- org.ldaptive.ad.control.util.NotificationClient
-
public class NotificationClient extends Object
Client that simplifies using the notification control.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NotificationClient.NotificationItem
Contains data returned when using the notification control.
-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactory
factory
Connection factory to get a connection from.private SearchOperationHandle
handle
Search operation handle.protected Logger
logger
Logger for this class.
-
Constructor Summary
Constructors Constructor Description NotificationClient(ConnectionFactory cf)
Creates a new notification client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abandon()
Invokes an abandon operation on the last invocation ofexecute(SearchRequest, int)
.BlockingQueue<NotificationClient.NotificationItem>
execute(SearchRequest request)
Invokesexecute(SearchRequest, int)
with a capacity ofInteger.MAX_VALUE
.BlockingQueue<NotificationClient.NotificationItem>
execute(SearchRequest request, int capacity)
Performs a search operation with theNotificationControl
.
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
factory
private final ConnectionFactory factory
Connection factory to get a connection from.
-
handle
private SearchOperationHandle handle
Search operation handle.
-
-
Constructor Detail
-
NotificationClient
public NotificationClient(ConnectionFactory cf)
Creates a new notification client.- Parameters:
cf
- to get a connection from
-
-
Method Detail
-
execute
public BlockingQueue<NotificationClient.NotificationItem> execute(SearchRequest request) throws LdapException
Invokesexecute(SearchRequest, int)
with a capacity ofInteger.MAX_VALUE
.- Parameters:
request
- search request to execute- Returns:
- blocking queue to wait for search entries
- Throws:
LdapException
- if the search fails
-
execute
public BlockingQueue<NotificationClient.NotificationItem> execute(SearchRequest request, int capacity) throws LdapException
Performs a search operation with theNotificationControl
. The supplied request is modified in the following way:AbstractRequestMessage.setControls( org.ldaptive.control.RequestControl...)
is invoked withNotificationControl
The search request object should not be reused for any other search operations.
- Parameters:
request
- search request to executecapacity
- of the returned blocking queue- Returns:
- blocking queue to wait for search entries
- Throws:
LdapException
- if the search fails
-
abandon
public void abandon()
Invokes an abandon operation on the last invocation ofexecute(SearchRequest, int)
.
-
-