ErrorLogAccountStatusNotificationHandler.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class defines an account status notification handler that will write
* information about status notifications using the Directory Server's error
* logging facility.
*/
public class ErrorLogAccountStatusNotificationHandler
extends
implements
{
/**
* The set of names for the account status notification types that may be
* logged by this notification handler.
*/
static
{
for (AccountStatusNotificationType t :
{
}
}
// The DN of the configuration entry for this notification handler.
private DN configEntryDN;
// The set of notification types that should generate log messages.
/**
* {@inheritDoc}
*/
public void initializeStatusNotificationHandler(
)
{
// Read configuration and apply changes.
boolean applyChanges = true;
}
/**
* {@inheritDoc}
*/
public void handleStatusNotification(
{
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationAcceptable(
{
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationChangeAcceptable(
)
{
// Make sure that we can process the defined notification handler.
// If so, then we'll accept the new configuration.
boolean applyChanges = false;
boolean isAcceptable = processNotificationHandlerConfig (
);
return isAcceptable;
}
/**
* Makes a best-effort attempt to apply the configuration contained in the
* provided entry. Information about the result of this processing should be
* added to the provided message list. Information should always be added to
* this list if a configuration change could not be applied. If detailed
* results are requested, then information about the changes applied
* successfully (and optionally about parameters that were not changed) should
* also be included.
*
* @param configuration The entry containing the new configuration to
* apply for this component.
* @param detailedResults Indicates whether detailed information about the
* processing should be added to the list.
*
* @return Information about the result of the configuration update.
*/
boolean detailedResults
)
{
return changeResult;
}
/**
* {@inheritDoc}
*/
)
{
// Initialize the set of notification types that should generate log messages.
boolean applyChanges =false;
return new ConfigChangeResult();
}
/**
* Parses the provided configuration and configure the notification handler.
*
* @param configuration The new configuration containing the changes.
* @param applyChanges If true then take into account the new configuration.
*
* @return The mapping between strings of character set values and the
* minimum number of characters required from those sets.
*/
public boolean processNotificationHandlerConfig(
boolean applyChanges
)
{
// false if the configuration is not acceptable
boolean isAcceptable = true;
// The set of notification types that should generate log messages.
new HashSet<AccountStatusNotificationType>();
// Initialize the set of notification types that should generate log
// messages.
{
}
if (applyChanges && isAcceptable)
{
}
return isAcceptable;
}
/**
* Gets the OpenDS notification type object that corresponds to the
* configuration counterpart.
*
* @param configNotificationType The configuration notification type for
* which to retrieve the OpenDS notification
* type.
*/
)
{
switch (configNotificationType)
{
break;
break;
case ACCOUNT_UNLOCKED:
break;
case ACCOUNT_IDLE_LOCKED:
break;
case ACCOUNT_RESET_LOCKED:
break;
case ACCOUNT_DISABLED:
break;
case ACCOUNT_ENABLED:
break;
case ACCOUNT_EXPIRED:
break;
case PASSWORD_EXPIRED:
break;
case PASSWORD_EXPIRING:
break;
case PASSWORD_RESET:
break;
case PASSWORD_CHANGED:
break;
}
return nt;
}
}