ConfigFromFile.java revision 9e82f3d205d5756d6cc6a400dc92e07c078862d6
/*
* 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 2008-2011 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* A class that reads the configuration information from the files.
*/
public class ConfigFromFile extends ConfigReader
{
/**
* Creates a new instance of this config file handler. No initialization
* should be performed here, as all of that work should be done in the
* <CODE>initializeConfigHandler</CODE> method.
*/
public ConfigFromFile()
{
super();
}
/**
* Reads configuration information from the configuration files.
*/
public void readConfiguration()
{
final Set<ConnectionHandlerDescriptor> connectionHandlers = new HashSet<ConnectionHandlerDescriptor>();
try
{
}
catch (final OpenDsException oe)
{
}
catch (final Throwable t)
{
}
{
}
{
}
}
{
if (mustReadSchema())
{
try
{
readSchema();
{
// Update the schema: so that when we call the server code the
// latest schema read on the server we are managing is used.
}
}
catch (final OpenDsException oe)
{
}
}
}
{
// Get the Directory Server configuration handler and use it.
{
}
}
private void readAdminConnector(final RootCfg root, final List<OpenDsException> errors) throws OpenDsException
{
try
{
}
catch (final ConfigException ce)
{
}
}
private void readConnectionHandlers(final Set<ConnectionHandlerDescriptor> connectionHandlers, final RootCfg root,
{
{
try
{
}
catch (final OpenDsException oe)
{
}
}
}
private void readBackendConfiguration(final Set<BackendDescriptor> backendDescriptors, final RootCfg root,
{
{
try
{
{
final BaseDNDescriptor baseDN =
}
if (backend instanceof LocalDBBackendCfg)
{
try
{
{
}
}
catch (final ConfigException ce)
{
}
indexes.add(new IndexDescriptor("id2children", null, null, new TreeSet<IndexTypeDescriptor>(), -1));
try
{
{
}
}
catch (final ConfigException ce)
{
}
}
else if (backend instanceof LDIFBackendCfg)
{
}
else if (backend instanceof MemoryBackendCfg)
{
}
else if (backend instanceof BackupBackendCfg)
{
}
else if (backend instanceof MonitorBackendCfg)
{
}
else if (backend instanceof TaskBackendCfg)
{
}
else
{
}
final BackendDescriptor desc =
new BackendDescriptor(backend.getBackendId(), baseDNs, indexes, vlvIndexes, -1, backend.isEnabled(), type);
{
}
{
}
}
catch (final ConfigException ce)
{
}
}
}
{
boolean isReplicationSecure = false;
try
{
}
catch (final ConfigException ce)
{
}
return isReplicationSecure;
}
{
replicationPort = -1;
try
{
sync = (ReplicationSynchronizationProviderCfg) root.getSynchronizationProvider("Multimaster Synchronization");
}
catch (final ConfigException ce)
{
// Ignore this one
}
return sync;
}
{
try
{
{
if (replicationServer != null)
{
}
}
{
{
{
{
{
}
}
}
}
}
}
catch (final ConfigException ce)
{
}
}
private void readAlternateBindDNs(final Set<DN> dns, final RootCfg root, final List<OpenDsException> errors)
{
try
{
{
{
}
}
}
catch (final ConfigException ce)
{
}
}
{
}
private ConnectionHandlerDescriptor getConnectionHandler(final ConnectionHandlerCfg connHandler, final String name)
throws OpenDsException
{
int port;
if (connHandler instanceof LDAPConnectionHandlerCfg)
{
{
}
else if (ldap.isAllowStartTLS())
{
}
else
{
}
}
else if (connHandler instanceof HTTPConnectionHandlerCfg)
{
{
}
else
{
}
}
else if (connHandler instanceof JMXConnectionHandlerCfg)
{
{
}
else
{
}
}
else if (connHandler instanceof LDIFConnectionHandlerCfg)
{
port = -1;
}
else if (connHandler instanceof SNMPConnectionHandlerCfg)
{
}
else
{
port = -1;
}
}
{
{
}
}
private ConnectionHandlerDescriptor getConnectionHandler(final AdministrationConnectorCfg adminConnector)
throws OpenDsException
{
final ConnectionHandlerDescriptor.Protocol protocol = ConnectionHandlerDescriptor.Protocol.ADMINISTRATION_CONNECTOR;
}
}