ControlPanelInfo.java revision 82d394e493e7a22528477b2aa47467140a0d5929
* 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. /** Used by the browsers. */ /** Default constructor. */ * Returns a singleton for this instance. * @return the control panel info. * Returns the last ServerDescriptor that has been retrieved. * @return the last ServerDescriptor that has been retrieved. * Returns the list of tasks. * @return the list of tasks. * Registers a task. The Control Panel creates a task every time an operation * is made and they are stored here. * @param task the task to be registered. * @param task the task to be unregistered. * Tells whether an index must be reindexed or not. * @param index the index. * @return <CODE>true</CODE> if the index must be reindexed and * <CODE>false</CODE> otherwise. * 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. * @param index the index. * Unregisters a modified index. * @param index the index. * @return <CODE>true</CODE> if the index is found in the list of modified * indexes and <CODE>false</CODE> otherwise. // We might have stored indexes whose configuration has changed, just remove // them if they have the same name, are of the same type and are defined in * Unregisters all the modified indexes on a given backend. * @param backendName the name of the backend. // Compare only the Backend ID, since the backend object attached to // the registered index might have changed (for instance the number of // entries). Relying on the backend ID to identify the backend is * Returns a collection with all the modified indexes. * @return a collection with all the modified indexes. * Sets the dir context to be used by the ControlPanelInfo to retrieve * monitoring and configuration information. * @param ctx the connection. * Returns the dir context to be used by the ControlPanelInfo to retrieve * monitoring and configuration information. * @return the dir context to be used by the ControlPanelInfo to retrieve * monitoring and configuration information. * Sets the dir context to be used by the ControlPanelInfo to retrieve * @param ctx the connection. * @throws NamingException if there is a problem updating the connection pool. * Returns the dir context to be used by the ControlPanelInfo to retrieve * @return the dir context to be used by the ControlPanelInfo to retrieve * Informs that a backup has been created. The method will notify to all * the backup listeners that a backup has been created. * @param newBackup the new created backup. * Informs that a set of backends have been populated. The method will notify * to all the backend populated listeners. * @param backends the populated backends. * Informs that an index has been modified. The method will notify to all * the index listeners that an index has been modified. * @param modifiedIndex the modified index. * Returns an empty new server descriptor instance. * @return an empty new server descriptor instance. * Returns a reader that will read the configuration from a file. * @return a reader that will read the configuration from a file. * Returns a reader that will read the configuration from a dir context. * @return a reader that will read the configuration from a dir context. * Updates the contents of the server descriptor with the provider reader. * @param reader the configuration reader. * @param desc the server descriptor. /** Regenerates the last found ServerDescriptor object. */ // Try with previous credentials. // Ignore: we will ask the user for credentials. // Try with off-line info * Adds a configuration change listener. * @param listener the listener. * Removes a configuration change listener. * @param listener the listener. * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> * Adds a backup creation listener. * @param listener the listener. * Removes a backup creation listener. * @param listener the listener. * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> * Adds a backend populated listener. * @param listener the listener. * Removes a backend populated listener. * @param listener the listener. * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> * Adds an index modification listener. * @param listener the listener. * Removes an index modification listener. * @param listener the listener. * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> * 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. * Stops pooling the server. This method is synchronous, it does not return * until the pooling is actually stopped. * Returns the trust manager to be used by this ControlPanelInfo (and in * general by the control panel). * @return the trust manager to be used by this ControlPanelInfo. * Sets the trust manager to be used by this ControlPanelInfo (and in * general by the control panel). * @param trustManager the trust manager to be used by this ControlPanelInfo. * Returns the timeout to establish the connection in milliseconds. * @return the timeout to establish the connection in milliseconds. * Sets the timeout to establish the connection in milliseconds. * Use {@code 0} to express no timeout. * @param connectTimeout the timeout to establish the connection in * Use {@code 0} to express no timeout. * Returns the connection policy to be used by this ControlPanelInfo (and in * general by the control panel). * @return the connection policy to be used by this ControlPanelInfo. * Sets the connection policy to be used by this ControlPanelInfo (and in * general by the control panel). * @param connectionPolicy the connection policy to be used by this * Gets the LDAPS URL based in what is read in the configuration. It * returns <CODE>null</CODE> if no LDAPS URL was found. * @return the LDAPS URL to be used to connect to the server. * Gets the Administration Connector URL based in what is read in the * configuration. It returns <CODE>null</CODE> if no Administration * Connector URL was found. * @return the Administration Connector URL to be used to connect // If the user set isLocal to true, we want to return the // localAdminConnectorURL (in particular if regenerateDescriptor has not * Gets the Administration Connector URL based in what is read in the local * configuration. It returns <CODE>null</CODE> if no Administration * Connector URL was found. * @return the Administration Connector URL to be used to connect * Gets the LDAP URL based in what is read in the configuration. It * returns <CODE>null</CODE> if no LDAP URL was found. * @return the LDAP URL to be used to connect to the server. * Gets the Start TLS URL based in what is read in the configuration. It * returns <CODE>null</CODE> if no Start TLS URL is found. * @return the Start TLS URL to be used to connect to the server. * Returns the LDAP URL to be used to connect to a given ServerDescriptor * using a certain protocol. It returns <CODE>null</CODE> if URL for the * @param server the server descriptor. * @param protocol the protocol to be used. * @return the LDAP URL to be used to connect to a given ServerDescriptor * using a certain protocol. * Returns the Administration Connector URL. * It returns <CODE>null</CODE> if URL for the * @param server the server descriptor. * @return the Administration Connector URL. * Tells whether we must connect to the server using Start TLS. * @return <CODE>true</CODE> if we must connect to the server using Start TLS * and <CODE>false</CODE> otherwise. * Tells whether we must connect to the server using LDAPS. * @return <CODE>true</CODE> if we must connect to the server using LDAPS * and <CODE>false</CODE> otherwise. * 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 * @return the URL that must be used to connect to the server. * Returns <CODE>true</CODE> if the configuration must be deregistered and * <CODE>false</CODE> 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. * @return <CODE>true</CODE> if the configuration must be deregistered and * <CODE>false</CODE> otherwise. * Sets whether the configuration must be deregistered or not. * @param mustDeregisterConfig whether the configuration must be deregistered * Sets whether the server is local or not. * @param isLocal whether the server is local or not. * Returns <CODE>true</CODE> if we are trying to manage the local host and * <CODE>false</CODE> otherwise. * @return <CODE>true</CODE> if we are trying to manage the local host and * <CODE>false</CODE> otherwise. * Returns the connection pool to be used by the LDAP entry browsers. * @return the connection pool to be used by the LDAP entry browsers. * Returns the icon pool to be used by the LDAP entry browsers. * @return the icon pool to be used by the LDAP entry browsers. * Returns the pooling period in miliseconds. * @return the pooling period in miliseconds. * Sets the pooling period in miliseconds. * @param poolingPeriod the pooling time in miliseconds. /** Cleans the tasks that are over. */ * Returns whether the provided task is running on the provided server or not. * The code takes into account that the server object might not be fully * initialized (but at least it contains the host name and the instance * @param server the server. * @param task the task to be analyzed. * @return <CODE>true</CODE> if the provided task is running on the provided * server and <CODE>false</CODE> otherwise. // At this point we only have connection information about the new server. // Use the dir context which corresponds to the server to compare things. // Compare administration port; * Initialize the new configuration framework if needed. * @throws org.opends.server.config.ConfigException * If error occurred during the initialization