Class NodeCommunicationService
java.lang.Object
org.jumpmind.symmetric.service.impl.AbstractService
org.jumpmind.symmetric.service.impl.NodeCommunicationService
- All Implemented Interfaces:
INodeCommunicationService
,IService
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jumpmind.symmetric.service.INodeCommunicationService
INodeCommunicationService.INodeCommunicationExecutor
-
Field Summary
Fields inherited from class org.jumpmind.symmetric.service.impl.AbstractService
log, parameterService, platform, sqlTemplate, sqlTemplateDirty, symmetricDialect, tablePrefix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
delete
(NodeCommunication nodeCommunication) boolean
execute
(NodeCommunication nodeCommunication, RemoteNodeStatuses statuses, INodeCommunicationService.INodeCommunicationExecutor executor) protected List<NodeCommunication>
filterForChannelThreading
(List<Node> nodesToCommunicateWith, NodeCommunication.CommunicationType communicationType, IReloadQueueThreadAssigner extension) find
(String nodeId, String queue, NodeCommunication.CommunicationType communicationType) protected List<NodeCommunication>
find
(NodeCommunication.CommunicationType communicationType) int
getAvailableThreads
(NodeCommunication.CommunicationType communicationType) protected ThreadPoolExecutor
getExecutor
(NodeCommunication.CommunicationType communicationType) protected ThreadPoolExecutor
getExecutor
(NodeCommunication.CommunicationType communicationType, String threadChannelId) protected Date
getLockTimeoutDate
(NodeCommunication.CommunicationType communicationType) getNodesToCommunicateWithOffline
(NodeCommunication.CommunicationType communicationType) list
(NodeCommunication.CommunicationType communicationType) protected List<NodeCommunication>
list
(NodeCommunication.CommunicationType communicationType, boolean onlyNodesWithChanges) listAll
(NodeCommunication.CommunicationType communicationType) protected boolean
lock
(NodeCommunication nodeCommunication, Date lockTime) protected void
multiplyNodeCommunicationByQueues
(Node node, List<NodeCommunication> nodeCommunications, HashSet<String> queues) parseQueueToBatchCounts
(String channelToBatchCountsString) void
protected void
removeInvalidQueues
(NodeCommunication.CommunicationType communicationType, List<NodeCommunication> communicationRows, Map<String, NodeCommunication> nodesToCommunicateWithListMap, IReloadQueueThreadAssigner extension) protected List<NodeCommunication>
removeNodesWithNoBatchesToSend
(List<NodeCommunication> nodeCommunications) removeOfflineNodes
(List<Node> nodes) protected void
save
(NodeCommunication nodeCommunication, boolean force) protected void
sortNodeCommunications
(List<NodeCommunication> list, NodeCommunication.CommunicationType communicationType) void
stop()
protected void
unlock
(NodeCommunication nodeCommunication, boolean failed, long ts) void
updateBatchToSendCounts
(String nodeId, Map<String, Integer> batchesCountToQueues) Methods inherited from class org.jumpmind.symmetric.service.impl.AbstractService
assertNotNull, buildBatchOrderBy, buildBatchParams, buildBatchWhere, buildBatchWhereFromFilter, close, createSqlReplacementTokens, getJdbcTemplate, getParameterService, getSql, getSymmetricDialect, getTablePrefix, getTargetDialect, getTargetPlatform, getTargetPlatform, isCalledFromSymmetricAdminTool, isSet, isStreamClosedByClient, isSymmetricTable, logOnce, maxDate, readAcks, sendAck, setSqlMap, synchronize, toNodeIds, toNodeIds
-
Constructor Details
-
NodeCommunicationService
-
-
Method Details
-
persistToTableForSnapshot
public void persistToTableForSnapshot()- Specified by:
persistToTableForSnapshot
in interfaceINodeCommunicationService
-
find
public NodeCommunication find(String nodeId, String queue, NodeCommunication.CommunicationType communicationType) - Specified by:
find
in interfaceINodeCommunicationService
-
find
-
list
- Specified by:
list
in interfaceINodeCommunicationService
-
listAll
- Specified by:
listAll
in interfaceINodeCommunicationService
-
list
protected List<NodeCommunication> list(NodeCommunication.CommunicationType communicationType, boolean onlyNodesWithChanges) -
removeInvalidQueues
protected void removeInvalidQueues(NodeCommunication.CommunicationType communicationType, List<NodeCommunication> communicationRows, Map<String, NodeCommunication> nodesToCommunicateWithListMap, IReloadQueueThreadAssigner extension) -
getNodeIdsWithUnsentCount
-
filterForChannelThreading
protected List<NodeCommunication> filterForChannelThreading(List<Node> nodesToCommunicateWith, NodeCommunication.CommunicationType communicationType, IReloadQueueThreadAssigner extension) -
multiplyNodeCommunicationByQueues
protected void multiplyNodeCommunicationByQueues(Node node, List<NodeCommunication> nodeCommunications, HashSet<String> queues) -
removeOfflineNodes
-
getNodesToCommunicateWithOffline
protected List<Node> getNodesToCommunicateWithOffline(NodeCommunication.CommunicationType communicationType) -
delete
-
save
-
removeNodesWithNoBatchesToSend
protected List<NodeCommunication> removeNodesWithNoBatchesToSend(List<NodeCommunication> nodeCommunications) -
getExecutor
-
getExecutor
protected ThreadPoolExecutor getExecutor(NodeCommunication.CommunicationType communicationType, String threadChannelId) -
getAvailableThreads
- Specified by:
getAvailableThreads
in interfaceINodeCommunicationService
-
getLockTimeoutDate
-
execute
public boolean execute(NodeCommunication nodeCommunication, RemoteNodeStatuses statuses, INodeCommunicationService.INodeCommunicationExecutor executor) - Specified by:
execute
in interfaceINodeCommunicationService
-
lock
-
unlock
-
stop
public void stop()- Specified by:
stop
in interfaceINodeCommunicationService
-
sortNodeCommunications
protected void sortNodeCommunications(List<NodeCommunication> list, NodeCommunication.CommunicationType communicationType) -
updateBatchToSendCounts
- Specified by:
updateBatchToSendCounts
in interfaceINodeCommunicationService
-
parseQueueToBatchCounts
- Specified by:
parseQueueToBatchCounts
in interfaceINodeCommunicationService
-