Skip to content

Commit

Permalink
0005500: Registration left pending when client is 3.12 or newer and
Browse files Browse the repository at this point in the history
server is 3.11 or older
  • Loading branch information
erilong committed Oct 3, 2022
1 parent 828742d commit c417a76
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -30,6 +30,7 @@
import org.jumpmind.db.model.Table;
import org.jumpmind.extension.IBuiltInExtensionPoint;
import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.Version;
import org.jumpmind.symmetric.common.ConfigurationChangedHelper;
import org.jumpmind.symmetric.common.Constants;
import org.jumpmind.symmetric.common.ParameterConstants;
Expand All @@ -39,6 +40,7 @@
import org.jumpmind.symmetric.io.data.DataEventType;
import org.jumpmind.symmetric.io.data.writer.DatabaseWriterFilterAdapter;
import org.jumpmind.symmetric.model.IncomingBatch;
import org.jumpmind.symmetric.model.Node;
import org.jumpmind.symmetric.model.NodeSecurity;
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.IParameterService;
Expand Down Expand Up @@ -187,6 +189,17 @@ public void batchCommitted(DataContext context) {
if (context.remove(CTX_KEY_CHANGED_NODE_SECURITY) != null) {
putNodeSecurityIntoContext(context);
}
if (context.getBatch().getBatchId() == Constants.VIRTUAL_BATCH_FOR_REGISTRATION) {
INodeService nodeService = engine.getNodeService();
String nodeId = nodeService.findIdentityNodeId();
Node sourceNode = nodeService.findNode(context.getBatch().getSourceNodeId());
if (nodeId != null && sourceNode != null && Version.isOlderThanVersion(sourceNode.getSymmetricVersion(), "3.12.0")) {
NodeSecurity security = nodeService.findNodeSecurity(nodeId);
if (security != null && (security.isRegistrationEnabled() || security.getRegistrationTime() == null)) {
engine.getRegistrationService().markNodeAsRegistered(nodeId);
}
}
}
}

protected void putNodeIdentityIntoContext(DataContext context) {
Expand Down

0 comments on commit c417a76

Please sign in to comment.