/*
* 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 a utility that will be used to manage the set of
* log retention policies used in the Directory Server. It will perform the
* initialization when the server is starting, and then will manage any
* additions, and removals of policies while the server is running.
*/
public class LogRetentionPolicyConfigManager implements
{
/**
* Creates this log retention policy manager.
*
* @param serverContext
* The server context.
*/
{
this.serverContext = serverContext;
}
/**
* Initializes all the log retention policies.
*
* @throws ConfigException
* If an unrecoverable problem arises in the process of performing
* the initialization as a result of the server configuration.
* @throws InitializationException
* If a problem occurs during initialization that is not related to
* the server configuration.
*/
{
{
}
}
/** {@inheritDoc} */
public boolean isConfigurationAddAcceptable(
{
}
/** {@inheritDoc} */
public boolean isConfigurationDeleteAcceptable(
{
// TODO: Make sure nothing is using this policy before deleting it.
return true;
}
/** {@inheritDoc} */
{
try
{
}
catch (ConfigException e) {
logger.traceException(e);
} catch (Exception e) {
logger.traceException(e);
}
return ccr;
}
/** {@inheritDoc} */
{
{
}
else
{
// TODO: Add message and check for usage
}
return ccr;
}
/** {@inheritDoc} */
public boolean isConfigurationChangeAcceptable(
{
}
/** {@inheritDoc} */
{
{
ccr.setAdminActionRequired(true);
}
return ccr;
}
{
try {
// Explicitly cast to check that implementation implements the correct interface.
// next line is here to ensure that eclipse does not remove the cast in the line above
return true;
} catch (Exception e) {
return false;
}
}
throws ConfigException {
try {
return retentionPolicy;
} catch (Exception e) {
throw new ConfigException(message, e);
}
}
}