@Extensible @DirectoryServerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class NotificationManager extends java.lang.Object implements UnboundIDExtension, Reconfigurable<NotificationManagerConfig>, ExampleUsageProvider
dsconfig set-backend-prop \ --backend-name changelog \ --set enabled:trueIn order to configure a notification manager created using this API, use a command like:
dsconfig create-notification-manager \ --manager-name "{manager-ID}" \ --type third-party \ --set enabled:true \ --set "extension-class:{class-name}" \ --set "subscription-base-dn:{subscription-base-dn}" \ --set "extension-argument:{name=value}"where "{manager-ID}" is the ID to use for the notification manager instance, "{subscription-base-dn}" is the base DN where subscription information for this notification manager is to be stored, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.ds.api.NotificationManager
, and
"{name=value}" represents name-value pairs for any arguments to
provide to the notification manager. If multiple arguments should be
provided to the notification manager, then the
"--set extension-argument:{name=value}
" option should be
provided multiple times.
dsconfig set-backend-prop \ --backend-name "userRoot" \ --set "notification-manager:{manager-ID}"The {subscription-base-dn} of the notification manager must be within the scope of the base-dn of the backend.
Constructor and Description |
---|
NotificationManager() |
Modifier and Type | Method and Description |
---|---|
com.unboundid.ldap.sdk.ResultCode |
applyConfiguration(NotificationManagerConfig config,
com.unboundid.util.args.ArgumentParser parser,
java.util.List<java.lang.String> adminActionsRequired,
java.util.List<java.lang.String> messages)
Attempts to apply the configuration from the provided argument parser to
this extension.
|
abstract boolean |
areDestinationDetailsAcceptable(java.lang.String destinationID,
java.util.List<com.unboundid.asn1.ASN1OctetString> destinationDetails,
java.util.List<java.lang.String> unacceptableReasons)
Determine whether the provided destination details are acceptable.
|
abstract boolean |
areSubscriptionDetailsAcceptable(java.lang.String destinationID,
java.lang.String subscriptionID,
java.util.List<com.unboundid.asn1.ASN1OctetString> subscriptionDetails,
java.util.List<java.lang.String> unacceptableReasons)
Determine whether the provided subscription details are acceptable.
|
abstract NotificationDeliveryResult |
attemptDelivery(Notification notification)
Attempt delivery of a notification and return a result indicating whether
delivery was successful, and whether delivery should be retried if this
attempt was unsuccessful.
|
void |
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
abstract void |
deleteNotificationDestination(java.lang.String destinationID)
Delete a notification destination including any associated
subscriptions.
|
abstract void |
deleteNotificationSubscription(java.lang.String destinationID,
java.lang.String subscriptionID)
Delete a notification subscription.
|
void |
finalizeNotificationManager()
Performs any cleanup which may be necessary when this notification manager
is to be taken out of service.
|
abstract java.util.List<NotificationProperties> |
getAddNotificationProperties(AddRequest addRequest)
Determine if any notifications are required for the provided add
request and return notification properties for each notification
destination that requires a notification.
|
abstract java.util.List<NotificationProperties> |
getDeleteNotificationProperties(DeleteRequest deleteRequest)
Determine if any notifications are required for the provided delete
request and return notification properties for each notification
destination that requires a notification.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
abstract java.util.List<NotificationProperties> |
getModifyDNNotificationProperties(ModifyDNRequest modifyDNRequest)
Determine if any notifications are required for the provided modify DN
request and return notification properties for each notification
destination that requires a notification.
|
abstract java.util.List<NotificationProperties> |
getModifyNotificationProperties(ModifyRequest modifyRequest)
Determine if any notifications are required for the provided modify
request and return notification properties for each notification
destination that requires a notification.
|
abstract void |
initializeNotificationDestinations(java.util.List<com.unboundid.ldap.sdk.unboundidds.extensions.NotificationDestinationDetails> destinations)
Initializes or re-initializes the notification destinations for this
notification manager.
|
void |
initializeNotificationManager(DirectoryServerContext serverContext,
NotificationManagerConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this notification manager.
|
boolean |
isConfigurationAcceptable(NotificationManagerConfig config,
com.unboundid.util.args.ArgumentParser parser,
java.util.List<java.lang.String> unacceptableReasons)
Indicates whether the configuration represented by the provided argument
parser is acceptable for use by this extension.
|
abstract boolean |
isPreferredForDestination(java.lang.String destinationID)
Determine whether the server running this extension is preferred for the
given notification destination.
|
abstract void |
setNotificationDestination(java.lang.String destinationID,
java.util.List<com.unboundid.asn1.ASN1OctetString> destinationDetails)
Create or update a notification destination.
|
abstract void |
setNotificationSubscription(java.lang.String destinationID,
java.lang.String subscriptionID,
java.util.List<com.unboundid.asn1.ASN1OctetString> subscriptionDetails)
Create or update a notification subscription.
|
public NotificationManager()
public abstract java.lang.String getExtensionName()
getExtensionName
in interface UnboundIDExtension
public abstract java.lang.String[] getExtensionDescription()
getExtensionDescription
in interface UnboundIDExtension
null
or an empty array if no description should be available.public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments
in interface Configurable
parser
- The argument parser to be updated with the configuration
arguments which may be used by this extension.com.unboundid.util.args.ArgumentException
- If a problem is encountered while updating the
provided argument parser.public void initializeNotificationManager(DirectoryServerContext serverContext, NotificationManagerConfig config, com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.ldap.sdk.LDAPException
serverContext
- A handle to the server context for the server in
which this extension is running.config
- The general configuration for this notification
manager.parser
- The argument parser which has been initialized from
the configuration for this notification manager.com.unboundid.ldap.sdk.LDAPException
- If a problem occurs while initializing this
notification manager.public abstract void initializeNotificationDestinations(java.util.List<com.unboundid.ldap.sdk.unboundidds.extensions.NotificationDestinationDetails> destinations) throws com.unboundid.ldap.sdk.LDAPException
destinations
- The list of defined notification destinations and
their associated subscriptions.com.unboundid.ldap.sdk.LDAPException
- If a problem occurs while initializing the
notification destinations for this notification
manager.public abstract boolean areDestinationDetailsAcceptable(java.lang.String destinationID, java.util.List<com.unboundid.asn1.ASN1OctetString> destinationDetails, java.util.List<java.lang.String> unacceptableReasons)
setNotificationDestination
with the same details will not
fail due to invalid details.destinationID
- The notification destination ID.destinationDetails
- The notification destination details.unacceptableReasons
- A list that may be used to hold the
reasons that the provided details are
not acceptable.true
if the provided details are acceptable.public abstract void setNotificationDestination(java.lang.String destinationID, java.util.List<com.unboundid.asn1.ASN1OctetString> destinationDetails) throws com.unboundid.ldap.sdk.LDAPException
destinationID
- The notification destination ID.destinationDetails
- The notification destination details.com.unboundid.ldap.sdk.LDAPException
- If a problem occurs while creating or updating the
notification destination.public abstract boolean areSubscriptionDetailsAcceptable(java.lang.String destinationID, java.lang.String subscriptionID, java.util.List<com.unboundid.asn1.ASN1OctetString> subscriptionDetails, java.util.List<java.lang.String> unacceptableReasons)
destinationID
- The notification destination ID.subscriptionID
- The notification subscription ID.subscriptionDetails
- The notification subscription details.unacceptableReasons
- A list that may be used to hold the
reasons that the provided details are
not acceptable.true
if the provided details are acceptable.public abstract void setNotificationSubscription(java.lang.String destinationID, java.lang.String subscriptionID, java.util.List<com.unboundid.asn1.ASN1OctetString> subscriptionDetails) throws com.unboundid.ldap.sdk.LDAPException
destinationID
- The notification destination ID.subscriptionID
- The notification subscription ID.subscriptionDetails
- The notification destination details.com.unboundid.ldap.sdk.LDAPException
- If a problem occurs while creating or updating the
notification subscription.public abstract void deleteNotificationDestination(java.lang.String destinationID)
destinationID
- The notification destination ID.public abstract void deleteNotificationSubscription(java.lang.String destinationID, java.lang.String subscriptionID)
destinationID
- The notification destination ID.subscriptionID
- The notification subscription ID.public abstract boolean isPreferredForDestination(java.lang.String destinationID)
true
if this server is local to the destination.destinationID
- The notification destination ID.true
if this server is preferred for the given
notification destination.public abstract java.util.List<NotificationProperties> getAddNotificationProperties(AddRequest addRequest)
addRequest
- The add request that is being processed.null
list indicates that the operation does not
require any notifications.public abstract java.util.List<NotificationProperties> getDeleteNotificationProperties(DeleteRequest deleteRequest)
deleteRequest
- The delete request that is being processed.null
list indicates that the operation does not
require any notifications.public abstract java.util.List<NotificationProperties> getModifyNotificationProperties(ModifyRequest modifyRequest)
modifyRequest
- The modify request that is being processed.null
list indicates that the operation does not
require any notifications.public abstract java.util.List<NotificationProperties> getModifyDNNotificationProperties(ModifyDNRequest modifyDNRequest)
modifyDNRequest
- The modify DN request that is being processed.null
list indicates that the operation does not
require any notifications.public abstract NotificationDeliveryResult attemptDelivery(Notification notification)
RETRY
when all future attempts of the
notification delivery will fail, e.g. a remote change failing due to a
schema violation. If the extension can determine that the remote service
is completely unavailable, then it is fine to continue to retry, but if
the service is available and only failing for some changes, then
continuing to retry is dangerous. There are methods on the Notification
interface to determine how many attempts have been made
and for how long attempts have been made. Above some threshold, the
extension should return FAILURE
instead of RETRY
.
notification
- The notification to be delivered.public boolean isConfigurationAcceptable(NotificationManagerConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> unacceptableReasons)
isConfigurationAcceptable
in interface Reconfigurable<NotificationManagerConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the proposed configuration for this
extension.unacceptableReasons
- A list to which messages may be added to
provide additional information about why the
provided configuration is not acceptable.true
if the configuration in the provided argument parser
appears to be acceptable, or false
if not.public com.unboundid.ldap.sdk.ResultCode applyConfiguration(NotificationManagerConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> adminActionsRequired, java.util.List<java.lang.String> messages)
applyConfiguration
in interface Reconfigurable<NotificationManagerConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the new configuration for this
extension.adminActionsRequired
- A list to which messages may be added to
provide additional information about any
additional administrative actions that may
be required to apply some of the
configuration changes.messages
- A list to which messages may be added to
provide additional information about the
processing performed by this method.SUCCESS
should be
used to indicate that all processing completed successfully. Any
other result will indicate that a problem occurred during
processing.public void finalizeNotificationManager()
public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets
in interface ExampleUsageProvider
null
or empty if there should
not be any example argument sets.