opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/GlobalConfiguration.xml
@@ -761,39 +761,6 @@ </ldap:attribute> </adm:profile> </adm:property> <adm:property name="workflow-configuration-mode" hidden="true"> <adm:synopsis> Specifies the workflow configuration mode (auto vs. manual). </adm:synopsis> <adm:default-behavior> <adm:defined> <adm:value>auto</adm:value> </adm:defined> </adm:default-behavior> <adm:syntax> <adm:enumeration> <adm:value name="auto"> <adm:synopsis> In the "auto" configuration mode, there is no workflow configuration. The workflows are created automatically based on the backend configuration. There is one workflow per backend base DN. </adm:synopsis> </adm:value> <adm:value name="manual"> <adm:synopsis> In the "manual" configuration mode, each workflow is created according to its description in the configuration. </adm:synopsis> </adm:value> </adm:enumeration> </adm:syntax> <adm:profile name="ldap"> <ldap:attribute> <ldap:name>ds-cfg-workflow-configuration-mode</ldap:name> </ldap:attribute> </adm:profile> </adm:property> <adm:property name="etime-resolution" mandatory="false"> <adm:synopsis> Specifies the resolution to use for operation elapsed processing time (etime) opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LocalBackendWorkflowElementConfiguration.xml
File was deleted opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/NetworkGroupConfiguration.xml
@@ -23,7 +23,7 @@ ! ! ! Copyright 2007-2009 Sun Microsystems, Inc. ! Portions copyright 2013 ForgeRock AS. ! Portions copyright 2013-2014 ForgeRock AS. ! --> <adm:managed-object name="network-group" plural-name="network-groups" @@ -108,36 +108,6 @@ </ldap:attribute> </adm:profile> </adm:property> <adm:property name="workflow" multi-valued="true"> <adm:synopsis> Specifies a set of workflows which should be accessible from this <adm:user-friendly-name/> . </adm:synopsis> <adm:default-behavior> <adm:alias> <adm:synopsis>No workflows will be accessible.</adm:synopsis> </adm:alias> </adm:default-behavior> <adm:syntax> <adm:aggregation relation-name="workflow" parent-path="/"> <adm:constraint> <adm:synopsis> The referenced workflows must be enabled. </adm:synopsis> <adm:target-is-enabled-condition> <adm:contains property="enabled" value="true"/> </adm:target-is-enabled-condition> </adm:constraint> </adm:aggregation> </adm:syntax> <adm:profile name="ldap"> <ldap:attribute> <ldap:name>ds-cfg-workflow</ldap:name> </ldap:attribute> </adm:profile> </adm:property> <adm:property name="allowed-auth-method" multi-valued="true"> <adm:synopsis> Specifies a set of allowed authorization methods that clients opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/RootConfiguration.xml
@@ -436,31 +436,6 @@ <cli:relation> <cli:default-property name="enabled" /> <cli:default-property name="priority" /> <cli:default-property name="workflow" /> </cli:relation> </adm:profile> </adm:relation> <adm:relation name="workflow" hidden="true"> <adm:one-to-many /> <adm:profile name="ldap"> <ldap:rdn-sequence>cn=Workflows,cn=config</ldap:rdn-sequence> </adm:profile> <adm:profile name="cli"> <cli:relation> <cli:default-property name="enabled" /> </cli:relation> </adm:profile> </adm:relation> <adm:relation name="workflow-element" hidden="true"> <adm:one-to-many /> <adm:profile name="ldap"> <ldap:rdn-sequence> cn=Workflow elements,cn=config </ldap:rdn-sequence> </adm:profile> <adm:profile name="cli"> <cli:relation> <cli:default-property name="enabled" /> </cli:relation> </adm:profile> </adm:relation> opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/WorkflowConfiguration.xml
File was deleted opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/WorkflowElementConfiguration.xml
File was deleted opendj3-server-dev/resource/config/config.ldif
@@ -2636,18 +2636,3 @@ objectClass: ds-cfg-branch cn: Extensions dn: cn=Network Groups,cn=config objectClass: top objectClass: ds-cfg-branch cn: Network Groups dn: cn=Workflows,cn=config objectClass: top objectClass: ds-cfg-branch cn: Workflows dn: cn=Workflow Elements,cn=config objectClass: top objectClass: ds-cfg-branch cn: Workflow Elements opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
@@ -767,39 +767,6 @@ </ldap:attribute> </adm:profile> </adm:property> <adm:property name="workflow-configuration-mode" hidden="true"> <adm:synopsis> Specifies the workflow configuration mode (auto vs. manual). </adm:synopsis> <adm:default-behavior> <adm:defined> <adm:value>auto</adm:value> </adm:defined> </adm:default-behavior> <adm:syntax> <adm:enumeration> <adm:value name="auto"> <adm:synopsis> In the "auto" configuration mode, there is no workflow configuration. The workflows are created automatically based on the backend configuration. There is one workflow per backend base DN. </adm:synopsis> </adm:value> <adm:value name="manual"> <adm:synopsis> In the "manual" configuration mode, each workflow is created according to its description in the configuration. </adm:synopsis> </adm:value> </adm:enumeration> </adm:syntax> <adm:profile name="ldap"> <ldap:attribute> <ldap:name>ds-cfg-workflow-configuration-mode</ldap:name> </ldap:attribute> </adm:profile> </adm:property> <adm:property name="etime-resolution" mandatory="false"> <adm:synopsis> Specifies the resolution to use for operation elapsed processing time (etime) opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/LocalBackendWorkflowElementConfiguration.xml
File was deleted opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml
@@ -23,7 +23,7 @@ ! ! ! Copyright 2007-2009 Sun Microsystems, Inc. ! Portions copyright 2013 ForgeRock AS. ! Portions copyright 2013-2014 ForgeRock AS. ! --> <adm:managed-object name="network-group" plural-name="network-groups" @@ -108,36 +108,6 @@ </ldap:attribute> </adm:profile> </adm:property> <adm:property name="workflow" multi-valued="true"> <adm:synopsis> Specifies a set of workflows which should be accessible from this <adm:user-friendly-name/> . </adm:synopsis> <adm:default-behavior> <adm:alias> <adm:synopsis>No workflows will be accessible.</adm:synopsis> </adm:alias> </adm:default-behavior> <adm:syntax> <adm:aggregation relation-name="workflow" parent-path="/"> <adm:constraint> <adm:synopsis> The referenced workflows must be enabled. </adm:synopsis> <adm:target-is-enabled-condition> <adm:contains property="enabled" value="true"/> </adm:target-is-enabled-condition> </adm:constraint> </adm:aggregation> </adm:syntax> <adm:profile name="ldap"> <ldap:attribute> <ldap:name>ds-cfg-workflow</ldap:name> </ldap:attribute> </adm:profile> </adm:property> <adm:property name="allowed-auth-method" multi-valued="true"> <adm:synopsis> Specifies a set of allowed authorization methods that clients opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
@@ -436,31 +436,6 @@ <cli:relation> <cli:default-property name="enabled" /> <cli:default-property name="priority" /> <cli:default-property name="workflow" /> </cli:relation> </adm:profile> </adm:relation> <adm:relation name="workflow" hidden="true"> <adm:one-to-many /> <adm:profile name="ldap"> <ldap:rdn-sequence>cn=Workflows,cn=config</ldap:rdn-sequence> </adm:profile> <adm:profile name="cli"> <cli:relation> <cli:default-property name="enabled" /> </cli:relation> </adm:profile> </adm:relation> <adm:relation name="workflow-element" hidden="true"> <adm:one-to-many /> <adm:profile name="ldap"> <ldap:rdn-sequence> cn=Workflow elements,cn=config </ldap:rdn-sequence> </adm:profile> <adm:profile name="cli"> <cli:relation> <cli:default-property name="enabled" /> </cli:relation> </adm:profile> </adm:relation> opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
File was deleted opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
File was deleted opendj3-server-dev/src/admin/messages/GlobalCfgDefn.properties
@@ -80,9 +80,6 @@ property.smtp-server.syntax.string.pattern.synopsis=A hostname, optionally followed by a ":" followed by a port number. property.time-limit.synopsis=Specifies the maximum length of time that should be spent processing a single search operation. property.time-limit.description=A value of 0 seconds indicates that no time limit is enforced. Note that this is the default server-wide time limit, but it may be overridden on a per-user basis using the ds-rlim-time-limit operational attribute. property.workflow-configuration-mode.synopsis=Specifies the workflow configuration mode (auto vs. manual). property.workflow-configuration-mode.syntax.enumeration.value.auto.synopsis=In the "auto" configuration mode, there is no workflow configuration. The workflows are created automatically based on the backend configuration. There is one workflow per backend base DN. property.workflow-configuration-mode.syntax.enumeration.value.manual.synopsis=In the "manual" configuration mode, each workflow is created according to its description in the configuration. property.writability-mode.synopsis=Specifies the kinds of write operations the directory server can process. property.writability-mode.syntax.enumeration.value.disabled.synopsis=The directory server rejects all write operations that are requested of it, regardless of their origin. property.writability-mode.syntax.enumeration.value.enabled.synopsis=The directory server attempts to process all write operations that are requested of it, regardless of their origin. opendj3-server-dev/src/admin/messages/NetworkGroupCfgDefn.properties
@@ -30,9 +30,6 @@ property.is-security-mandatory.requires-admin-action.synopsis=Changes to this property take effect immediately and do not interfere with connections that may have already been established. property.priority.synopsis=Specifies the priority for this Network Group. property.priority.description=A client connection is first compared against the Network Group with the lowest priority. If the client connection does not match its connection criteria, then the client connection is compared against the Network Group with next lowest priority, and so on. If no Network Group is selected then the client connection is rejected. property.workflow.synopsis=Specifies a set of workflows which should be accessible from this Network Group . property.workflow.default-behavior.alias.synopsis=No workflows will be accessible. property.workflow.syntax.aggregation.constraint-synopsis=The referenced workflows must be enabled. relation.network-group-qos-policy.user-friendly-name=Network Group QOS Policy relation.network-group-qos-policy.user-friendly-plural-name=Network Group QOS Policies relation.network-group-qos-policy.synopsis=Specifies the set of quality of service (QoS) policies enforced by the QOS Policy . opendj3-server-dev/src/admin/messages/RootCfgDefn.properties
@@ -119,13 +119,6 @@ relation.virtual-attribute.user-friendly-plural-name=Virtual Attributes relation.virtual-attribute.synopsis=Virtual Attributes are responsible for dynamically generating attribute values that appear in entries but are not persistently stored in the backend. relation.virtual-attribute.description=Virtual attributes are associated with a virtual attribute provider, which contains the logic for generating the value. relation.workflow.user-friendly-name=Workflow relation.workflow.user-friendly-plural-name=Workflows relation.workflow.synopsis=The Workflow is a list of processing steps (Work Flow Elements) that are applied to data as it is retrieved from the directory server. relation.workflow-element.user-friendly-name=Workflow Element relation.workflow-element.user-friendly-plural-name=Workflow Elements relation.workflow-element.synopsis=Workflow Elements implement a single processing step in a Work Flow. relation.workflow-element.description=A Workflow Element can perform a task such as mapping DNs, renaming attributes, filtering attributes, joining data sources, proxying, or load-balancing. The simplest Workflow Element is the Local Backend Work Flow Element, which routes data to a Backend. relation.work-queue.user-friendly-name=Work Queue relation.work-queue.synopsis=The Work Queue provides the configuration for the server work queue and is responsible for ensuring that requests received from clients are processed in a timely manner. relation.work-queue.description=Only a single work queue can be defined in the server. Whenever a connection handler receives a client request, it should place the request in the work queue to be processed appropriately. opendj3-server-dev/src/server/org/opends/server/core/CoreConfigManager.java
@@ -34,7 +34,6 @@ import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.server.ServerManagementContext; import org.opends.server.admin.std.meta.GlobalCfgDefn; import org.opends.server.admin.std.meta.GlobalCfgDefn.WorkflowConfigurationMode; import org.opends.server.admin.std.meta.GlobalCfgDefn.DisabledPrivilege; import org.opends.server.admin.std.meta.GlobalCfgDefn.InvalidAttributeSyntaxBehavior; import org.opends.server.admin.std.meta.GlobalCfgDefn.SingleStructuralObjectclassBehavior; @@ -153,24 +152,6 @@ setIdleTimeLimit(globalConfig.getIdleTimeLimit()); setSaveConfigOnSuccessfulStartup(globalConfig.isSaveConfigOnSuccessfulStartup()); // If the workflow configuration mode has changed then reconfigure // the workflows-only if the server is running. If the server is not // running (ie. the server is starting up) simply update the workflow // configuration mode as the workflow configuration is processed // elsewhere. WorkflowConfigurationMode oldMode = DirectoryServer.getWorkflowConfigurationMode(); WorkflowConfigurationMode newMode = globalConfig.getWorkflowConfigurationMode(); if (DirectoryServer.isRunning()) { DirectoryServer.reconfigureWorkflows(oldMode, newMode); } else { DirectoryServer.setWorkflowConfigurationMode(newMode); } setUseNanoTime(globalConfig.getEtimeResolution() == GlobalCfgDefn.EtimeResolution.NANOSECONDS); setMaxAllowedConnections(globalConfig.getMaxAllowedClientConnections()); setMaxPersistentSearchLimit(globalConfig.getMaxPsearches()); opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java
@@ -68,7 +68,6 @@ import org.opends.server.admin.AdministrationDataSync; import org.opends.server.admin.ClassLoaderProvider; import org.opends.server.admin.server.ServerManagementContext; import org.opends.server.admin.std.meta.GlobalCfgDefn.WorkflowConfigurationMode; import org.opends.server.admin.std.server.AlertHandlerCfg; import org.opends.server.admin.std.server.AttributeSyntaxCfg; import org.opends.server.admin.std.server.ConnectionHandlerCfg; @@ -128,7 +127,6 @@ import org.opends.server.controls.PasswordPolicyErrorType; import org.opends.server.controls.PasswordPolicyResponseControl; import org.opends.server.core.networkgroups.NetworkGroup; import org.opends.server.core.networkgroups.NetworkGroupConfigManager; import org.opends.server.crypto.CryptoManagerImpl; import org.opends.server.crypto.CryptoManagerSync; import org.opends.server.extensions.ConfigFileHandler; @@ -213,8 +211,6 @@ import org.opends.server.util.SetupUtils; import org.opends.server.util.TimeThread; import org.opends.server.util.VersionCompatibilityIssue; import org.opends.server.workflowelement.WorkflowElement; import org.opends.server.workflowelement.WorkflowElementConfigManager; import org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement; import com.forgerock.opendj.cli.ArgumentConstants; @@ -227,7 +223,6 @@ import com.forgerock.opendj.util.OperatingSystem; import static org.forgerock.util.Reject.*; import static org.opends.messages.ConfigMessages.*; import static org.opends.messages.CoreMessages.*; import static org.opends.messages.ToolMessages.*; import static org.opends.server.config.ConfigConstants.*; @@ -840,34 +835,6 @@ private WritabilityMode writabilityMode; /** * The mappings between the names and WorkflowElements registered with the * Directory Server. */ private final ConcurrentMap<String, WorkflowElement> workflowElements = new ConcurrentHashMap<String, WorkflowElement>(); /** The workflow configuration mode (auto or manual). */ private WorkflowConfigurationMode workflowConfigurationMode; /** * The network group config manager for the Directory Server. This config * manager is used when the workflow configuration mode is 'manual'. */ private NetworkGroupConfigManager networkGroupConfigManager; /** * The workflow config manager for the Directory Server. This config manager * is used when the workflow configuration mode is 'manual'. */ private WorkflowConfigManager workflowConfigManager; /** * The workflow element config manager for the Directory Server. This config * manager is used when the workflow configuration mode is 'manual'. */ private WorkflowElementConfigManager workflowElementConfigManager; /** * The maximum size that internal buffers will be allowed to grow to until * they are trimmed. */ @@ -1591,17 +1558,8 @@ // and initialize the workflows when workflow configuration mode is auto. initializeBackends(); // When workflow configuration mode is manual, do configure the // workflows now, else just configure the remaining workflows // (rootDSE and config backend). if (workflowConfigurationModeIsAuto()) { // configure the remaining workflows (rootDSE and config backend). createAndRegisterRemainingWorkflows(); } else { configureWorkflowsManual(); } // Check for and initialize user configured entry cache if any. // If not then stick with default entry cache initialized earlier. @@ -2216,16 +2174,13 @@ * * @param baseDN the DN of the workflow to deregister */ private static void deregisterWorkflowWithInternalNetworkGroup( DN baseDN ) private static void deregisterWorkflowWithInternalNetworkGroup(DN baseDN) { // Get the internal network group and deregister all the workflows // being configured for the backend (there is one workflow per // backend base DN). NetworkGroup internalNetworkGroup = NetworkGroup.getInternalNetworkGroup(); Workflow workflow = internalNetworkGroup.deregisterWorkflow(baseDN); WorkflowImpl workflowImpl = (WorkflowImpl) workflow; WorkflowImpl workflowImpl = (WorkflowImpl) internalNetworkGroup.deregisterWorkflow(baseDN); workflowImpl.deregister(); } @@ -2241,23 +2196,23 @@ * workflow conflicts with the workflow * ID of an existing workflow. */ private static void createAndRegisterWorkflowsWithDefaultNetworkGroup( Backend backend) throws DirectoryException private static void createAndRegisterWorkflowsWithDefaultNetworkGroup(Backend<?> backend) throws DirectoryException { // Create a workflow for each backend base DN and register the workflow // with the default/internal/admin network group. for (DN curBaseDN: backend.getBaseDNs()) { WorkflowImpl workflowImpl = createWorkflow(curBaseDN, backend); registerWorkflowWithAdminNetworkGroup(workflowImpl); registerWorkflowWithInternalNetworkGroup(workflowImpl); // Special case for cn=config // it must not be added to the default ng except in auto mode if (!curBaseDN.equals(DN.valueOf(DN_CONFIG_ROOT)) || workflowConfigurationModeIsAuto()) { registerWorkflowWithDefaultNetworkGroup(workflowImpl); createAndRegisterWorkflowWithDefaultNetworkGroup(curBaseDN, backend); } } private static void createAndRegisterWorkflowWithDefaultNetworkGroup(DN baseDN, Backend<?> backend) throws DirectoryException { WorkflowImpl workflowImpl = createWorkflow(baseDN, backend); NetworkGroup.getAdminNetworkGroup().registerWorkflow(workflowImpl); NetworkGroup.getInternalNetworkGroup().registerWorkflow(workflowImpl); NetworkGroup.getDefaultNetworkGroup().registerWorkflow(workflowImpl); } @@ -2273,8 +2228,7 @@ * workflow conflicts with the workflow * ID of an existing workflow. */ private static WorkflowImpl createWorkflow(DN baseDN, Backend backend) throws DirectoryException private static WorkflowImpl createWorkflow(DN baseDN, Backend<?> backend) throws DirectoryException { String backendID = backend.getBackendID(); @@ -2304,63 +2258,6 @@ /** * Registers a workflow with the default network group. This method * is intended to be called when workflow configuration mode is auto. * * @param workflowImpl The workflow to register with the * default network group * * @throws DirectoryException If the workflow is already registered with * the default network group */ private static void registerWorkflowWithDefaultNetworkGroup( WorkflowImpl workflowImpl ) throws DirectoryException { NetworkGroup defaultNetworkGroup = NetworkGroup.getDefaultNetworkGroup(); defaultNetworkGroup.registerWorkflow(workflowImpl); } /** * Registers a workflow with the admin network group. This method * is intended to be called when workflow configuration mode is auto. * * @param workflowImpl The workflow to register with the * admin network group * * @throws DirectoryException If the workflow is already registered with * the admin network group */ private static void registerWorkflowWithAdminNetworkGroup( WorkflowImpl workflowImpl ) throws DirectoryException { NetworkGroup adminNetworkGroup = NetworkGroup.getAdminNetworkGroup(); adminNetworkGroup.registerWorkflow(workflowImpl); } /** * Registers a workflow with the internal network group. This method * is intended to be called when workflow configuration mode is auto. * * @param workflowImpl The workflow to register with the * internal network group * * @throws DirectoryException If the workflow is already registered with * the internal network group */ private static void registerWorkflowWithInternalNetworkGroup( WorkflowImpl workflowImpl ) throws DirectoryException { NetworkGroup internalNetworkGroup = NetworkGroup.getInternalNetworkGroup(); internalNetworkGroup.registerWorkflow(workflowImpl); } /** * Creates the missing workflows, one for the config backend and one for * the rootDSE backend. * @@ -2387,159 +2284,6 @@ /** * Reconfigures the workflows when configuration mode has changed. * This method is invoked when workflows need to be reconfigured * while the server is running. If the reconfiguration is valid * then the method update the workflow configuration mode. * * @param oldMode the current workflow configuration mode * @param newMode the new workflow configuration mode */ public static void reconfigureWorkflows( WorkflowConfigurationMode oldMode, WorkflowConfigurationMode newMode) { if (oldMode == WorkflowConfigurationMode.AUTO && newMode == WorkflowConfigurationMode.MANUAL) { // move to manual mode try { setWorkflowConfigurationMode(newMode); directoryServer.configureWorkflowsManual(); } catch (Exception e) { // rollback to auto mode try { setWorkflowConfigurationMode(oldMode); directoryServer.configureWorkflowsAuto(); } catch (Exception ee) { // rollback to auto mode is failing too!! // well, just log an error message and suggest the admin // to restart the server with the last valid config... logger.error(ERR_CONFIG_WORKFLOW_CANNOT_CONFIGURE_MANUAL); } } } else if (oldMode == WorkflowConfigurationMode.MANUAL && newMode == WorkflowConfigurationMode.AUTO) { // move to auto mode try { setWorkflowConfigurationMode(newMode); directoryServer.configureWorkflowsAuto(); } catch (Exception e) { // rollback to manual mode try { setWorkflowConfigurationMode(oldMode); directoryServer.configureWorkflowsManual(); } catch (Exception ee) { // rollback to auto mode is failing too!! // well, just log an error message and suggest the admin // to restart the server with the last valid config... logger.error(ERR_CONFIG_WORKFLOW_CANNOT_CONFIGURE_AUTO); } } } } /** * Configures the workflows when configuration mode is manual. * * @throws ConfigException If there is a problem with the Directory Server * configuration that prevents a critical component * from being instantiated. * * @throws InitializationException If some other problem occurs while * attempting to initialize and start the * Directory Server. */ private void configureWorkflowsManual() throws ConfigException, InitializationException { // First of all re-initialize the current workflow configuration NetworkGroup.resetConfig(); WorkflowImpl.resetConfig(); directoryServer.workflowElements.clear(); // We now need to complete the workflow creation for the // config backend and rootDSE backend. createAndRegisterRemainingWorkflows(); // Then configure the workflows workflowElementConfigManager = new WorkflowElementConfigManager(serverContext); workflowElementConfigManager.initializeWorkflowElements(); workflowConfigManager = new WorkflowConfigManager(serverContext); workflowConfigManager.initializeWorkflows(); if (networkGroupConfigManager == null) { networkGroupConfigManager = new NetworkGroupConfigManager(serverContext); networkGroupConfigManager.initializeNetworkGroups(); } } /** * Configures the workflows when configuration mode is auto. * * @throws ConfigException If there is a problem with the Directory Server * configuration that prevents a critical component * from being instantiated. */ private void configureWorkflowsAuto() throws ConfigException { // Make sure that the network group config manager is finalized. if (networkGroupConfigManager != null) { networkGroupConfigManager.finalizeNetworkGroups(); networkGroupConfigManager = null; } // First of all re-initialize the current workflow configuration NetworkGroup.resetConfig(); WorkflowImpl.resetConfig(); directoryServer.workflowElements.clear(); // For each base DN in a backend create a workflow and register // the workflow with the default network group for (Backend<?> backend : getBackends().values()) { for (DN baseDN: backend.getBaseDNs()) { try { final WorkflowImpl workflowImpl = createWorkflow(baseDN, backend); registerWorkflowWithInternalNetworkGroup(workflowImpl); registerWorkflowWithAdminNetworkGroup(workflowImpl); registerWorkflowWithDefaultNetworkGroup(workflowImpl); } catch (DirectoryException e) { throw new ConfigException(e.getMessageObject()); } } } // We now need to complete the workflow creation for the // config backend and rootDSE backend. createAndRegisterRemainingWorkflows(); } /** * Initializes the Directory Server group manager. * * @throws ConfigException If there is a configuration problem with any of @@ -5612,7 +5356,7 @@ * @return The backend with the specified backend ID, or {@code null} if * there is none. */ public static Backend getBackend(String backendID) public static Backend<?> getBackend(String backendID) { return directoryServer.backends.get(backendID); } @@ -5647,8 +5391,7 @@ * conflicts with the backend ID of an existing * backend. */ public static void registerBackend(Backend<?> backend) throws DirectoryException public static void registerBackend(Backend<?> backend) throws DirectoryException { ifNull(backend); @@ -5697,7 +5440,7 @@ * @param backend The backend to deregister with the server. It must not be * {@code null}. */ public static void deregisterBackend(Backend backend) public static void deregisterBackend(Backend<?> backend) { ifNull(backend); @@ -5709,14 +5452,8 @@ directoryServer.backends = newBackends; // Don't need anymore the local backend workflow element so we // can remove it. We do remove the workflow element only when // the workflow configuration mode is auto because in manual // mode the config manager is doing the job. if (workflowConfigurationModeIsAuto()) { // Don't need anymore the local backend workflow element so we can remove it LocalBackendWorkflowElement.remove(backend.getBackendID()); } BackendMonitor monitor = backend.getBackendMonitor(); @@ -5785,7 +5522,7 @@ * @return The backend with the specified base DN, or {@code null} if there * is no backend registered with the specified base DN. */ public static Backend getBackendWithBaseDN(DN baseDN) public static Backend<?> getBackendWithBaseDN(DN baseDN) { return directoryServer.baseDnRegistry.getBaseDnMap().get(baseDN); } @@ -5803,7 +5540,7 @@ * specified entry, or {@code null} if no appropriate backend is * registered with the server. */ public static Backend getBackend(DN entryDN) public static Backend<?> getBackend(DN entryDN) { if (entryDN.isRootDN()) { @@ -5811,7 +5548,7 @@ } Map<DN,Backend> baseDNs = directoryServer.baseDnRegistry.getBaseDnMap(); Backend b = baseDNs.get(entryDN); Backend<?> b = baseDNs.get(entryDN); while (b == null) { entryDN = entryDN.parent(); @@ -5857,8 +5594,7 @@ * @throws DirectoryException If a problem occurs while attempting to * register the provided base DN. */ public static void registerBaseDN(DN baseDN, Backend backend, boolean isPrivate) public static void registerBaseDN(DN baseDN, Backend<?> backend, boolean isPrivate) throws DirectoryException { ifNull(baseDN, backend); @@ -5878,20 +5614,14 @@ } // When a new baseDN is registered with the server we have to create // a new workflow to handle the base DN. We do not need to create // the workflow in manual mode because in that case the workflows // are created explicitly. if (workflowConfigurationModeIsAuto() && !baseDN.equals(DN.valueOf("cn=config"))) // a new workflow to handle the base DN. if (!baseDN.equals(DN.valueOf("cn=config"))) { // Now create a workflow for the registered baseDN and register // the workflow with the default network group, but don't register // the workflow if the backend happens to be the configuration // backend because it's too soon for the config backend. WorkflowImpl workflowImpl = createWorkflow(baseDN, backend); registerWorkflowWithInternalNetworkGroup(workflowImpl); registerWorkflowWithAdminNetworkGroup(workflowImpl); registerWorkflowWithDefaultNetworkGroup(workflowImpl); createAndRegisterWorkflowWithDefaultNetworkGroup(baseDN, backend); } } } @@ -5925,11 +5655,8 @@ } } // Now we need to deregister the workflow that was associated with // the base DN but we can do it only when the workflow configuration // mode is auto, because in manual mode the deregistration is done // by the workflow config manager. if (workflowConfigurationModeIsAuto()) // Now we need to deregister the workflow that was associated with the base DN if (!baseDN.equals(DN.valueOf("cn=config"))) { deregisterWorkflowWithAdminNetworkGroup(baseDN); deregisterWorkflowWithDefaultNetworkGroup(baseDN); @@ -6050,23 +5777,18 @@ public static Entry getEntry(DN entryDN) throws DirectoryException { // If the entry is the root DSE, then get and return that. if (entryDN.isRootDN()) { return directoryServer.rootDSEBackend.getRootDSE(); } // Figure out which backend should be used for the entry. If it isn't // appropriate for any backend, then return null. Backend backend = getBackend(entryDN); if (backend == null) final Backend<?> backend = getBackend(entryDN); if (backend != null) { return null; } // Retrieve the requested entry from the backend. return backend.getEntry(entryDN); } return null; } @@ -6093,7 +5815,7 @@ // Ask the appropriate backend if the entry exists. // If it is not appropriate for any backend, then return false. Backend backend = getBackend(entryDN); Backend<?> backend = getBackend(entryDN); return backend != null && backend.entryExists(entryDN); } @@ -7109,7 +6831,7 @@ * @param backend The backend in which the backup is to be performed. * @param config The configuration for the backup to be performed. */ public static void notifyBackupBeginning(Backend backend, BackupConfig config) public static void notifyBackupBeginning(Backend<?> backend, BackupConfig config) { for (BackupTaskListener listener : directoryServer.backupTaskListeners) { @@ -7134,8 +6856,7 @@ * @param config The configuration for the backup that was performed. * @param successful Indicates whether the backup completed successfully. */ public static void notifyBackupEnded(Backend backend, BackupConfig config, boolean successful) public static void notifyBackupEnded(Backend<?> backend, BackupConfig config, boolean successful) { for (BackupTaskListener listener : directoryServer.backupTaskListeners) { @@ -7185,8 +6906,7 @@ * @param backend The backend in which the restore is to be performed. * @param config The configuration for the restore to be performed. */ public static void notifyRestoreBeginning(Backend backend, RestoreConfig config) public static void notifyRestoreBeginning(Backend<?> backend, RestoreConfig config) { for (RestoreTaskListener listener : directoryServer.restoreTaskListeners) { @@ -7211,8 +6931,7 @@ * @param config The configuration for the restore that was performed. * @param successful Indicates whether the restore completed successfully. */ public static void notifyRestoreEnded(Backend backend, RestoreConfig config, boolean successful) public static void notifyRestoreEnded(Backend<?> backend, RestoreConfig config, boolean successful) { for (RestoreTaskListener listener : directoryServer.restoreTaskListeners) { @@ -7263,8 +6982,7 @@ * @param backend The backend in which the export is to be performed. * @param config The configuration for the export to be performed. */ public static void notifyExportBeginning(Backend backend, LDIFExportConfig config) public static void notifyExportBeginning(Backend<?> backend, LDIFExportConfig config) { for (ExportTaskListener listener : directoryServer.exportTaskListeners) { @@ -7289,8 +7007,7 @@ * @param config The configuration for the export that was performed. * @param successful Indicates whether the export completed successfully. */ public static void notifyExportEnded(Backend backend, LDIFExportConfig config, boolean successful) public static void notifyExportEnded(Backend<?> backend, LDIFExportConfig config, boolean successful) { for (ExportTaskListener listener : directoryServer.exportTaskListeners) { @@ -7341,8 +7058,7 @@ * @param backend The backend in which the import is to be performed. * @param config The configuration for the import to be performed. */ public static void notifyImportBeginning(Backend backend, LDIFImportConfig config) public static void notifyImportBeginning(Backend<?> backend, LDIFImportConfig config) { for (ImportTaskListener listener : directoryServer.importTaskListeners) { @@ -7367,8 +7083,7 @@ * @param config The configuration for the import that was performed. * @param successful Indicates whether the import completed successfully. */ public static void notifyImportEnded(Backend backend, LDIFImportConfig config, boolean successful) public static void notifyImportEnded(Backend<?> backend, LDIFImportConfig config, boolean successful) { for (ImportTaskListener listener : directoryServer.importTaskListeners) { @@ -7641,7 +7356,7 @@ // Shut down the backends. for (Backend backend : directoryServer.backends.values()) for (Backend<?> backend : directoryServer.backends.values()) { try { @@ -9080,99 +8795,7 @@ return isRunningAsWindowsService; } /** * Specifies whether the workflows are configured automatically or manually. * In auto configuration mode one workflow is created for each and every * base DN in the local backends. In the auto configuration mode the * workflows are created according to their description in the configuration * file. * * @param workflowConfigurationMode Indicates whether the workflows are * configured automatically or manually */ public static void setWorkflowConfigurationMode( WorkflowConfigurationMode workflowConfigurationMode) { directoryServer.workflowConfigurationMode = workflowConfigurationMode; } /** * Indicates whether the workflow configuration mode is 'auto' or not. * * @return the workflow configuration mode */ private static boolean workflowConfigurationModeIsAuto() { return directoryServer.workflowConfigurationMode == WorkflowConfigurationMode.AUTO; } /** * Retrieves the workflow configuration mode. * * @return the workflow configuration mode */ public static WorkflowConfigurationMode getWorkflowConfigurationMode() { return directoryServer.workflowConfigurationMode; } /** * Return the WorkflowElement associated with a name. * * @param workflowElementID the name of the requested workflow element * @return the associated workflow element or null */ public static WorkflowElement getWorkflowElement(String workflowElementID) { return directoryServer.workflowElements.get(workflowElementID); } /** * Registers the provided workflow element from the Directory Server. * * @param we The workflow element to register. It must not be * {@code null}. * @throws DirectoryException If the workflow element ID for the * provided workflow element conflicts with the ID of * an existing workflow element. */ public static void registerWorkflowElement(WorkflowElement we) throws DirectoryException { ifNull(we); String workflowElementID = we.getWorkflowElementID(); ifNull(workflowElementID); synchronized (directoryServer) { if (directoryServer.workflowElements.containsKey(workflowElementID)) { ERR_REGISTER_WORKFLOW_ELEMENT_ALREADY_EXISTS.get( workflowElementID); } else { directoryServer.workflowElements.put(workflowElementID, we); } } } /** * Deregisters the provided workflow element from the Directory Server. * * @param we The workflow element to deregister. It must not be * {@code null}. */ public static void deregisterWorkflowElement(WorkflowElement we) { ifNull(we); String workflowElementID = we.getWorkflowElementID(); ifNull(workflowElementID); synchronized (directoryServer) { directoryServer.workflowElements.remove(workflowElementID); } } // TODO JNR remove error CoreMessages.ERR_REGISTER_WORKFLOW_ELEMENT_ALREADY_EXISTS /** * Print messages for start-ds "-F" option (full version information). opendj3-server-dev/src/server/org/opends/server/core/WorkflowConfigManager.java
File was deleted opendj3-server-dev/src/server/org/opends/server/core/WorkflowImpl.java
@@ -26,21 +26,22 @@ */ package org.opends.server.core; import static org.opends.messages.CoreMessages.*; import static org.forgerock.util.Reject.ifNull; import java.util.Collection; import java.util.Observable; import java.util.Observer; import java.util.TreeMap; import org.forgerock.i18n.LocalizableMessageBuilder; import org.opends.server.admin.std.server.WorkflowCfg; import org.opends.server.types.*; import org.forgerock.opendj.ldap.ResultCode; import org.opends.server.workflowelement.WorkflowElement; import org.opends.server.types.CanceledOperationException; import org.opends.server.types.DN; import org.opends.server.types.DirectoryException; import org.opends.server.types.Operation; import org.opends.server.workflowelement.ObservableWorkflowElementState; import org.opends.server.workflowelement.WorkflowElement; import static org.forgerock.util.Reject.*; import static org.opends.messages.CoreMessages.*; /** * This class implements the workflow interface. Each task in the workflow @@ -57,7 +58,7 @@ private final String workflowID; // The root of the workflow task tree. private WorkflowElement<?> rootWorkflowElement = null; private WorkflowElement rootWorkflowElement = null; // The root workflow element identifier. private String rootWorkflowElementID = null; @@ -108,7 +109,7 @@ String workflowId, DN baseDN, String rootWorkflowElementID, WorkflowElement<?> rootWorkflowElement WorkflowElement rootWorkflowElement ) { this.workflowID = workflowId; @@ -151,6 +152,7 @@ * * @return the workflow base DN */ @Override public DN getBaseDN() { return baseDN; @@ -190,6 +192,7 @@ * @throws CanceledOperationException if this operation should * be canceled. */ @Override public void execute(Operation operation) throws CanceledOperationException { @@ -247,7 +250,7 @@ // Deregister the workflow with the list of objects to notify when // a workflow element is created or deleted. WorkflowElement.deregistereForStateUpdate( WorkflowElement.deregisterForStateUpdate( null, rootWorkflowElementID, this); // Deregister the workflow with the list of registered workflows. @@ -331,71 +334,15 @@ * * @return the root workflow element. */ WorkflowElement<?> getRootWorkflowElement() WorkflowElement getRootWorkflowElement() { return rootWorkflowElement; } /** * Resets all the registered workflows. */ public static void resetConfig() { synchronized (registeredWorkflowsLock) { registeredWorkflows = new TreeMap<String, Workflow>(); } } /** * Updates the workflow configuration. This method should be invoked * whenever an existing workflow is modified. * * @param configuration the new workflow configuration */ public void updateConfig(WorkflowCfg configuration) { // The only parameter that can be changed is the root workflow element. String rootWorkflowElementID = configuration.getWorkflowElement(); WorkflowElement<?> rootWorkflowElement = DirectoryServer.getWorkflowElement(rootWorkflowElementID); // Update the ID of the new root workflow element // and deregister the workflow with the list of objects to notify // when the former root workflow element is created String previousRootWorkflowElement = this.rootWorkflowElementID; WorkflowElement.deregistereForStateUpdate( null, previousRootWorkflowElement, this); this.rootWorkflowElementID = rootWorkflowElementID; // Does the new root workflow element exist? if (rootWorkflowElement == null) { // The new root workflow element does not exist yet then do nothing // but register with the list of object to notify when the workflow // element is created (and deregister first in case the workflow // was already registered) WorkflowElement.registereForStateUpdate( null, rootWorkflowElementID, this); rootWorkflowElement = null; } else { // The new root workflow element exists, let's use it and don't forget // to register with the list of objects to notify when the workflow // element is deleted. this.rootWorkflowElement = rootWorkflowElement; WorkflowElement.registereForStateUpdate( rootWorkflowElement, null, this); } } /** * {@inheritDoc} */ @Override public void update(Observable observable, Object arg) { if (observable instanceof ObservableWorkflowElementState) @@ -411,10 +358,10 @@ * Display the workflow object. * @return a string identifying the workflow. */ @Override public String toString() { String id = "Workflow " + workflowID; return id; return "Workflow " + workflowID; } @@ -440,36 +387,19 @@ { // Check that the workflow element maps the root workflow element. // If not then ignore the workflow element. WorkflowElement<?> we = weState.getObservedWorkflowElement(); WorkflowElement we = weState.getObservedWorkflowElement(); String newWorkflowElementID = we.getWorkflowElementID(); if (! rootWorkflowElementID.equalsIgnoreCase(newWorkflowElementID)) { return; } // The workflow element maps the root workflow element, let's process it. if (weState.workflowElementIsEnabled()) { // The root workflow element is enabled, let's use it // and don't forget to register the workflow with the list // of objects to notify when the root workflow element // is disabled... // The workflow element maps the root workflow element // don't forget to register the workflow with the list of objects to notify // when the root workflow element is disabled... rootWorkflowElement = weState.getObservedWorkflowElement(); WorkflowElement.registereForStateUpdate( rootWorkflowElement, null, this); WorkflowElement.deregistereForStateUpdate( null, rootWorkflowElementID, this); } else { // The root workflow element has been disabled. Reset the current // reference to the root workflow element and register the workflow // with the list of objects to notify when new workflow elements // are created. WorkflowElement.registereForStateUpdate( null, rootWorkflowElement.getWorkflowElementID(), this); rootWorkflowElement = null; } WorkflowElement.registereForStateUpdate(rootWorkflowElement, null, this); WorkflowElement.deregisterForStateUpdate(null, rootWorkflowElementID, this); } opendj3-server-dev/src/server/org/opends/server/core/WorkflowTopologyNode.java
@@ -33,7 +33,6 @@ import org.opends.server.types.DN; import org.opends.server.types.Operation; import org.opends.server.types.OperationType; import org.opends.server.workflowelement.WorkflowElement; /** * This class implements a workflow node. A workflow node is used @@ -72,16 +71,8 @@ * elements are not used. * * @param workflowImpl the real processing attached to the node * @param preWorkflowElements the list of tasks to be executed before * the real processing * @param postWorkflowElements the list of tasks to be executed after * the real processing */ public WorkflowTopologyNode( WorkflowImpl workflowImpl, WorkflowElement<?>[] preWorkflowElements, WorkflowElement<?>[] postWorkflowElements ) public WorkflowTopologyNode(WorkflowImpl workflowImpl) { super(workflowImpl); } opendj3-server-dev/src/server/org/opends/server/core/networkgroups/NetworkGroup.java
@@ -29,12 +29,9 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; @@ -63,7 +60,6 @@ import org.opends.server.types.DirectoryException; import org.opends.server.types.InitializationException; import org.opends.server.types.operation.PreParseOperation; import org.opends.server.workflowelement.WorkflowElement; import static org.forgerock.util.Reject.*; import static org.opends.messages.ConfigMessages.*; @@ -103,39 +99,6 @@ // Update the priority. setNetworkGroupPriority(configuration.getPriority()); // Deregister any workflows that have been removed. SortedSet<String> configWorkflows = configuration.getWorkflow(); for (String id : getRegisteredWorkflows()) { if (!configWorkflows.contains(id)) { deregisterWorkflow(id); } } // Register any workflows that have been added. List<String> ngWorkflows = getRegisteredWorkflows(); for (String id : configuration.getWorkflow()) { if (!ngWorkflows.contains(id)) { WorkflowImpl workflowImpl = (WorkflowImpl) WorkflowImpl.getWorkflow(id); try { registerWorkflow(workflowImpl); } catch (DirectoryException e) { if (resultCode == ResultCode.SUCCESS) { resultCode = e.getResultCode(); } messages.add(e.getMessageObject()); } } } try { criteria = decodeConnectionCriteriaConfiguration(configuration); @@ -149,8 +112,7 @@ // Update the configuration. NetworkGroup.this.configuration = configuration; return new ConfigChangeResult(resultCode, adminActionRequired, messages); return new ConfigChangeResult(resultCode, adminActionRequired, messages); } @@ -439,26 +401,6 @@ /** * Resets the configuration of all the registered network groups. */ public static void resetConfig() { // Reset the default network group defaultNetworkGroup.reset(); adminNetworkGroup.reset(); internalNetworkGroup.reset(); // Reset all the registered network group synchronized (registeredNetworkGroupsLock) { registeredNetworkGroups = new TreeMap<String, NetworkGroup>(); orderedNetworkGroups = new ArrayList<NetworkGroup>(); } } /** * Initializes this network group as a user network group using the * provided configuration. The network group will monitor the * configuration and update its configuration when necessary. @@ -504,24 +446,7 @@ (WorkflowImpl) WorkflowImpl.getWorkflow("__root.dse__#"); networkGroup.registerWorkflow(rootDSEworkflow); // Register the workflows with the network group. for (String workflowID : configuration.getWorkflow()) { WorkflowImpl workflowImpl = (WorkflowImpl) WorkflowImpl.getWorkflow(workflowID); if (workflowImpl == null) { // The workflow does not exist, log an error message // and skip the workflow. logger.debug(INFO_ERR_WORKFLOW_DOES_NOT_EXIST, workflowID, networkGroup.getID()); } else { networkGroup.registerWorkflow(workflowImpl); } } // TODO JNR remove CoreMessages.INFO_ERR_WORKFLOW_DOES_NOT_EXIST // Register all configuration change listeners. configuration.addChangeListener(networkGroup.changeListener); @@ -580,28 +505,6 @@ // different base DN. boolean isAcceptable = true; Set<String> allBaseDNs = new HashSet<String>(); for (String workflowId : configuration.getWorkflow()) { WorkflowImpl workflow = (WorkflowImpl) WorkflowImpl.getWorkflow(workflowId); String baseDN = workflow.getBaseDN().toNormalizedString(); if (allBaseDNs.contains(baseDN)) { // This baseDN is duplicated LocalizableMessage message = ERR_WORKFLOW_BASE_DN_DUPLICATED_IN_NG.get(baseDN, getNameFromConfiguration(configuration)); unacceptableReasons.add(message); isAcceptable = false; break; } else { allBaseDNs.add(baseDN); } } // Validate any policy configurations. for (String policyName : configuration .listNetworkGroupQOSPolicies()) @@ -757,9 +660,7 @@ private ConnectionCriteria criteria = ConnectionCriteria.TRUE; private final boolean isAdminNetworkGroup; private final boolean isDefaultNetworkGroup; private final boolean isInternalNetworkGroup; // List of naming contexts handled by the network group. @@ -935,8 +836,7 @@ // deregister a workflow node synchronized (registeredWorkflowNodesLock) { for (WorkflowTopologyNode node : registeredWorkflowNodes .values()) for (WorkflowTopologyNode node : registeredWorkflowNodes.values()) { DN curDN = node.getBaseDN(); if (curDN.equals(baseDN)) @@ -957,8 +857,7 @@ // Now that the workflow node has been deregistered with the network // group, update the reference counter of the workflow. if ((workflow != null) && !isAdminNetworkGroup && !isInternalNetworkGroup && !isDefaultNetworkGroup) if (workflow != null && !isAdminNetworkGroup && !isInternalNetworkGroup && !isDefaultNetworkGroup) { WorkflowImpl workflowImpl = (WorkflowImpl) workflow; workflowImpl.decrementReferenceCounter(); @@ -999,8 +898,7 @@ // deregister a workflow node synchronized (registeredWorkflowNodesLock) { for (WorkflowTopologyNode node : registeredWorkflowNodes .values()) for (WorkflowTopologyNode node : registeredWorkflowNodes.values()) { String curID = node.getWorkflowImpl().getWorkflowId(); if (curID.equals(workflowID)) @@ -1236,24 +1134,6 @@ /** * Registers a workflow with the network group. * * @param workflow * the workflow to register * @throws DirectoryException * If the workflow ID for the provided workflow conflicts * with the workflow ID of an existing workflow. */ public void registerWorkflow(WorkflowImpl workflow) throws DirectoryException { // The workflow is registered with no pre/post workflow element. registerWorkflow(workflow, null, null); } /** * Removes a connection from the group. * * @param connection @@ -1424,18 +1304,10 @@ String workflowID = workflowNode.getWorkflowImpl().getWorkflowId(); ifNull(workflowID); // If the network group is the "internal" network group then bypass // the check because the internal network group may contain // If the network group is the "internal" or the "admin" network group // then bypass the check because the internal network group may contain // duplicates of base DNs. if (isInternalNetworkGroup) { return; } // If the network group is the "admin" network group then bypass // the check because the internal network group may contain // duplicates of base DNs. if (isAdminNetworkGroup) if (isInternalNetworkGroup || isAdminNetworkGroup) { return; } @@ -1545,8 +1417,7 @@ else { // Deregister the workflow with the network group. WorkflowTopologyNode workflowNode = (WorkflowTopologyNode) workflow; WorkflowTopologyNode workflowNode = (WorkflowTopologyNode) workflow; deregisterWorkflowNode(workflowNode); deregistered = true; @@ -1574,10 +1445,8 @@ synchronized (registeredWorkflowNodesLock) { TreeMap<String, WorkflowTopologyNode> newWorkflowNodes = new TreeMap<String, WorkflowTopologyNode>( registeredWorkflowNodes); newWorkflowNodes.remove(workflowNode.getWorkflowImpl() .getWorkflowId()); new TreeMap<String, WorkflowTopologyNode>(registeredWorkflowNodes); newWorkflowNodes.remove(workflowNode.getWorkflowImpl().getWorkflowId()); registeredWorkflowNodes = newWorkflowNodes; } } @@ -1585,26 +1454,6 @@ /** * Retrieves the list of registered workflows. * * @return a list of workflow ids */ private List<String> getRegisteredWorkflows() { List<String> workflowIDs = new ArrayList<String>(); synchronized (registeredWorkflowNodesLock) { for (WorkflowTopologyNode node : registeredWorkflowNodes.values()) { workflowIDs.add(node.getWorkflowImpl().getWorkflowId()); } } return workflowIDs; } /** * We've seen parts of the server hold references to a NetworkGroup * during an in-core server restart. To help detect when this happens, * we null out the member variables, so we will fail fast with an NPE @@ -1682,8 +1531,7 @@ namingContexts.resetLists(); // a registered workflow with no parent is a naming context for (WorkflowTopologyNode workflowNode : registeredWorkflowNodes .values()) for (WorkflowTopologyNode workflowNode : registeredWorkflowNodes.values()) { WorkflowTopologyNode parent = workflowNode.getParent(); if (parent == null) @@ -1696,25 +1544,17 @@ /** * Registers a workflow with the network group and the workflow may * have pre and post workflow element. * Registers a workflow with the network group. * * @param workflow * the workflow to register * @param preWorkflowElements * the tasks to execute before the workflow * @param postWorkflowElements * the tasks to execute after the workflow * @throws DirectoryException * If the workflow ID for the provided workflow conflicts * with the workflow ID of an existing workflow or if the * base DN of the workflow is the same than the base DN of * another workflow already registered */ private void registerWorkflow(WorkflowImpl workflow, WorkflowElement<?>[] preWorkflowElements, WorkflowElement<?>[] postWorkflowElements) throws DirectoryException public void registerWorkflow(WorkflowImpl workflow) throws DirectoryException { // Is it the rootDSE workflow? DN baseDN = workflow.getBaseDN(); @@ -1729,9 +1569,7 @@ { // This workflow is not the rootDSE workflow. Try to insert it in // the workflow topology. WorkflowTopologyNode workflowNode = new WorkflowTopologyNode(workflow, preWorkflowElements, postWorkflowElements); WorkflowTopologyNode workflowNode = new WorkflowTopologyNode(workflow); // Register the workflow node with the network group. If the // workflow ID is already existing then an exception is raised. @@ -1741,16 +1579,11 @@ for (WorkflowTopologyNode curNode : registeredWorkflowNodes .values()) { if ( // Try to insert the new workflow under an existing workflow... if (curNode.insertSubordinate(workflowNode)) { // new workflow has been inserted in the topology continue; } // ... or try to insert the existing workflow below the new // workflow if (workflowNode.insertSubordinate(curNode)) curNode.insertSubordinate(workflowNode) // ... or try to insert the existing workflow below the new workflow || workflowNode.insertSubordinate(curNode)) { // new workflow has been inserted in the topology continue; @@ -1815,19 +1648,4 @@ } } /** * Resets the configuration of the current network group. */ private void reset() { synchronized (registeredWorkflowNodesLock) { registeredWorkflowNodes = new TreeMap<String, WorkflowTopologyNode>(); rootDSEWorkflowNode = null; namingContexts = new NetworkGroupNamingContexts(); } } } opendj3-server-dev/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java
File was deleted opendj3-server-dev/src/server/org/opends/server/workflowelement/ObservableWorkflowElementState.java
@@ -36,12 +36,7 @@ */ public class ObservableWorkflowElementState extends Observable { // The "enabled" state of the observed workflow element. // By default, a workflow element is enabled (otherwise this // instance of workflow element state would not exist). private boolean enabled = true; private final WorkflowElement<?> observedWorkflowElement; private final WorkflowElement observedWorkflowElement; /** * Creates an instance of an observable object for a given workflow @@ -50,45 +45,17 @@ * @param observedWorkflowElement * The workflow element to observe. */ ObservableWorkflowElementState(WorkflowElement<?> observedWorkflowElement) ObservableWorkflowElementState(WorkflowElement observedWorkflowElement) { this.observedWorkflowElement = observedWorkflowElement; } /** * Allows the observed workflow element to indicate its new state * (enabled or disabled). * * @param enabled the new "enabled" state of the observed workflow element */ public void setWorkflowElementEnabled(boolean enabled) { if (this.enabled != enabled) { setChanged(); this.enabled = enabled; } } /** * Indicates whether the observed workflow element is enabled or not. * * @return <code>true</code> if the observed workflow element is enabled. */ public boolean workflowElementIsEnabled() { return enabled; } /** * Gets the observed workflow element. * * @return the observed workflow element. */ public WorkflowElement<?> getObservedWorkflowElement() public WorkflowElement getObservedWorkflowElement() { return observedWorkflowElement; } opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElement.java
@@ -33,7 +33,6 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArrayList; import org.opends.server.admin.std.server.WorkflowElementCfg; import org.opends.server.types.CanceledOperationException; import org.opends.server.types.Operation; @@ -45,11 +44,8 @@ * case for load balancing and distribution. And workflow element can be used * in a virtual environment to transform data (DN and attribute renaming, * attribute value renaming...). * * @param <T> The type of configuration handled by this workflow element. */ public abstract class WorkflowElement <T extends WorkflowElementCfg> implements Observer public abstract class WorkflowElement implements Observer { /** The observable state of the workflow element. */ @@ -101,11 +97,7 @@ * @param observer the observer to notify when the workflow element state * has been modified */ public static void registereForStateUpdate( WorkflowElement<?> we, String weid, Observer observer ) public static void registereForStateUpdate(WorkflowElement we, String weid, Observer observer) { // If the workflow element "we" exists then register the observer with "we" // else register the observer with a static list of workflow element @@ -158,19 +150,14 @@ * is useless when <code>we</code> is not <code>null</code> * @param observer the observer to deregister */ public static void deregistereForStateUpdate( WorkflowElement<?> we, String weid, Observer observer ) public static void deregisterForStateUpdate(WorkflowElement we, String weid, Observer observer) { // If the workflow element "we" exists then deregister the observer // with "we" else deregister the observer with a static list of // workflow element identifiers if (we != null) { ObservableWorkflowElementState westate = we.getObservableState(); westate.deleteObserver(observer); we.getObservableState().deleteObserver(observer); } if (weid != null) @@ -190,31 +177,6 @@ // By default, do nothing when notification hits the workflow element. } /** * Indicates whether the provided configuration is acceptable for * this workflow element. * * @param configuration The workflow element configuration for * which to make the determination. * @param unacceptableReasons A list that may be used to hold the * reasons that the provided * configuration is not acceptable. * * @return {@code true} if the provided configuration is acceptable * for this workflow element, or {@code false} if not. */ public final boolean isConfigurationAcceptable( T configuration, List<String> unacceptableReasons) { // This default implementation does not perform any special // validation. It should be overridden by workflow element // implementations that wish to perform more detailed validation. return true; } /** * Performs any finalization that might be required when this * workflow element is unloaded. No action is taken in the default opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java
File was deleted opendj3-server-dev/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -34,13 +34,7 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.LocalizableMessageDescriptor; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.config.server.ConfigException; import org.forgerock.opendj.ldap.ResultCode; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.server.ServerManagementContext; import org.opends.server.admin.std.server.BackendCfg; import org.opends.server.admin.std.server.LocalBackendWorkflowElementCfg; import org.opends.server.admin.std.server.RootCfg; import org.opends.server.api.Backend; import org.opends.server.controls.LDAPPostReadRequestControl; import org.opends.server.controls.LDAPPostReadResponseControl; @@ -51,15 +45,12 @@ import org.opends.server.workflowelement.WorkflowElement; import static org.opends.messages.CoreMessages.*; import static org.opends.server.config.ConfigConstants.*; /** * This class defines a local backend workflow element; e-g an entity that * handle the processing of an operation against a local backend. */ public class LocalBackendWorkflowElement extends WorkflowElement<LocalBackendWorkflowElementCfg> implements ConfigurationChangeListener<LocalBackendWorkflowElementCfg> public class LocalBackendWorkflowElement extends WorkflowElement { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); @@ -124,34 +115,6 @@ return this.backend != null && this.backend.isPrivateBackend(); } /** * Initializes a new instance of the local backend workflow element. * This method is intended to be called by DirectoryServer when * workflow configuration mode is manual as opposed to * initialize(String,Backend) which is invoked when workflow * configuration mode is auto. * * @param configuration The configuration for this local backend * workflow element. * * @throws ConfigException If there is a problem with the provided * configuration. * * @throws InitializationException If an error occurs while trying * to initialize this workflow * element that is not related to * the provided configuration. */ public void initializeWorkflowElement( LocalBackendWorkflowElementCfg configuration ) throws ConfigException, InitializationException { configuration.addLocalBackendChangeListener(this); // Read configuration and apply changes. processWorkflowElementConfig(configuration, true); } /** {@inheritDoc} */ @Override public void finalizeWorkflowElement() @@ -159,86 +122,9 @@ // null all fields so that any use of the finalized object will raise a NPE this.workflowElementID = null; this.workflowElementTypeInfo = null; backend = null; this.backend = null; } /** {@inheritDoc} */ @Override public boolean isConfigurationChangeAcceptable( LocalBackendWorkflowElementCfg configuration, List<LocalizableMessage> unacceptableReasons ) { return processWorkflowElementConfig(configuration, false); } /** {@inheritDoc} */ @Override public ConfigChangeResult applyConfigurationChange( LocalBackendWorkflowElementCfg configuration ) { processWorkflowElementConfig(configuration, true); return new ConfigChangeResult(ResultCode.SUCCESS, false, new ArrayList<LocalizableMessage>()); } /** * Parses the provided configuration and configure the workflow element. * * @param configuration The new configuration containing the changes. * @param applyChanges If true then take into account the new configuration. * * @return <code>true</code> if the configuration is acceptable. */ private boolean processWorkflowElementConfig( LocalBackendWorkflowElementCfg configuration, boolean applyChanges ) { // returned status boolean isAcceptable = true; // If the workflow element is disabled then do nothing. Note that the // configuration manager could have finalized the object right before. if (configuration.isEnabled()) { // Read configuration. String newBackendID = configuration.getBackend(); Backend<?> newBackend = DirectoryServer.getBackend(newBackendID); // If the backend is null (i.e. not found in the list of // registered backends, this is probably because we are looking // for the config backend if (newBackend == null) { ServerManagementContext context = ServerManagementContext.getInstance(); RootCfg root = context.getRootConfiguration(); try { BackendCfg backendCfg = root.getBackend(newBackendID); if (backendCfg.getBaseDN().contains(DN.valueOf(DN_CONFIG_ROOT))) { newBackend = DirectoryServer.getConfigHandler(); } } catch (Exception ex) { // Unable to find the backend newBackend = null; } } // Get the new configuration if (applyChanges) { initialize( configuration.dn().rdn().getAttributeValue(0).toString(), newBackend); } } return isAcceptable; } /** * Creates and registers a local backend with the server. * @@ -707,8 +593,7 @@ * operation */ @SuppressWarnings("unchecked") public static <O extends Operation,L> void attachLocalOperation (O globalOperation, L currentLocalOperation) static <O extends Operation, L> void attachLocalOperation(O globalOperation, L currentLocalOperation) { List<?> existingAttachment = (List<?>) globalOperation.getAttachment(Operation.LOCALBACKENDOPERATIONS); opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/SearchOperationTestCase.java
@@ -73,17 +73,14 @@ TestCaseUtils.startServer(); TestCaseUtils.clearJEBackend(true,"userRoot","dc=example,dc=com"); // Add the suffix entry. DN suffixDN = DN.valueOf(SUFFIX); if (DirectoryServer.getEntry(suffixDN) == null) if (!DirectoryServer.entryExists(suffixDN)) { processAdd(StaticUtils.createEntry(suffixDN)); } // Add a search base entry. DN baseDN = DN.valueOf(BASE); if (DirectoryServer.getEntry(baseDN) == null) if (!DirectoryServer.entryExists(baseDN)) { processAdd(StaticUtils.createEntry(baseDN)); } opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/WorkflowConfigurationTest.java
@@ -68,10 +68,7 @@ @SuppressWarnings("javadoc") public class WorkflowConfigurationTest extends UtilTestCase { // The base DN of the config backend private static final String configBaseDN = ConfigConstants.DN_CONFIG_ROOT; // The base DN of the rootDSE backend private static final String rootDSEBaseDN = ""; // The workflow configuration mode attribute @@ -79,12 +76,8 @@ "ds-cfg-workflow-configuration-mode"; // The suffix attribute in a backend private static final String suffixAttributeType = "ds-cfg-base-dn"; // The auto/manual modes private static final String suffixAttributeType = "ds-cfg-base-dn"; private static final String workflowConfigModeAuto = "auto"; private static final String workflowConfigModeManual = "manual"; @@ -177,39 +170,6 @@ doSearch(baseDN, SearchScope.BASE_OBJECT, ResultCode.NO_SUCH_OBJECT); } /** * Sets the ds-cfg-workflow-configuration-mode attribute to 'auto' */ private void setModeAuto() throws Exception { ModifyOperationBasis modifyOperation = getModifyOperation( configBaseDN, ModificationType.REPLACE, workflowModeAttributeType, workflowConfigModeAuto); modifyOperation.run(); assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); } /** * Sets the ds-cfg-workflow-configuration-mode attribute to 'auto' */ private void setModeManual() throws Exception { ModifyOperationBasis modifyOperation = getModifyOperation( configBaseDN, ModificationType.REPLACE, workflowModeAttributeType, workflowConfigModeManual); modifyOperation.run(); assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); } /** * Performs a search on a provided base DN. * @@ -316,8 +276,7 @@ NetworkGroup.getInternalNetworkGroup().deregisterWorkflow(workflowID); // Deregister the workflow with the server Workflow workflow = WorkflowImpl.getWorkflow(workflowID); WorkflowImpl workflowImpl = (WorkflowImpl) workflow; WorkflowImpl workflowImpl = (WorkflowImpl) WorkflowImpl.getWorkflow(workflowID); workflowImpl.deregister(); } @@ -474,76 +433,6 @@ //=========================================================================== /** * This test checks the transition from mode 'auto' to 'manual' and * 'manual' back to 'auto'. In this test there is no configuration for * network group, workflow and workflow element. */ @Test public void transitionAutoManualAuto() throws Exception { // Settings String testBaseDN = "o=test"; // The ds-cfg-workflow-configuration-mode attribute value is "auto" // (default value), let's put the same value again. Putting the same // value should have no impact and we should be able to perform a search // on the test backend. setModeAuto(); checkBackendIsAccessible(testBaseDN); // Change the ds-cfg-workflow-configuration-mode attribute value // to "manual". The workflows should be fully reconfigured. But as // there is no configuration for the workflows, only cn=config and // rootDSE should be accessible. setModeManual(); checkBackendIsNotAccessible(testBaseDN); // Change the ds-cfg-workflow-configuration-mode attribute value // back to "auto". All the local backends should be accessible again. setModeAuto(); checkBackendIsAccessible(testBaseDN); } /** * This test checks the basic operation routing when configuration * mode is 'manual'. Few workflows are configured for the test. */ @Test public void basicRoutingManualMode() throws Exception { // Settings String testBaseDN = "o=test"; String testBackendID = "test"; // Workflow configuration mode is auto, so test backend should // be accessible setModeAuto(); checkBackendIsAccessible(testBaseDN); // Set the workflow configuration mode to manual. In this mode // no there is no workflow by default (but the config and rootDSE // workflows) so searches on the test backend should fail. setModeManual(); checkBackendIsNotAccessible(testBaseDN); // Create a workflow to handle o=test backend then check that test // backend is now accessible createWorkflow(testBaseDN, testBackendID); checkBackendIsAccessible(testBaseDN); // Remove the workflow and check that searches are failing. removeWorkflow(testBaseDN, testBackendID); checkBackendIsNotAccessible(testBaseDN); // Change workflow configuration mode back to auto and check that // test backend is still accessible setModeAuto(); checkBackendIsAccessible(testBaseDN); } /** * This test checks the add/remove of suffix in a backend in manual * configuration mode. */ @@ -557,7 +446,6 @@ // make sure we are in auto mode and check that the new suffixes are // not already defined on the server. setModeAuto(); checkBackendIsNotAccessible(testBaseDN2); checkBackendIsNotAccessible(testBaseDN3); @@ -572,9 +460,6 @@ removeSuffix(testBaseDN2, testBackendID2); checkBackendIsNotAccessible(testBaseDN2); // Now move to the manual mode. setModeManual(); // Add a new suffix and configure a workflow to route operation // to this new suffix, then check that the new suffix is accessible. // Note that before we can create a base entry we need to configure @@ -591,9 +476,6 @@ removeWorkflow(testBaseDN3, testBackendID2); removeSuffix(testBaseDN3, testBackendID2); checkBackendIsNotAccessible(testBaseDN3); // Back to the original configuration mode setModeAuto(); } @@ -611,7 +493,6 @@ String baseDN2 = "o=addRemoveBackendBaseDN_2"; // Make sure we are in auto mode and check the suffix is not accessible setModeAuto(); checkBackendIsNotAccessible(baseDN1); // Create a backend and check that the base entry is accessible. @@ -622,8 +503,6 @@ dsconfigRemoveMemoryBackend(backendID1); checkBackendIsNotAccessible(baseDN1); // Now move to the manual mode setModeManual(); checkBackendIsNotAccessible(baseDN2); // Create a backend and create a workflow to route operations to that @@ -637,9 +516,6 @@ removeWorkflow(baseDN2, backendID2); dsconfigRemoveMemoryBackend(backendID2); checkBackendIsNotAccessible(baseDN2); // Back to the original configuration mode setModeAuto(); } @@ -654,9 +530,6 @@ String backendID = "test"; String baseDN = "o=test"; // Move to the manual mode setModeManual(); // Create a route for o=test suffix in the internal network group. // Search on o=test should succeed. WorkflowImpl workflowImpl = createWorkflow(baseDN, backendID); @@ -684,8 +557,5 @@ clientConnection.setNetworkGroup(NetworkGroup.getInternalNetworkGroup()); searchOperation.run(); assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); // Back to the original configuration mode setModeAuto(); } } opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/WorkflowTopologyTest.java
@@ -26,21 +26,13 @@ */ package org.opends.server.core; import static org.opends.messages.CoreMessages.*; import org.forgerock.i18n.LocalizableMessageBuilder; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertNull; import java.util.ArrayList; import org.forgerock.i18n.LocalizableMessageBuilder; import org.forgerock.opendj.ldap.ResultCode; import org.opends.server.TestCaseUtils; import org.opends.server.types.DN; import org.opends.server.types.DirectoryException; import org.forgerock.opendj.ldap.ResultCode; import org.opends.server.util.StaticUtils; import org.opends.server.util.UtilTestCase; import org.opends.server.workflowelement.WorkflowElement; @@ -48,6 +40,8 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.opends.messages.CoreMessages.*; import static org.testng.Assert.*; /** * This set of tests checks that workflow topology is properly created. @@ -424,8 +418,7 @@ new WorkflowImpl (baseDN.toString(), baseDN, null, nullWE); // Create a worflow with the dit, no pre/post-workflow element. WorkflowTopologyNode workflowNode = new WorkflowTopologyNode (workflow, null, null); WorkflowTopologyNode workflowNode = new WorkflowTopologyNode(workflow); // The base DN in the workflow should match baseDN parameter DN workflowBaseDN = workflowNode.getBaseDN(); @@ -495,14 +488,14 @@ } // Create a worflow for each dit, no pre/post-workflow element WorkflowTopologyNode w1 = new WorkflowTopologyNode(workflow, null, null); WorkflowTopologyNode w1bis = new WorkflowTopologyNode(workflow, null, null); WorkflowTopologyNode w2 = new WorkflowTopologyNode(subWorkflow, null, null); WorkflowTopologyNode w1 = new WorkflowTopologyNode(workflow); WorkflowTopologyNode w1bis = new WorkflowTopologyNode(workflow); WorkflowTopologyNode w2 = new WorkflowTopologyNode(subWorkflow); WorkflowTopologyNode w3 = null; if (unrelatedWorkflow != null) { w3 = new WorkflowTopologyNode (unrelatedWorkflow, null, null); w3 = new WorkflowTopologyNode(unrelatedWorkflow); } // insert status @@ -636,9 +629,9 @@ workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, nullWE); } w1 = new WorkflowTopologyNode (workflow1, null, null); w2 = new WorkflowTopologyNode (workflow2, null, null); w3 = new WorkflowTopologyNode (workflow3, null, null); w1 = new WorkflowTopologyNode(workflow1); w2 = new WorkflowTopologyNode(workflow2); w3 = new WorkflowTopologyNode(workflow3); } // insert status @@ -818,9 +811,9 @@ workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, nullWE); } w1 = new WorkflowTopologyNode (workflow1, null, null); w2 = new WorkflowTopologyNode (workflow2, null, null); w3 = new WorkflowTopologyNode (workflow3, null, null); w1 = new WorkflowTopologyNode(workflow1); w2 = new WorkflowTopologyNode(workflow2); w3 = new WorkflowTopologyNode(workflow3); } // Put all the workflows in a pool opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/NetworkGroupTest.java
@@ -334,22 +334,20 @@ // Register again the network group with the server and catch the // expected DirectoryServer exception. boolean exceptionRaised = false; try { networkGroup.register(); fail("InitializationException sjhould have been thrown"); } catch (InitializationException e) { exceptionRaised = true; assertTrue(StaticUtils.hasDescriptor(e.getMessageObject(), ERR_REGISTER_NETWORK_GROUP_ALREADY_EXISTS)); } assertEquals(exceptionRaised, true); // Create a workflow -- the workflow ID is the string representation // of the workflow base DN. WorkflowElement<?> nullWE = null; WorkflowElement nullWE = null; WorkflowImpl workflow = new WorkflowImpl( workflowBaseDN.toString(), workflowBaseDN, null, nullWE); @@ -358,18 +356,16 @@ // Register again the workflow with the network group and catch the // expected DirectoryServer exception. exceptionRaised = false; try { networkGroup.registerWorkflow(workflow); fail("DirectoryException sjhould have been thrown"); } catch (DirectoryException de) { exceptionRaised = true; assertTrue(StaticUtils.hasDescriptor(de.getMessageObject(), ERR_REGISTER_WORKFLOW_NODE_ALREADY_EXISTS)); } assertEquals(exceptionRaised, true); // Clean the network group networkGroup.deregisterWorkflow(workflow.getWorkflowId()); @@ -400,26 +396,21 @@ assertNotNull(defaultNG); // let's check the routing through the network group doCheckNetworkGroup(defaultNG, dnToSearch, dnSubordinate, null, existsInDefault); doCheckNetworkGroup(defaultNG, dnToSearch, dnSubordinate, null, existsInDefault); // let's get the admin network group -- it should always exist NetworkGroup adminNG = NetworkGroup.getAdminNetworkGroup(); assertNotNull(adminNG); // let's check the routing through the network group doCheckNetworkGroup(adminNG, dnToSearch, dnSubordinate, null, existsInAdmin); doCheckNetworkGroup(adminNG, dnToSearch, dnSubordinate, null, existsInAdmin); // let's get the internal network group -- it should always exist NetworkGroup internalNG = NetworkGroup.getInternalNetworkGroup(); assertNotNull(internalNG); // let's check the routing through the network group doCheckNetworkGroup(internalNG, dnToSearch, dnSubordinate, null, existsInInternal); doCheckNetworkGroup(internalNG, dnToSearch, dnSubordinate, null, existsInInternal); } @@ -491,12 +482,9 @@ doCheckNetworkGroup(networkGroup, dn3, subordinate3, unrelatedDN, false); // Now create again the workflow 1, 2 and 3... WorkflowImpl w1; WorkflowImpl w2; WorkflowImpl w3; w1 = createAndRegisterWorkflow(networkGroup, dn1); w2 = createAndRegisterWorkflow(networkGroup, dn2); w3 = createAndRegisterWorkflow(networkGroup, dn3); WorkflowImpl w1 = createAndRegisterWorkflow(networkGroup, dn1); WorkflowImpl w2 = createAndRegisterWorkflow(networkGroup, dn2); WorkflowImpl w3 = createAndRegisterWorkflow(networkGroup, dn3); // ... and deregister the workflows using their workflowID // instead of their baseDN @@ -783,7 +771,7 @@ // Create a workflow -- the workflow ID is the string representation // of the workflow base DN. WorkflowElement<?> nullWE = null; WorkflowElement nullWE = null; WorkflowImpl workflow1 = new WorkflowImpl( dn1.toString(), dn1, null, nullWE); WorkflowImpl workflow2 = new WorkflowImpl( @@ -800,11 +788,7 @@ // As the network groups define no criteria, the highest priority // must be chosen NetworkGroup ng = NetworkGroup.findMatchingNetworkGroup(connection); if (prio1 < prio2) { assertEquals(ng, networkGroup1); } else { assertEquals(ng, networkGroup2); } assertEquals(ng, prio1 < prio2 ? networkGroup1 : networkGroup2); // Clean the network group networkGroup1.deregisterWorkflow(workflow1.getWorkflowId()); @@ -1157,9 +1141,7 @@ // Check that the unrelatedDN is not handled by any workflow if (unrelatedDN != null) { Workflow unrelatedWorkflow = networkGroup.getWorkflowCandidate(unrelatedDN); assertNull(unrelatedWorkflow); assertNull(networkGroup.getWorkflowCandidate(unrelatedDN)); } } @@ -1188,7 +1170,7 @@ // Create a workflow with no task inside. The workflow identifier // is the a string representation of the workflow base DN. WorkflowElement<?> rootWE = null; WorkflowElement rootWE = null; String workflowId = workflowBaseDN.toString(); WorkflowImpl workflow = new WorkflowImpl( workflowId, workflowBaseDN, null, rootWE); @@ -1200,13 +1182,4 @@ return workflow; } /** * Prints a text to System.out. */ private void write(String msg) { System.out.print(msg); } }