Class ControlPanelInfo
- java.lang.Object
-
- org.opends.guitools.controlpanel.datamodel.ControlPanelInfo
-
public class ControlPanelInfo extends Object
This is the classes that is shared among all the different places in the Control Panel. It contains information about the server status and configuration and some objects that are shared everywhere.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBackendPopulatedListener(BackendPopulatedListener listener)Adds a backend populated listener.voidaddBackupCreatedListener(BackupCreatedListener listener)Adds a backup creation listener.voidaddConfigChangeListener(ConfigChangeListener listener)Adds a configuration change listener.voidaddIndexModifiedListener(IndexModifiedListener listener)Adds an index modification listener.voidbackendPopulated(Set<BackendDescriptor> backends)Informs that a set of backends have been populated.voidbackupCreated(BackupDescriptor newBackup)Informs that a backup has been created.booleanconnectUsingLDAPS()Tells whether we must connect to the server using LDAPS.booleanconnectUsingStartTLS()Tells whether we must connect to the server using Start TLS.HostPortgetAdminConnectorHostPort()Gets the Administration Connector HostPort based in what is read in the configuration.ConnectionWrappergetConnection()Returns the connection to be used by the ControlPanelInfo to retrieve monitoring and configuration information.ConnectionProtocolPolicygetConnectionPolicy()Returns the connection policy to be used by this ControlPanelInfo (and in general by the control panel).LDAPConnectionPoolgetConnectionPool()Returns the connection pool to be used by the LDAP entry browsers.intgetConnectTimeout()Returns the timeout to establish the connection in milliseconds.IconPoolgetIconPool()Returns the icon pool to be used by the LDAP entry browsers.static ControlPanelInfogetInstance()Returns a singleton for this instance.HostPortgetLdapHostPort()Gets the LDAP HostPort based in what is read in the configuration.HostPortgetLdapsHostPort()Gets the LDAPS HostPort based in what is read in the configuration.HostPortgetLocalAdminConnectorHostPort()Gets the Administration Connector HostPort based in what is read in the local configuration.Collection<AbstractIndexDescriptor>getModifiedIndexes()Returns a collection with all the modified indexes.longgetPoolingPeriod()Returns the pooling period in milliseconds.ServerDescriptorgetServerDescriptor()Returns the last ServerDescriptor that has been retrieved.HostPortgetStartTlsHostPort()Gets the Start TLS HostPort based in what is read in the configuration.Set<Task>getTasks()Returns the list of tasks.ApplicationTrustManagergetTrustManager()Returns the trust manager to be used by this ControlPanelInfo (and in general by the control panel).ConnectionWrappergetUserDataConnection()Returns the connection to be used by the ControlPanelInfo to retrieve user data.voidinitializeConfigurationFramework()Initialize the new configuration framework if needed.booleanisLocal()Returns whether we are trying to manage the local host.booleanmustDeregisterConfig()Returnstrueif the configuration must be deregistered andfalseotherwise.booleanmustReindex(AbstractIndexDescriptor index)Tells whether an index must be reindexed or not.voidregenerateDescriptor()Regenerates the last found ServerDescriptor object.voidregisterModifiedIndex(AbstractIndexDescriptor index)Registers an index as modified.voidregisterTask(Task task)Registers a task.booleanremoveBackendPopulatedListener(BackendPopulatedListener listener)Removes a backend populated listener.booleanremoveBackupCreatedListener(BackupCreatedListener listener)Removes a backup creation listener.booleanremoveConfigChangeListener(ConfigChangeListener listener)Removes a configuration change listener.booleanremoveIndexModifiedListener(IndexModifiedListener listener)Removes an index modification listener.voidsetConnection(ConnectionWrapper connWrapper)Sets the dir context to be used by the ControlPanelInfo to retrieve monitoring and configuration information.voidsetConnectionPolicy(ConnectionProtocolPolicy connectionPolicy)Sets the connection policy to be used by this ControlPanelInfo (and in general by the control panel).voidsetConnectTimeout(int connectTimeout)Sets the timeout to establish the connection in milliseconds.voidsetIsLocal(boolean isLocal)Sets whether the server is local or not.voidsetMustDeregisterConfig(boolean mustDeregisterConfig)Sets whether the configuration must be deregistered or not.voidsetPoolingPeriod(long poolingPeriod)Sets the pooling period in miliseconds.voidsetTrustManager(ApplicationTrustManager trustManager)Sets the trust manager to be used by this ControlPanelInfo (and in general by the control panel).voidsetUserDataConnection(ConnectionWrapper conn)Sets the connection to be used by the ControlPanelInfo to retrieve user data.voidstartPooling()Starts pooling the server configuration.voidstopPooling()Stops pooling the server.booleanunregisterModifiedIndex(AbstractIndexDescriptor index)Unregisters a modified index.voidunregisterModifiedIndexesInBackend(String backendName)Unregisters all the modified indexes on a given backend.
-
-
-
Method Detail
-
getInstance
public static ControlPanelInfo getInstance()
Returns a singleton for this instance.- Returns:
- the control panel info.
-
getServerDescriptor
public ServerDescriptor getServerDescriptor()
Returns the last ServerDescriptor that has been retrieved.- Returns:
- the last ServerDescriptor that has been retrieved.
-
registerTask
public void registerTask(Task task)
Registers a task. The Control Panel creates a task every time an operation is made and they are stored here.- Parameters:
task- the task to be registered.
-
mustReindex
public boolean mustReindex(AbstractIndexDescriptor index)
Tells whether an index must be reindexed or not.- Parameters:
index- the index.- Returns:
trueif the index must be reindexed,falseotherwise.
-
registerModifiedIndex
public void registerModifiedIndex(AbstractIndexDescriptor index)
Registers an index as modified. This is used by the panels to be able to inform the user that a rebuild of the index is required.- Parameters:
index- the index.
-
unregisterModifiedIndex
public boolean unregisterModifiedIndex(AbstractIndexDescriptor index)
Unregisters a modified index.- Parameters:
index- the index.- Returns:
trueif the index is found in the list of modified indexes,falseotherwise.
-
unregisterModifiedIndexesInBackend
public void unregisterModifiedIndexesInBackend(String backendName)
Unregisters all the modified indexes on a given backend.- Parameters:
backendName- the name of the backend.
-
getModifiedIndexes
public Collection<AbstractIndexDescriptor> getModifiedIndexes()
Returns a collection with all the modified indexes.- Returns:
- a collection with all the modified indexes.
-
setConnection
public void setConnection(ConnectionWrapper connWrapper)
Sets the dir context to be used by the ControlPanelInfo to retrieve monitoring and configuration information.- Parameters:
connWrapper- the connection.
-
getConnection
public ConnectionWrapper getConnection()
Returns the connection to be used by the ControlPanelInfo to retrieve monitoring and configuration information.- Returns:
- the connection to be used by the ControlPanelInfo to retrieve monitoring and configuration information.
-
setUserDataConnection
public void setUserDataConnection(ConnectionWrapper conn) throws LdapException
Sets the connection to be used by the ControlPanelInfo to retrieve user data.- Parameters:
conn- the connection.- Throws:
LdapException- if there is a problem updating the connection pool.
-
getUserDataConnection
public ConnectionWrapper getUserDataConnection()
Returns the connection to be used by the ControlPanelInfo to retrieve user data.- Returns:
- the connection to be used by the ControlPanelInfo to retrieve user data.
-
backupCreated
public void backupCreated(BackupDescriptor newBackup)
Informs that a backup has been created. The method will notify to all the backup listeners that a backup has been created.- Parameters:
newBackup- the new created backup.
-
backendPopulated
public void backendPopulated(Set<BackendDescriptor> backends)
Informs that a set of backends have been populated. The method will notify to all the backend populated listeners.- Parameters:
backends- the populated backends.
-
regenerateDescriptor
public void regenerateDescriptor()
Regenerates the last found ServerDescriptor object.
-
addConfigChangeListener
public void addConfigChangeListener(ConfigChangeListener listener)
Adds a configuration change listener.- Parameters:
listener- the listener.
-
removeConfigChangeListener
public boolean removeConfigChangeListener(ConfigChangeListener listener)
Removes a configuration change listener.- Parameters:
listener- the listener.- Returns:
trueif the listener is found,falseotherwise.
-
addBackupCreatedListener
public void addBackupCreatedListener(BackupCreatedListener listener)
Adds a backup creation listener.- Parameters:
listener- the listener.
-
removeBackupCreatedListener
public boolean removeBackupCreatedListener(BackupCreatedListener listener)
Removes a backup creation listener.- Parameters:
listener- the listener.- Returns:
trueif the listener is found,falseotherwise.
-
addBackendPopulatedListener
public void addBackendPopulatedListener(BackendPopulatedListener listener)
Adds a backend populated listener.- Parameters:
listener- the listener.
-
removeBackendPopulatedListener
public boolean removeBackendPopulatedListener(BackendPopulatedListener listener)
Removes a backend populated listener.- Parameters:
listener- the listener.- Returns:
trueif the listener is found,falseotherwise.
-
addIndexModifiedListener
public void addIndexModifiedListener(IndexModifiedListener listener)
Adds an index modification listener.- Parameters:
listener- the listener.
-
removeIndexModifiedListener
public boolean removeIndexModifiedListener(IndexModifiedListener listener)
Removes an index modification listener.- Parameters:
listener- the listener.- Returns:
trueif the listener is found,falseotherwise.
-
startPooling
public void startPooling()
Starts pooling the server configuration. The period of the pooling is specified as a parameter. This method is asynchronous and it will start the pooling in another thread.
-
stopPooling
public void stopPooling()
Stops pooling the server. This method is synchronous, it does not return until the pooling is actually stopped.
-
getTrustManager
public ApplicationTrustManager getTrustManager()
Returns the trust manager to be used by this ControlPanelInfo (and in general by the control panel).- Returns:
- the trust manager to be used by this ControlPanelInfo.
-
setTrustManager
public void setTrustManager(ApplicationTrustManager trustManager)
Sets the trust manager to be used by this ControlPanelInfo (and in general by the control panel).- Parameters:
trustManager- the trust manager to be used by this ControlPanelInfo.
-
getConnectTimeout
public int getConnectTimeout()
Returns the timeout to establish the connection in milliseconds.- Returns:
- the timeout to establish the connection in milliseconds.
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
Sets the timeout to establish the connection in milliseconds. Use0to express no timeout.- Parameters:
connectTimeout- the timeout to establish the connection in milliseconds. Use0to express no timeout.
-
getConnectionPolicy
public ConnectionProtocolPolicy getConnectionPolicy()
Returns the connection policy to be used by this ControlPanelInfo (and in general by the control panel).- Returns:
- the connection policy to be used by this ControlPanelInfo.
-
setConnectionPolicy
public void setConnectionPolicy(ConnectionProtocolPolicy connectionPolicy)
Sets the connection policy to be used by this ControlPanelInfo (and in general by the control panel).- Parameters:
connectionPolicy- the connection policy to be used by this ControlPanelInfo.
-
getLdapsHostPort
public HostPort getLdapsHostPort()
Gets the LDAPS HostPort based in what is read in the configuration. It returnsnullif no LDAPS HostPort was found.- Returns:
- the LDAPS HostPort to be used to connect to the server.
-
getAdminConnectorHostPort
public HostPort getAdminConnectorHostPort()
Gets the Administration Connector HostPort based in what is read in the configuration. It returnsnullif no Administration Connector HostPort was found.- Returns:
- the Administration Connector HostPort to be used to connect to the server.
-
getLocalAdminConnectorHostPort
public HostPort getLocalAdminConnectorHostPort()
Gets the Administration Connector HostPort based in what is read in the local configuration. It returnsnullif no Administration Connector HostPort was found.- Returns:
- the Administration Connector HostPort to be used to connect to the local server.
-
getLdapHostPort
public HostPort getLdapHostPort()
Gets the LDAP HostPort based in what is read in the configuration. It returnsnullif no LDAP HostPort was found.- Returns:
- the LDAP HostPort to be used to connect to the server.
-
getStartTlsHostPort
public HostPort getStartTlsHostPort()
Gets the Start TLS HostPort based in what is read in the configuration. It returnsnullif no Start TLS HostPort is found.- Returns:
- the Start TLS HostPort to be used to connect to the server.
-
connectUsingStartTLS
public boolean connectUsingStartTLS()
Tells whether we must connect to the server using Start TLS.- Returns:
trueif we must connect to the server using Start TLS andfalseotherwise.
-
connectUsingLDAPS
public boolean connectUsingLDAPS()
Tells whether we must connect to the server using LDAPS.- Returns:
trueif we must connect to the server using LDAPS,falseotherwise.
-
mustDeregisterConfig
public boolean mustDeregisterConfig()
Returnstrueif the configuration must be deregistered andfalseotherwise. This is required when we update the configuration, in these casescn=configmust the deregistered and after that register again.- Returns:
trueif the configuration must be deregistered andfalseotherwise.
-
setMustDeregisterConfig
public void setMustDeregisterConfig(boolean mustDeregisterConfig)
Sets whether the configuration must be deregistered or not.- Parameters:
mustDeregisterConfig- whether the configuration must be deregistered or not.
-
setIsLocal
public void setIsLocal(boolean isLocal)
Sets whether the server is local or not.- Parameters:
isLocal- whether the server is local or not.
-
isLocal
public boolean isLocal()
Returns whether we are trying to manage the local host.- Returns:
trueif we are trying to manage the local host,falseotherwise.
-
getConnectionPool
public LDAPConnectionPool getConnectionPool()
Returns the connection pool to be used by the LDAP entry browsers.- Returns:
- the connection pool to be used by the LDAP entry browsers.
-
getIconPool
public IconPool getIconPool()
Returns the icon pool to be used by the LDAP entry browsers.- Returns:
- the icon pool to be used by the LDAP entry browsers.
-
getPoolingPeriod
public long getPoolingPeriod()
Returns the pooling period in milliseconds.- Returns:
- the pooling period in milliseconds.
-
setPoolingPeriod
public void setPoolingPeriod(long poolingPeriod)
Sets the pooling period in miliseconds.- Parameters:
poolingPeriod- the pooling time in miliseconds.
-
initializeConfigurationFramework
public void initializeConfigurationFramework() throws ConfigExceptionInitialize the new configuration framework if needed.- Throws:
ConfigException- If error occurred during the initialization
-
-