From dfdd9440011d222f12e6e336ed6ab6e59ee2be4b Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 26 Aug 2007 20:35:25 +0000
Subject: [PATCH] Make a change to the account status notification handler API so that it is possible to provide additional properties along with the notification. This makes it possible to develop account status notification handlers that can act more intelligently and/or provide more useful information.
---
opends/src/server/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/opends/src/server/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java b/opends/src/server/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
index 5e16790..36c3b89 100644
--- a/opends/src/server/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
+++ b/opends/src/server/org/opends/server/extensions/ErrorLogAccountStatusNotificationHandler.java
@@ -45,11 +45,10 @@
ErrorLogAccountStatusNotificationHandlerCfg;
import org.opends.server.api.AccountStatusNotificationHandler;
import org.opends.server.config.ConfigException;
+import org.opends.server.types.AccountStatusNotification;
import org.opends.server.types.AccountStatusNotificationType;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.DN;
-
-
import org.opends.server.types.InitializationException;
import org.opends.server.types.ResultCode;
@@ -72,15 +71,15 @@
* The set of names for the account status notification types that may be
* logged by this notification handler.
*/
- private static final HashSet<Message> NOTIFICATION_TYPE_NAMES =
- new HashSet<Message>();
+ private static final HashSet<String> NOTIFICATION_TYPE_NAMES =
+ new HashSet<String>();
static
{
for (AccountStatusNotificationType t :
AccountStatusNotificationType.values())
{
- NOTIFICATION_TYPE_NAMES.add(t.getNotificationName());
+ NOTIFICATION_TYPE_NAMES.add(t.getName());
}
}
@@ -114,17 +113,14 @@
/**
* {@inheritDoc}
*/
- public void handleStatusNotification(AccountStatusNotificationType
- notificationType,
- DN userDN, Message message)
+ public void handleStatusNotification(
+ AccountStatusNotification notification)
{
- if (notificationTypes.contains(notificationType))
- {
- logError(NOTE_ERRORLOG_ACCTNOTHANDLER_NOTIFICATION.get(
- notificationType.getNotificationName(),
- String.valueOf(userDN),
- message.getDescriptor().getId(), message));
- }
+ logError(NOTE_ERRORLOG_ACCTNOTHANDLER_NOTIFICATION.get(
+ notification.getNotificationType().getName(),
+ String.valueOf(notification.getUserDN()),
+ notification.getMessage().getDescriptor().getId(),
+ notification.getMessage()));
}
--
Gitblit v1.10.0