diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/common/ParameterConstants.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/common/ParameterConstants.java index 8cf69132ac..3f9afa2714 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/common/ParameterConstants.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/common/ParameterConstants.java @@ -107,6 +107,7 @@ private ParameterConstants() { public final static String REGISTRATION_REOPEN_USE_SAME_PASSWORD = "registration.reopen.use.same.password"; public final static String REGISTRATION_REQUIRE_NODE_GROUP_LINK = "registration.require.node.group.link"; public final static String REGISTRATION_REINITIALIZE_ENABLED = "registration.reinitialize.enable"; + public final static String REGISTRATION_REQUIRE_INITIAL_LOAD = "registration.require.initial.load"; public final static String REGISTRATION_URL = "registration.url"; public final static String SYNC_URL = "sync.url"; diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java index ba7bdabd65..a5de10c6e6 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java @@ -165,8 +165,9 @@ protected Node processRegistration(Node nodePriorToRegistration, String remoteHo * registration is not allowed until this node has an identity * and an initial load */ + boolean requiresInitialLoad = parameterService.is(ParameterConstants.REGISTRATION_REQUIRE_INITIAL_LOAD, true); NodeSecurity security = nodeService.findNodeSecurity(identity.getNodeId()); - if (security == null || security.getInitialLoadTime() == null) { + if (requiresInitialLoad && (security == null || security.getInitialLoadTime() == null)) { RegistrationRequest req = new RegistrationRequest(nodePriorToRegistration, RegistrationStatus.ER, remoteHost, remoteAddress); req.setErrorMessage("Cannot register a client node until this node has an initial load (ie. node_security.initial_load_time is a non null value)"); @@ -284,7 +285,7 @@ public boolean registerNode(Node nodePriorToRegistration, String remoteHost, * the configuration for the node */ outgoingBatchService.markAllConfigAsSentForNode(processedNode.getNodeId()); - extractConfiguration(out, processedNode); + extractConfiguration(out, processedNode); } return processedNode.isSyncEnabled(); diff --git a/symmetric-core/src/main/resources/symmetric-default.properties b/symmetric-core/src/main/resources/symmetric-default.properties index 7dba068826..77fd70ecc6 100644 --- a/symmetric-core/src/main/resources/symmetric-default.properties +++ b/symmetric-core/src/main/resources/symmetric-default.properties @@ -500,6 +500,14 @@ registration.reopen.use.same.password=true # Type: boolean registration.reinitialize.enable=false + +# When this is set to true a node will have to have had an initial load prior to allowing other nodes to register with it +# +# DatabaseOverridable: true +# Tags: registration +# Type: boolean +registration.require.initial.load=true + # Initial load and reload events should normally block other channels to ensure each table # is loaded first followed by changes captured during the initial load. Setting this to false # will allow all channels to load in priority order even when reload events or