Skip to content

Commit

Permalink
Additional fields in Node for get node status and children status. Ne…
Browse files Browse the repository at this point in the history
…ed to discuss heartbeat...
  • Loading branch information
gwilmer committed Dec 20, 2012
1 parent 6d0913e commit fed42a6
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -692,30 +692,30 @@ private Node nodeImpl(ISymmetricEngine engine) {
NodeSecurity nodeSecurity = nodeService.findNodeSecurity(modelNode.getNodeId());
xmlNode.setName(modelNode.getNodeId());
xmlNode.setExternalId(modelNode.getExternalId());
xmlNode.setRootNode(isRootNode(engine, modelNode));
xmlNode.setSyncUrl(modelNode.getSyncUrl());
xmlNode.setBatchInErrorCount(modelNode.getBatchInErrorCount());
xmlNode.setBatchToSendCount(modelNode.getBatchToSendCount());
xmlNode.setLastHeartbeat(nodeHosts.get(0).getHeartbeatTime());
xmlNode.setRegistered(nodeSecurity.hasRegistered());
xmlNode.setInitialLoaded(nodeSecurity.hasInitialLoaded());
xmlNode.setRegistered(nodeSecurity.hasReverseInitialLoaded());
xmlNode.setReverseInitialLoaded(nodeSecurity.hasReverseInitialLoaded());
if (modelNode.getCreatedAtNodeId() == null) {
xmlNode.setRootNode(true);
} else {
xmlNode.setRootNode(false);
}

return xmlNode;
}

private boolean isRootNode(ISymmetricEngine engine, org.jumpmind.symmetric.model.Node node) {
boolean isRootNode = false;
INodeService nodeService = engine.getNodeService();
org.jumpmind.symmetric.model.Node modelNode = nodeService.findIdentity();
NetworkedNode rootNode = nodeService.getRootNetworkedNode();
if (rootNode.getNode().equals(modelNode)) {
isRootNode = true;
if (modelNode.getCreatedAtNodeId() == null) {
return true;
} else {
return false;
}
return isRootNode;
}

private NodeStatus nodeStatusImpl(ISymmetricEngine engine) {
Expand All @@ -742,7 +742,7 @@ private NodeStatus nodeStatusImpl(ISymmetricEngine engine) {
status.setDeploymentType(modelNode.getDeploymentType());

if (nodeHost != null && nodeHost.size() > 0) {
status.setLastHeartbeat(nodeHost.get(0).getHeartbeatTime().toString());
status.setLastHeartbeat(nodeHost.get(0).getHeartbeatTime());
}
return status;
}
Expand Down

0 comments on commit fed42a6

Please sign in to comment.