/*
* 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.
*/
/**
* This class defines a utility that will be used to manage the set of
* log rotation 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 LogRotationPolicyConfigManager implements
{
/**
* The tracer object for the debug logger.
*/
/**
* Initializes all the log rotation 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.
*/
public void initializeLogRotationPolicyConfig()
{
{
}
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationAddAcceptable(
{
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationDeleteAcceptable(
{
// TODO: Make sure nothing is using this policy before deleting it.
return true;
}
/**
* {@inheritDoc}
*/
{
// Default result code.
boolean adminActionRequired = false;
try
{
}
catch (ConfigException e) {
if (debugEnabled())
{
}
} catch (Exception e) {
if (debugEnabled())
{
}
}
}
/**
* {@inheritDoc}
*/
{
// Default result code.
boolean adminActionRequired = false;
{
}
else
{
// TODO: Add message and check for usage
}
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationChangeAcceptable(
{
}
/**
* {@inheritDoc}
*/
{
// Default result code.
boolean adminActionRequired = false;
{
adminActionRequired = true;
}
}
{
// Load the class and cast it to a RotationPolicy.
try {
} catch (Exception e) {
return false;
}
// Check that the implementation class implements the correct interface.
try {
// Determine the initialization method to use: it must take a
// single parameter which is the exact type of the configuration
// object.
.configurationClass());
} catch (Exception e) {
return false;
}
// The class is valid as far as we can tell.
return true;
}
throws ConfigException {
// Load the class and cast it to a RotationPolicy.
try {
// Determine the initialization method to use: it must take a
// single parameter which is the exact type of the configuration
// object.
.configurationClass());
}
catch (InvocationTargetException ite)
{
// Rethrow the exceptions thrown be the invoked method.
throw new ConfigException(message, e);
} catch (Exception e) {
throw new ConfigException(message, e);
}
// The connection handler has been successfully initialized.
return rotationPolicy;
}
}