Class ConfigReader
- java.lang.Object
-
- org.opends.guitools.controlpanel.util.ConfigReader
-
- Direct Known Subclasses:
ConfigFromConnection,ConfigFromFile
public abstract class ConfigReader extends Object
An abstract class providing some common interface for the class that read the configuration (and if the server is running, the monitoring information).
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionHandlerDescriptoradminConnectorThe administration connector.protected Set<DN>administrativeUsersThe set of administrative users.protected Set<BackendDescriptor>backendsThe set of backend descriptors.static StringconfigFileThe configuration file full path (-INSTANCE_ROOT-/config/config.ldif).protected static OpenDsExceptionenvironmentSettingExceptionThe error that occurred when setting the environment (null if no error occurred).protected List<Exception>exceptionsThe exceptions that occurred reading the configuration.protected booleanisSchemaEnabledWhether the schema checking is enabled or not.protected StringjavaVersionThe java version used to run the server.protected Set<ConnectionHandlerDescriptor>listenersThe set of connection listeners.protected intnumberConnectionsThe number of connections opened on the server.protected intreplicationPortThe replication serve port (-1 if the replication server port is not defined).protected SchemaschemaThe schema used by the server.protected Set<TaskEntry>taskEntriesThe task entries.
-
Constructor Summary
Constructors Constructor Description ConfigReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionHandlerDescriptorgetAdminConnector()Returns the admin connector.Set<DN>getAdministrativeUsers()Returns the Administrative User DNs found in the config.ldif.Set<BackendDescriptor>getBackends()Returns the backend descriptors found in the config.ldif.Set<ConnectionHandlerDescriptor>getConnectionHandlers()Returns the listener descriptors found in the config.ldif.List<Exception>getExceptions()Returns the list of exceptions that were encountered reading the configuration.protected Comparator<InetAddress>getInetAddressComparator()Returns the comparator to be used to sort InetAddresses.StringgetJavaVersion()Returns the java version used to run the server.intgetOpenConnections()Returns the number of open connections on the serverintgetReplicationPort()Returns the replication server port. -1 if no replication server port is defined.SchemagetSchema()Returns the schema of the server.Set<TaskEntry>getTaskEntries()Returns the task entries.protected List<VLVSortOrder>getVLVSortOrder(String s)Method that transforms the VLV sort order value as it is defined in the schema to a list of VLVSortOrder objects.booleanisConfigRead()Returnstrueif the configuration has been read at least once andfalseotherwise.booleanisSchemaEnabled()Returnstrueif the schema check is enabled andfalseotherwise.protected booleanmustReadSchema()Returnstrueif the schema must be read andfalseotherwise.protected SchemareadSchema()Reads the schema from the files.
-
-
-
Field Detail
-
configFile
public static String configFile
The configuration file full path (-INSTANCE_ROOT-/config/config.ldif). of the installation of the control panel.
-
environmentSettingException
protected static OpenDsException environmentSettingException
The error that occurred when setting the environment (null if no error occurred).
-
exceptions
protected List<Exception> exceptions
The exceptions that occurred reading the configuration.
-
listeners
protected Set<ConnectionHandlerDescriptor> listeners
The set of connection listeners.
-
adminConnector
protected ConnectionHandlerDescriptor adminConnector
The administration connector.
-
backends
protected Set<BackendDescriptor> backends
The set of backend descriptors.
-
replicationPort
protected int replicationPort
The replication serve port (-1 if the replication server port is not defined).
-
javaVersion
protected String javaVersion
The java version used to run the server.
-
numberConnections
protected int numberConnections
The number of connections opened on the server.
-
isSchemaEnabled
protected boolean isSchemaEnabled
Whether the schema checking is enabled or not.
-
schema
protected Schema schema
The schema used by the server.
-
-
Method Detail
-
getAdministrativeUsers
public Set<DN> getAdministrativeUsers()
Returns the Administrative User DNs found in the config.ldif. The set must be unmodifiable (the inheriting classes must take care of this).- Returns:
- the Administrative User DNs found in the config.ldif.
-
getBackends
public Set<BackendDescriptor> getBackends()
Returns the backend descriptors found in the config.ldif. The set must be unmodifiable (the inheriting classes must take care of this).- Returns:
- the backend descriptors found in the config.ldif.
-
getConnectionHandlers
public Set<ConnectionHandlerDescriptor> getConnectionHandlers()
Returns the listener descriptors found in the config.ldif. The set must be unmodifiable (the inheriting classes must take care of this).- Returns:
- the listeners descriptors found in the config.ldif.
-
getAdminConnector
public ConnectionHandlerDescriptor getAdminConnector()
Returns the admin connector.- Returns:
- the admin connector.
-
getExceptions
public List<Exception> getExceptions()
Returns the list of exceptions that were encountered reading the configuration. The list must be unmodifiable (the inheriting classes must take care of this).- Returns:
- the list of exceptions that were encountered reading the configuration.
-
isConfigRead
public boolean isConfigRead()
Returnstrueif the configuration has been read at least once andfalseotherwise.- Returns:
trueif the configuration has been read at least once andfalseotherwise.
-
getReplicationPort
public int getReplicationPort()
Returns the replication server port. -1 if no replication server port is defined.- Returns:
- the replication server port. -1 if no replication server port is defined.
-
isSchemaEnabled
public boolean isSchemaEnabled()
Returnstrueif the schema check is enabled andfalseotherwise.- Returns:
trueif the schema check is enabled andfalseotherwise.
-
getJavaVersion
public String getJavaVersion()
Returns the java version used to run the server.nullif no java version is used (because the server is down).- Returns:
- the java version used to run the server.
nullif no java version is used (because the server is down).
-
getOpenConnections
public int getOpenConnections()
Returns the number of open connections on the server. -1 if the server is down.- Returns:
- the number of open connections on the server.
-
getSchema
public Schema getSchema()
Returns the schema of the server.- Returns:
- the schema of the server.
-
getTaskEntries
public Set<TaskEntry> getTaskEntries()
Returns the task entries.- Returns:
- the task entries.
-
readSchema
protected Schema readSchema() throws ConfigException, InitializationException, DirectoryException
Reads the schema from the files.- Returns:
- the schema
- Throws:
ConfigException- if an error occurs reading the schema.InitializationException- if an error occurs initializing configuration to read schema.DirectoryException- if there is an error registering the minimal objectclasses.
-
getVLVSortOrder
protected List<VLVSortOrder> getVLVSortOrder(String s)
Method that transforms the VLV sort order value as it is defined in the schema to a list of VLVSortOrder objects.- Parameters:
s- the string in the configuration.- Returns:
- a list of VLVSortOrder objects.
-
getInetAddressComparator
protected Comparator<InetAddress> getInetAddressComparator()
Returns the comparator to be used to sort InetAddresses.- Returns:
- the comparator to be used to sort InetAddresses.
-
mustReadSchema
protected boolean mustReadSchema()
Returnstrueif the schema must be read andfalseotherwise.- Returns:
trueif the schema must be read andfalseotherwise.
-
-