/*
* 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 2010 Sun Microsystems, Inc.
* Portions Copyright 2012-2014 ForgeRock AS
*/
/**
* The class that is in charge of taking the different information provided
* by the user through the command-line and actually executing the local
* purge.
*
*/
public class LocalPurgeHistorical
{
/**
* The default constructor.
* @param uData the object containing the information provided by the user.
* @param app the console application that is used to write the progress
* and error messages.
* @param formatter the formatter to be used to generated the messages.
* @param configFile the file that contains the configuration. This is
* required to initialize properly the server.
* @param configClass the class to be used to read the configuration. This is
* required to initialize properly the server.
*/
{
this.configFile = configFile;
this.configClass = configClass;
}
/**
* Executes the purge historical operation locally.
* @return the result code.
*/
{
pointAdder.start();
try
{
}
catch (Exception e)
{
pointAdder.stop();
": "+e, e));
}
try
{
// Create a configuration for the server.
new DirectoryEnvironmentConfig();
}
catch (OpenDsException ode)
{
pointAdder.stop();
}
pointAdder.stop();
{
return handleTimeout();
}
try
{
// launch the job
{
// We can assume that this is an LDAP replication domain
}
}
catch (DirectoryException de)
{
{
return handleTimeout();
}
else
{
return handleGenericExecuting(de);
}
}
return ReplicationCliReturnCode.SUCCESSFUL;
}
{
ode.getMessageObject()));
}
{
getTimeoutInSeconds()));
}
/**
* Returns the time-out provided by the user in seconds.
* @return the time-out provided by the user in seconds.
*/
private int getTimeoutInSeconds()
{
return uData.getMaximumDuration();
}
/**
* A method that tells whether the maximum time to execute the operation was
* elapsed or not.
* @param endMaxTime the latest time in milliseconds when the operation should
* be completed.
* @return {@code true} if the time-out occurred and {@code false} otherwise.
*/
{
}
}