Class 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 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.
      • getTasks

        public Set<Task> getTasks()
        Returns the list of tasks.
        Returns:
        the list of tasks.
      • 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:
        true if the index must be reindexed, false otherwise.
      • 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:
        true if the index is found in the list of modified indexes, false otherwise.
      • 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:
        true if the listener is found, false otherwise.
      • 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:
        true if the listener is found, false otherwise.
      • 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:
        true if the listener is found, false otherwise.
      • 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:
        true if the listener is found, false otherwise.
      • 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. Use 0 to express no timeout.
        Parameters:
        connectTimeout - the timeout to establish the connection in milliseconds. Use 0 to 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 returns null if 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 returns null if 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 returns null if 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 returns null if 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 returns null if 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:
        true if we must connect to the server using Start TLS and false otherwise.
      • connectUsingLDAPS

        public boolean connectUsingLDAPS()
        Tells whether we must connect to the server using LDAPS.
        Returns:
        true if we must connect to the server using LDAPS, false otherwise.
      • mustDeregisterConfig

        public boolean mustDeregisterConfig()
        Returns true if the configuration must be deregistered and false otherwise. This is required when we update the configuration, in these cases cn=config must the deregistered and after that register again.
        Returns:
        true if the configuration must be deregistered and false otherwise.
      • 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:
        true if we are trying to manage the local host, false otherwise.
      • 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 ConfigException
        Initialize the new configuration framework if needed.
        Throws:
        ConfigException - If error occurred during the initialization