| | |
| | | /** |
| | | * 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. |
| | | * @return {@code true} if the index must be reindexed, {@code false} otherwise. |
| | | */ |
| | | public boolean mustReindex(AbstractIndexDescriptor index) |
| | | { |
| | | boolean mustReindex = false; |
| | | for (AbstractIndexDescriptor i : modifiedIndexes) |
| | | { |
| | | if (i.getName().equals(index.getName()) && |
| | | i.getBackend().getBackendID().equals( |
| | | index.getBackend().getBackendID())) |
| | | { |
| | | mustReindex = true; |
| | | break; |
| | | return true; |
| | | } |
| | | } |
| | | return mustReindex; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 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. |
| | | * @return {@code true} if the index is found in the list of modified |
| | | * indexes, {@code false} otherwise. |
| | | */ |
| | | public boolean unregisterModifiedIndex(AbstractIndexDescriptor index) |
| | | { |
| | |
| | | { |
| | | // 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 |
| | | // safe. |
| | | // entries). Relying on the backend ID to identify the backend is safe. |
| | | if (index.getBackend().getBackendID().equalsIgnoreCase(backendName)) |
| | | { |
| | | toDelete.add(index); |
| | |
| | | desc.setIsLocal(isLocal); |
| | | if (isLocal) |
| | | { |
| | | desc.setOpenDSVersion(DynamicConstants.FULL_VERSION_STRING); |
| | | desc.setOpenDJVersion(DynamicConstants.FULL_VERSION_STRING); |
| | | String installPath = Utilities.getInstallPathFromClasspath(); |
| | | desc.setInstallPath(installPath); |
| | | desc.setInstancePath(Utils.getInstancePathFromInstallPath(installPath)); |
| | |
| | | desc.setJvmMemoryUsageMonitor(rCtx.getJvmMemoryUsage()); |
| | | desc.setSystemInformationMonitor(rCtx.getSystemInformation()); |
| | | desc.setWorkQueueMonitor(rCtx.getWorkQueue()); |
| | | desc.setOpenDSVersion(rCtx.getVersionMonitor().getAttribute("fullVersion").firstValueAsString()); |
| | | desc.setOpenDJVersion(rCtx.getVersionMonitor().getAttribute("fullVersion").firstValueAsString()); |
| | | String installPath = rCtx.getSystemInformation().getAttribute("installPath").firstValueAsString(); |
| | | if (installPath != null) |
| | | { |
| | |
| | | /** |
| | | * Removes a configuration change listener. |
| | | * @param listener the listener. |
| | | * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return {@code true} if the listener is found, {@code false} otherwise. |
| | | */ |
| | | public boolean removeConfigChangeListener(ConfigChangeListener listener) |
| | | { |
| | |
| | | /** |
| | | * Removes a backup creation listener. |
| | | * @param listener the listener. |
| | | * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return {@code true} if the listener is found, {@code false} otherwise. |
| | | */ |
| | | public boolean removeBackupCreatedListener(BackupCreatedListener listener) |
| | | { |
| | |
| | | /** |
| | | * Removes a backend populated listener. |
| | | * @param listener the listener. |
| | | * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return {@code true} if the listener is found, {@code false} otherwise. |
| | | */ |
| | | public boolean removeBackendPopulatedListener( |
| | | BackendPopulatedListener listener) |
| | |
| | | /** |
| | | * Removes an index modification listener. |
| | | * @param listener the listener. |
| | | * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return {@code true} if the listener is found, {@code false} otherwise. |
| | | */ |
| | | public boolean removeIndexModifiedListener(IndexModifiedListener listener) |
| | | { |
| | |
| | | |
| | | /** |
| | | * Gets the LDAPS URL based in what is read in the configuration. It |
| | | * returns <CODE>null</CODE> if no LDAPS URL was found. |
| | | * returns {@code null} if no LDAPS URL was found. |
| | | * @return the LDAPS URL to be used to connect to the server. |
| | | */ |
| | | public String getLDAPSURL() |
| | |
| | | |
| | | /** |
| | | * Gets the Administration Connector URL based in what is read in the |
| | | * configuration. It returns <CODE>null</CODE> if no Administration |
| | | * configuration. It returns {@code null} if no Administration |
| | | * Connector URL was found. |
| | | * @return the Administration Connector URL to be used to connect |
| | | * to the server. |
| | |
| | | { |
| | | if (isLocal) |
| | | { |
| | | // If the user set isLocal to true, we want to return the |
| | | // localAdminConnectorURL (in particular if regenerateDescriptor has not |
| | | // been called). |
| | | // If the user set isLocal to true, we want to return the localAdminConnectorURL |
| | | // (in particular if regenerateDescriptor has not been called). |
| | | return localAdminConnectorURL; |
| | | } |
| | | return adminConnectorURL; |
| | |
| | | |
| | | /** |
| | | * Gets the Administration Connector URL based in what is read in the local |
| | | * configuration. It returns <CODE>null</CODE> if no Administration |
| | | * configuration. It returns {@code null} if no Administration |
| | | * Connector URL was found. |
| | | * @return the Administration Connector URL to be used to connect |
| | | * to the local server. |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the LDAP URL based in what is read in the configuration. It |
| | | * returns <CODE>null</CODE> if no LDAP URL was found. |
| | | * Gets the LDAP URL based in what is read in the configuration. |
| | | * It returns {@code null} if no LDAP URL was found. |
| | | * @return the LDAP URL to be used to connect to the server. |
| | | */ |
| | | public String getLDAPURL() |
| | |
| | | |
| | | /** |
| | | * 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. |
| | | * returns {@code null} if no Start TLS URL is found. |
| | | * @return the Start TLS URL to be used to connect to the server. |
| | | */ |
| | | public String getStartTLSURL() |
| | |
| | | |
| | | /** |
| | | * 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 |
| | | * using a certain protocol. It returns {@code null} if URL for the |
| | | * protocol is not found. |
| | | * @param server the server descriptor. |
| | | * @param protocol the protocol to be used. |
| | |
| | | switch (protocol) |
| | | { |
| | | case LDAP: |
| | | case LDAP_STARTTLS: |
| | | return "ldap"; |
| | | case LDAPS: |
| | | return "ldaps"; |
| | | case LDAP_STARTTLS: |
| | | return "ldap"; |
| | | case JMX: |
| | | return "jmx"; |
| | | case JMXS: |
| | |
| | | |
| | | /** |
| | | * Returns the Administration Connector URL. |
| | | * It returns <CODE>null</CODE> if URL for the |
| | | * protocol is not found. |
| | | * It returns {@code null} if URL for the protocol is not found. |
| | | * @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. |
| | | * @return {@code true} if we must connect to the server using Start TLS |
| | | * and {@code false} otherwise. |
| | | */ |
| | | public boolean connectUsingStartTLS() |
| | | { |
| | |
| | | |
| | | /** |
| | | * 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. |
| | | * @return {@code true} if we must connect to the server using LDAPS, {@code false} otherwise. |
| | | */ |
| | | public boolean connectUsingLDAPS() |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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 whether we are trying to manage the local host. |
| | | * @return {@code true} if we are trying to manage the local host, |
| | | * {@code false} otherwise. |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the pooling period in miliseconds. |
| | | * @return the pooling period in miliseconds. |
| | | * Returns the pooling period in milliseconds. |
| | | * @return the pooling period in milliseconds. |
| | | */ |
| | | public long getPoolingPeriod() |
| | | { |
| | |
| | | * path if it is local). |
| | | * @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. |
| | | * @return {@code true} if the provided task is running on the provided server, |
| | | * {@code false} otherwise. |
| | | */ |
| | | private boolean isRunningOnServer(ServerDescriptor server, Task task) |
| | | { |