public class ControlPanelInfo extends Object
Modifier | Constructor and Description |
---|---|
protected |
ControlPanelInfo()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBackendPopulatedListener(BackendPopulatedListener listener)
Adds a backend populated listener.
|
void |
addBackupCreatedListener(BackupCreatedListener listener)
Adds a backup creation listener.
|
void |
addConfigChangeListener(ConfigChangeListener listener)
Adds a configuration change listener.
|
void |
addIndexModifiedListener(IndexModifiedListener listener)
Adds an index modification listener.
|
void |
backendPopulated(Set<BackendDescriptor> backends)
Informs that a set of backends have been populated.
|
void |
backupCreated(BackupDescriptor newBackup)
Informs that a backup has been created.
|
boolean |
connectUsingLDAPS()
Tells whether we must connect to the server using LDAPS.
|
boolean |
connectUsingStartTLS()
Tells whether we must connect to the server using Start TLS.
|
protected ConfigFromDirContext |
createNewConfigFromDirContextReader()
Returns a reader that will read the configuration from a dir context.
|
protected ConfigFromFile |
createNewConfigFromFileReader()
Returns a reader that will read the configuration from a file.
|
protected ServerDescriptor |
createNewServerDescriptorInstance()
Returns an empty new server descriptor instance.
|
String |
getAdminConnectorURL()
Gets the Administration Connector URL based in what is read in the
configuration.
|
ConnectionProtocolPolicy |
getConnectionPolicy()
Returns the connection policy to be used by this ControlPanelInfo (and in
general by the control panel).
|
LDAPConnectionPool |
getConnectionPool()
Returns the connection pool to be used by the LDAP entry browsers.
|
int |
getConnectTimeout()
Returns the timeout to establish the connection in milliseconds.
|
InitialLdapContext |
getDirContext()
Returns the dir context to be used by the ControlPanelInfo to retrieve
monitoring and configuration information.
|
IconPool |
getIconPool()
Returns the icon pool to be used by the LDAP entry browsers.
|
static ControlPanelInfo |
getInstance()
Returns a singleton for this instance.
|
String |
getLDAPSURL()
Gets the LDAPS URL based in what is read in the configuration.
|
String |
getLDAPURL()
Gets the LDAP URL based in what is read in the configuration.
|
String |
getLocalAdminConnectorURL()
Gets the Administration Connector URL based in what is read in the local
configuration.
|
Collection<AbstractIndexDescriptor> |
getModifiedIndexes()
Returns a collection with all the modified indexes.
|
long |
getPoolingPeriod()
Returns the pooling period in miliseconds.
|
ServerDescriptor |
getServerDescriptor()
Returns the last ServerDescriptor that has been retrieved.
|
String |
getStartTLSURL()
Gets the Start TLS URL based in what is read in the configuration.
|
Set<Task> |
getTasks()
Returns the list of tasks.
|
ApplicationTrustManager |
getTrustManager()
Returns the trust manager to be used by this ControlPanelInfo (and in
general by the control panel).
|
String |
getURLToConnect()
Returns the URL that must be used to connect to the server based on the
available enabled connection handlers in the server and the connection
policy.
|
InitialLdapContext |
getUserDataDirContext()
Returns the dir context to be used by the ControlPanelInfo to retrieve
user data.
|
void |
indexModified(AbstractIndexDescriptor modifiedIndex)
Informs that an index has been modified.
|
void |
initializeConfigurationFramework()
Initialize the new configuration framework if needed.
|
boolean |
isLocal()
Returns
true if we are trying to manage the local host and
false otherwise. |
boolean |
mustDeregisterConfig()
Returns
true if the configuration must be deregistered and
false otherwise. |
boolean |
mustReindex(AbstractIndexDescriptor index)
Tells whether an index must be reindexed or not.
|
void |
regenerateDescriptor()
Regenerates the last found ServerDescriptor object.
|
void |
registerModifiedIndex(AbstractIndexDescriptor index)
Registers an index as modified.
|
void |
registerTask(Task task)
Registers a task.
|
boolean |
removeBackendPopulatedListener(BackendPopulatedListener listener)
Removes a backend populated listener.
|
boolean |
removeBackupCreatedListener(BackupCreatedListener listener)
Removes a backup creation listener.
|
boolean |
removeConfigChangeListener(ConfigChangeListener listener)
Removes a configuration change listener.
|
boolean |
removeIndexModifiedListener(IndexModifiedListener listener)
Removes an index modification listener.
|
void |
setConnectionPolicy(ConnectionProtocolPolicy connectionPolicy)
Sets the connection policy to be used by this ControlPanelInfo (and in
general by the control panel).
|
void |
setConnectTimeout(int connectTimeout)
Sets the timeout to establish the connection in milliseconds.
|
void |
setDirContext(InitialLdapContext ctx)
Sets the dir context to be used by the ControlPanelInfo to retrieve
monitoring and configuration information.
|
void |
setIsLocal(boolean isLocal)
Sets whether the server is local or not.
|
void |
setMustDeregisterConfig(boolean mustDeregisterConfig)
Sets whether the configuration must be deregistered or not.
|
void |
setPoolingPeriod(long poolingPeriod)
Sets the pooling period in miliseconds.
|
void |
setTrustManager(ApplicationTrustManager trustManager)
Sets the trust manager to be used by this ControlPanelInfo (and in
general by the control panel).
|
void |
setUserDataDirContext(InitialLdapContext ctx)
Sets the dir context to be used by the ControlPanelInfo to retrieve
user data.
|
void |
startPooling()
Starts pooling the server configuration.
|
void |
stopPooling()
Stops pooling the server.
|
boolean |
unregisterModifiedIndex(AbstractIndexDescriptor index)
Unregisters a modified index.
|
void |
unregisterModifiedIndexesInBackend(String backendName)
Unregisters all the modified indexes on a given backend.
|
void |
unregisterTask(Task task)
Unregisters a task.
|
protected void |
updateServerDescriptor(ConfigReader reader,
ServerDescriptor desc)
Updates the contents of the server descriptor with the provider reader.
|
protected ControlPanelInfo()
public static ControlPanelInfo getInstance()
public ServerDescriptor getServerDescriptor()
public void registerTask(Task task)
task
- the task to be registered.public void unregisterTask(Task task)
task
- the task to be unregistered.public boolean mustReindex(AbstractIndexDescriptor index)
index
- the index.true
if the index must be reindexed and
false
otherwise.public void registerModifiedIndex(AbstractIndexDescriptor index)
index
- the index.public boolean unregisterModifiedIndex(AbstractIndexDescriptor index)
index
- the index.true
if the index is found in the list of modified
indexes and false
otherwise.public void unregisterModifiedIndexesInBackend(String backendName)
backendName
- the name of the backend.public Collection<AbstractIndexDescriptor> getModifiedIndexes()
public void setDirContext(InitialLdapContext ctx)
ctx
- the connection.public InitialLdapContext getDirContext()
public void setUserDataDirContext(InitialLdapContext ctx) throws NamingException
ctx
- the connection.NamingException
- if there is a problem updating the connection pool.public InitialLdapContext getUserDataDirContext()
public void backupCreated(BackupDescriptor newBackup)
newBackup
- the new created backup.public void backendPopulated(Set<BackendDescriptor> backends)
backends
- the populated backends.public void indexModified(AbstractIndexDescriptor modifiedIndex)
modifiedIndex
- the modified index.protected ServerDescriptor createNewServerDescriptorInstance()
protected ConfigFromFile createNewConfigFromFileReader()
protected ConfigFromDirContext createNewConfigFromDirContextReader()
protected void updateServerDescriptor(ConfigReader reader, ServerDescriptor desc)
reader
- the configuration reader.desc
- the server descriptor.public void regenerateDescriptor()
public void addConfigChangeListener(ConfigChangeListener listener)
listener
- the listener.public boolean removeConfigChangeListener(ConfigChangeListener listener)
listener
- the listener.true
if the listener is found and false
otherwise.public void addBackupCreatedListener(BackupCreatedListener listener)
listener
- the listener.public boolean removeBackupCreatedListener(BackupCreatedListener listener)
listener
- the listener.true
if the listener is found and false
otherwise.public void addBackendPopulatedListener(BackendPopulatedListener listener)
listener
- the listener.public boolean removeBackendPopulatedListener(BackendPopulatedListener listener)
listener
- the listener.true
if the listener is found and false
otherwise.public void addIndexModifiedListener(IndexModifiedListener listener)
listener
- the listener.public boolean removeIndexModifiedListener(IndexModifiedListener listener)
listener
- the listener.true
if the listener is found and false
otherwise.public void startPooling()
public void stopPooling()
public ApplicationTrustManager getTrustManager()
public void setTrustManager(ApplicationTrustManager trustManager)
trustManager
- the trust manager to be used by this ControlPanelInfo.public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
0
to express no timeout.connectTimeout
- the timeout to establish the connection in
milliseconds.
Use 0
to express no timeout.public ConnectionProtocolPolicy getConnectionPolicy()
public void setConnectionPolicy(ConnectionProtocolPolicy connectionPolicy)
connectionPolicy
- the connection policy to be used by this
ControlPanelInfo.public String getLDAPSURL()
null
if no LDAPS URL was found.public String getAdminConnectorURL()
null
if no Administration
Connector URL was found.public String getLocalAdminConnectorURL()
null
if no Administration
Connector URL was found.public String getLDAPURL()
null
if no LDAP URL was found.public String getStartTLSURL()
null
if no Start TLS URL is found.public boolean connectUsingStartTLS()
true
if we must connect to the server using Start TLS
and false
otherwise.public boolean connectUsingLDAPS()
true
if we must connect to the server using LDAPS
and false
otherwise.public String getURLToConnect()
public boolean mustDeregisterConfig()
true
if the configuration must be deregistered and
false
otherwise.
This is required when we use the ConfigFileHandler to update the
configuration, in these cases cn=config must the deregistered from the
ConfigFileHandler and after that register again.true
if the configuration must be deregistered and
false
otherwise.public void setMustDeregisterConfig(boolean mustDeregisterConfig)
mustDeregisterConfig
- whether the configuration must be deregistered
or not.public void setIsLocal(boolean isLocal)
isLocal
- whether the server is local or not.public boolean isLocal()
true
if we are trying to manage the local host and
false
otherwise.true
if we are trying to manage the local host and
false
otherwise.public LDAPConnectionPool getConnectionPool()
public IconPool getIconPool()
public long getPoolingPeriod()
public void setPoolingPeriod(long poolingPeriod)
poolingPeriod
- the pooling time in miliseconds.public void initializeConfigurationFramework() throws ConfigException
ConfigException
- If error occurred during the initializationCopyright © 2010-2016 ForgeRock AS. All Rights Reserved.