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 classNotificationClient.NotificationItemContains data returned when using the notification control.
-
Field Summary
Fields Modifier and Type Field Description private ConnectionFactoryfactoryConnection factory to get a connection from.private SearchOperationHandlehandleSearch operation handle.protected LoggerloggerLogger 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 voidabandon()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.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).
-
appendRequestControls
private RequestControl[] appendRequestControls(SearchRequest request)
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
-
-