OPENDJ-3417 Fix functional tests failures
- Fix searching subordinates backends of the RootDSE
- Fix initialization of RestoreDB (missing crypto services initialization)
- Fix restart by ensuring RestartTaskThread is not a daemon thread
| | |
| | | case SINGLE_LEVEL: |
| | | case WHOLE_SUBTREE: |
| | | case SUBORDINATES: |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | ERR_ROOTDSE_NOT_SUPPORTED_SCOPE.get( |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | searchOperation.getScope())); |
| | | // nothing to return |
| | | break; |
| | | default: |
| | | LocalizableMessage message = ERR_ROOTDSE_INVALID_SEARCH_SCOPE. |
| | | get(searchOperation.getConnectionID(), |
| | |
| | | public Set<BackendAndName> getSubordinateBackends(DN baseDN) |
| | | { |
| | | final Set<BackendAndName> subs = new HashSet<>(); |
| | | if (baseDN.isRootDN()) |
| | | { |
| | | Map<DN, LocalBackend<?>> namingContexts = getAllPublicNamingContexts(); |
| | | for (Map.Entry<DN, LocalBackend<?>> b : namingContexts.entrySet()) |
| | | { |
| | | subs.add(new BackendAndName(b.getValue(), b.getKey())); |
| | | } |
| | | return subs; |
| | | } |
| | | |
| | | LocalBackend<?> backend = getLocalBackendWithBaseDN(baseDN); |
| | | if (backend == null) |
| | | { |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.api.DirectoryThread; |
| | | |
| | | /** |
| | | * This class defines a thread that will be spawned to invoke a Directory Server |
| | |
| | | * daemon thread. These changes are needed to guarantee that the JVM does not |
| | | * exit before we get a chance to restart it if all non-daemon threads go away. |
| | | */ |
| | | public class RestartTaskThread |
| | | extends DirectoryThread |
| | | public class RestartTaskThread extends Thread |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class. |
| | |
| | | // Since the process will not be killed, we can proceed exactly the same |
| | | // way with or without windows service configured. |
| | | RestartTaskThread restartThread = new RestartTaskThread(shutdownMessage); |
| | | restartThread.setDaemon(false); |
| | | restartThread.start(); |
| | | } |
| | | else |
| | |
| | | try |
| | | { |
| | | new DirectoryServer.InitializationBuilder(configFile.getValue()) |
| | | .requireCryptoServices() |
| | | .requireErrorAndDebugLogPublisher(out, err) |
| | | .initialize(); |
| | | } |
| | |
| | | |
| | | executeOperation(operation, backendAndName.getBackend()); |
| | | |
| | | if (!entryDN.isRootDN()) |
| | | // For subtree search operation we need to go through the subordinate nodes. |
| | | if (operation.getOperationType() == OperationType.SEARCH) |
| | | { |
| | | // For subtree search operation we need to go through the subordinate nodes. |
| | | if (operation.getOperationType() == OperationType.SEARCH) |
| | | { |
| | | executeSearchOnSubordinates((SearchOperation) operation, backendAndName.getBaseDn()); |
| | | } |
| | | executeSearchOnSubordinates((SearchOperation) operation, backendAndName.getBaseDn()); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |