Skip to content

Commit

Permalink
Heartbeat at startup if we haven't heartbeated at all. Check for null…
Browse files Browse the repository at this point in the history
… node attributes in the infourihandler on node if they haven't been set (by the heartbeat).
  • Loading branch information
chenson42 committed Apr 16, 2013
1 parent fb7f1ef commit 3b4ef23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Expand Up @@ -93,9 +93,8 @@
import org.jumpmind.symmetric.service.impl.DataExtractorService;
import org.jumpmind.symmetric.service.impl.DataLoaderService;
import org.jumpmind.symmetric.service.impl.DataLoaderService.ConflictNodeGroupLink;
import org.jumpmind.symmetric.service.impl.GroupletService;
import org.jumpmind.symmetric.service.impl.TransformService.TransformTableNodeGroupLink;
import org.jumpmind.symmetric.service.impl.DataService;
import org.jumpmind.symmetric.service.impl.GroupletService;
import org.jumpmind.symmetric.service.impl.IncomingBatchService;
import org.jumpmind.symmetric.service.impl.LoadFilterService;
import org.jumpmind.symmetric.service.impl.NodeCommunicationService;
Expand All @@ -110,6 +109,7 @@
import org.jumpmind.symmetric.service.impl.SequenceService;
import org.jumpmind.symmetric.service.impl.StatisticService;
import org.jumpmind.symmetric.service.impl.TransformService;
import org.jumpmind.symmetric.service.impl.TransformService.TransformTableNodeGroupLink;
import org.jumpmind.symmetric.service.impl.TriggerRouterService;
import org.jumpmind.symmetric.statistic.IStatisticManager;
import org.jumpmind.symmetric.statistic.StatisticManager;
Expand Down Expand Up @@ -553,7 +553,7 @@ public synchronized boolean start(boolean startJobs) {
}

if (parameterService
.is(ParameterConstants.HEARTBEAT_SYNC_ON_STARTUP, false)) {
.is(ParameterConstants.HEARTBEAT_SYNC_ON_STARTUP, false) || StringUtils.isBlank(node.getDatabaseType())) {
heartbeat(false);
}

Expand Down
Expand Up @@ -74,10 +74,20 @@ public void handle(HttpServletRequest req, HttpServletResponse res) throws IOExc

if (node != null) {
properties.setProperty(InfoConstants.NODE_ID, node.getNodeId());
properties.setProperty(InfoConstants.DATABASE_TYPE, node.getDatabaseType());
properties.setProperty(InfoConstants.DATABASE_VERSION, node.getDatabaseVersion());
properties.setProperty(InfoConstants.DEPLOYMENT_TYPE, node.getDeploymentType());
properties.setProperty(InfoConstants.SYMMETRIC_VERSION, node.getSymmetricVersion());
if (node.getDatabaseType() != null) {
properties.setProperty(InfoConstants.DATABASE_TYPE, node.getDatabaseType());
}

if (node.getDatabaseVersion() != null) {
properties.setProperty(InfoConstants.DATABASE_VERSION, node.getDatabaseVersion());
}
if (node.getDeploymentType() != null) {
properties.setProperty(InfoConstants.DEPLOYMENT_TYPE, node.getDeploymentType());
}

if (node.getSymmetricVersion() != null) {
properties.setProperty(InfoConstants.SYMMETRIC_VERSION, node.getSymmetricVersion());
}
}

properties.store(res.getOutputStream(), "SymmetricDS");
Expand Down

0 comments on commit 3b4ef23

Please sign in to comment.