Package org.ldaptive.ad.control.util
Class NotificationClient
java.lang.Object
org.ldaptive.ad.control.util.NotificationClient
Client that simplifies using the notification control.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains data returned when using the notification control. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConnectionFactoryConnection factory to get a connection from.private SearchOperationHandleSearch operation handle.protected final LoggerLogger for this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabandon()Invokes an abandon operation on the last invocation ofexecute(SearchRequest, int).private RequestControl[]appendRequestControls(SearchRequest request) Creates a new array of request controls which includes the notification control.execute(SearchRequest request) Invokesexecute(SearchRequest, int)with a capacity ofInteger.MAX_VALUE.execute(SearchRequest request, int capacity) Performs a search operation with theNotificationControl.
-
Field Details
-
logger
Logger for this class. -
factory
Connection factory to get a connection from. -
handle
Search operation handle.
-
-
Constructor Details
-
NotificationClient
Creates a new notification client.- Parameters:
cf- to get a connection from
-
-
Method Details
-
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). -
appendRequestControls
Creates a new array of request controls which includes the notification control. Any other request controls are included.- Parameters:
request- to read controls from- Returns:
- search request controls
-