Class OutgoingBatchService
java.lang.Object
org.jumpmind.symmetric.service.impl.AbstractService
org.jumpmind.symmetric.service.impl.OutgoingBatchService
- All Implemented Interfaces:
IOutgoingBatchService
,IService
- See Also:
-
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
areAllLoadBatchesComplete
(String nodeId) protected StringBuilder
buildStatusList
(Object[] args, AbstractBatch.Status... statuses) int
cancelLoadBatches
(long loadId) protected boolean
containsOnlyStatus
(AbstractBatch.Status status, List<AbstractBatch.Status> statuses) void
copyOutgoingBatches
(String channelId, long startBatchId, String fromNodeId, String toNodeId) int
countOutgoingBatches
(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads) int
int
countOutgoingBatchesInError
(String channelId) int
int
countOutgoingBatchesUnsent
(String channelId) int
int
int[]
int
countUnsentBatchesByTargetNode
(String nodeId, boolean includeHeartbeats) long
countUnsentRowsByTargetNode
(String nodeId) findOutgoingBatch
(long batchId, String nodeId) findOutgoingBatchSummary
(AbstractBatch.Status... statuses) findOutgoingBatchSummaryByChannel
(AbstractBatch.Status... statuses) findOutgoingBatchSummaryByNode
(String nodeId, Date sinceCreateTime, AbstractBatch.Status... statuses) getBatchesForChannelWindows
(OutgoingBatches batches, String targetNodeId, NodeChannel channel, List<NodeGroupChannelWindow> windows) getOutgoingBatchByLoad
(long loadId) getOutgoingBatchByLoadRangeAndTable
(long loadId, long startBatchId, long endBatchId, String tableName) getOutgoingBatchErrors
(int maxRows) getOutgoingBatches
(String nodeId, boolean includeDisabledChannels) Select batches to process.getOutgoingBatches
(String nodeId, String channelThread, boolean includeDisabledChannels) getOutgoingBatches
(String nodeId, String channelThread, NodeGroupLinkAction eventAction, NodeGroupLinkAction defaultEventAction, boolean includeDisabledChannels) getOutgoingBatchRange
(long startBatchId, long endBatchId) getOutgoingBatchRange
(String nodeId, Date startDate, Date endDate, String... channels) getReadyQueues
(boolean refreshCache) getReadyQueues
(String nodeId, boolean refreshCache) void
insertOutgoingBatch
(ISqlTransaction transaction, OutgoingBatch outgoingBatch) void
insertOutgoingBatch
(OutgoingBatch outgoingBatch) void
insertOutgoingBatches
(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize, boolean isCommon) boolean
inTimeWindow
(List<NodeGroupChannelWindow> windows, String targetNodeId) IfNodeGroupChannelWindow
s are defined for this channel, then check to see if the time (according to the offset passed in) is within on of the configured windows.boolean
isInitialLoadComplete
(String nodeId) boolean
isUnsentDataOnChannelForNode
(String channelId, String nodeId) listOutgoingBatches
(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads, long startAtBatchId, Date startAtLastUpdateTime, int maxRowsToRetrieve, boolean ascending) listOutgoingBatchesWithLimit
(int offset, int limit, List<FilterCriterion> filter, String orderColumn, String orderDirection) void
markAllAsSentForNode
(String nodeId, boolean includeConfigChannel) void
markAllConfigAsSentForNode
(String nodeId) toStringList
(List<AbstractBatch.Status> statuses) void
void
updateCommonBatchExtractStatistics
(OutgoingBatch outgoingBatch) void
updateOutgoingBatch
(ISqlTransaction transaction, OutgoingBatch outgoingBatch) void
updateOutgoingBatch
(OutgoingBatch outgoingBatch) void
updateOutgoingBatches
(List<OutgoingBatch> outgoingBatches) void
updateOutgoingBatches
(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize) void
updateOutgoingBatchStatus
(ISqlTransaction transaction, AbstractBatch.Status status, String nodeId, long startBatchId, long endBatchId) void
updateOutgoingError
(long batchId, String nodeId) void
updateOutgoingFinalizeBatchStatusByStatus
(ISqlTransaction transaction, String targetNodeId, long loadId, long minBatchId, String fromStatus, String toStatus) void
updateOutgoingLoadBatchStatusByStatus
(ISqlTransaction transaction, String targetNodeId, long loadId, long startDataBatchId, long endDataBatchId, String fromStatus, String toStatus) void
updateOutgoingSetupBatchStatusByStatus
(ISqlTransaction transaction, String targetNodeId, long loadId, long maxBatchId, String fromStatus, String toStatus) 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
-
OutgoingBatchService
-
-
Method Details
-
updateOutgoingError
- Specified by:
updateOutgoingError
in interfaceIOutgoingBatchService
-
cancelLoadBatches
public int cancelLoadBatches(long loadId) - Specified by:
cancelLoadBatches
in interfaceIOutgoingBatchService
-
markAllAsSentForNode
- Specified by:
markAllAsSentForNode
in interfaceIOutgoingBatchService
-
markAllConfigAsSentForNode
- Specified by:
markAllConfigAsSentForNode
in interfaceIOutgoingBatchService
-
copyOutgoingBatches
public void copyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId) - Specified by:
copyOutgoingBatches
in interfaceIOutgoingBatchService
-
updateAbandonedRoutingBatches
public void updateAbandonedRoutingBatches()- Specified by:
updateAbandonedRoutingBatches
in interfaceIOutgoingBatchService
-
updateOutgoingBatches
- Specified by:
updateOutgoingBatches
in interfaceIOutgoingBatchService
-
updateOutgoingBatch
- Specified by:
updateOutgoingBatch
in interfaceIOutgoingBatchService
-
updateCommonBatchExtractStatistics
- Specified by:
updateCommonBatchExtractStatistics
in interfaceIOutgoingBatchService
-
updateOutgoingBatch
- Specified by:
updateOutgoingBatch
in interfaceIOutgoingBatchService
-
updateOutgoingBatches
public void updateOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize) - Specified by:
updateOutgoingBatches
in interfaceIOutgoingBatchService
-
updateOutgoingBatchStatus
public void updateOutgoingBatchStatus(ISqlTransaction transaction, AbstractBatch.Status status, String nodeId, long startBatchId, long endBatchId) - Specified by:
updateOutgoingBatchStatus
in interfaceIOutgoingBatchService
-
updateOutgoingSetupBatchStatusByStatus
public void updateOutgoingSetupBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long maxBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingSetupBatchStatusByStatus
in interfaceIOutgoingBatchService
-
updateOutgoingLoadBatchStatusByStatus
public void updateOutgoingLoadBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long startDataBatchId, long endDataBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingLoadBatchStatusByStatus
in interfaceIOutgoingBatchService
-
updateOutgoingFinalizeBatchStatusByStatus
public void updateOutgoingFinalizeBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long minBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingFinalizeBatchStatusByStatus
in interfaceIOutgoingBatchService
-
insertOutgoingBatch
- Specified by:
insertOutgoingBatch
in interfaceIOutgoingBatchService
-
insertOutgoingBatch
- Specified by:
insertOutgoingBatch
in interfaceIOutgoingBatchService
-
insertOutgoingBatches
public void insertOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize, boolean isCommon) - Specified by:
insertOutgoingBatches
in interfaceIOutgoingBatchService
-
findOutgoingBatch
- Specified by:
findOutgoingBatch
in interfaceIOutgoingBatchService
-
countOutgoingBatchesInError
public int countOutgoingBatchesInError()- Specified by:
countOutgoingBatchesInError
in interfaceIOutgoingBatchService
-
countOutgoingBatchesInError
- Specified by:
countOutgoingBatchesInError
in interfaceIOutgoingBatchService
-
getOutgoingBatchesLatestUpdateSql
- Specified by:
getOutgoingBatchesLatestUpdateSql
in interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsent
public int countOutgoingBatchesUnsent()- Specified by:
countOutgoingBatchesUnsent
in interfaceIOutgoingBatchService
-
countOutgoingNonSystemBatchesRowsUnsent
public int[] countOutgoingNonSystemBatchesRowsUnsent()- Specified by:
countOutgoingNonSystemBatchesRowsUnsent
in interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsent
- Specified by:
countOutgoingBatchesUnsent
in interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsentHeartbeat
public int countOutgoingBatchesUnsentHeartbeat()- Specified by:
countOutgoingBatchesUnsentHeartbeat
in interfaceIOutgoingBatchService
-
countOutgoingBatchesPendingByChannel
- Specified by:
countOutgoingBatchesPendingByChannel
in interfaceIOutgoingBatchService
-
countUnsentBatchesByTargetNode
- Specified by:
countUnsentBatchesByTargetNode
in interfaceIOutgoingBatchService
-
countUnsentRowsByTargetNode
- Specified by:
countUnsentRowsByTargetNode
in interfaceIOutgoingBatchService
-
countOutgoingBatches
public int countOutgoingBatches(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads) - Specified by:
countOutgoingBatches
in interfaceIOutgoingBatchService
-
listOutgoingBatches
public List<OutgoingBatch> listOutgoingBatches(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads, long startAtBatchId, Date startAtLastUpdateTime, int maxRowsToRetrieve, boolean ascending) - Specified by:
listOutgoingBatches
in interfaceIOutgoingBatchService
-
listOutgoingBatchesWithLimit
public List<OutgoingBatch> listOutgoingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter, String orderColumn, String orderDirection) - Specified by:
listOutgoingBatchesWithLimit
in interfaceIOutgoingBatchService
-
countOutgoingBatchesWithLimit
- Specified by:
countOutgoingBatchesWithLimit
in interfaceIOutgoingBatchService
-
toStringList
-
containsOnlyStatus
protected boolean containsOnlyStatus(AbstractBatch.Status status, List<AbstractBatch.Status> statuses) -
getOutgoingBatches
Select batches to process. Batches that are NOT in error will be returned first. They will be ordered by batch id as the batches will have already been created by#buildOutgoingBatches(String)
in channel priority order.- Specified by:
getOutgoingBatches
in interfaceIOutgoingBatchService
-
getOutgoingBatches
public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, boolean includeDisabledChannels) - Specified by:
getOutgoingBatches
in interfaceIOutgoingBatchService
-
getOutgoingBatches
public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, NodeGroupLinkAction eventAction, NodeGroupLinkAction defaultEventAction, boolean includeDisabledChannels) - Specified by:
getOutgoingBatches
in interfaceIOutgoingBatchService
-
getBatchesForChannelWindows
public List<OutgoingBatch> getBatchesForChannelWindows(OutgoingBatches batches, String targetNodeId, NodeChannel channel, List<NodeGroupChannelWindow> windows) -
inTimeWindow
IfNodeGroupChannelWindow
s are defined for this channel, then check to see if the time (according to the offset passed in) is within on of the configured windows. -
getOutgoingBatchRange
public OutgoingBatches getOutgoingBatchRange(String nodeId, Date startDate, Date endDate, String... channels) - Specified by:
getOutgoingBatchRange
in interfaceIOutgoingBatchService
-
getOutgoingBatchRange
- Specified by:
getOutgoingBatchRange
in interfaceIOutgoingBatchService
-
getOutgoingBatchByLoad
- Specified by:
getOutgoingBatchByLoad
in interfaceIOutgoingBatchService
-
getOutgoingBatchByLoadRangeAndTable
public OutgoingBatches getOutgoingBatchByLoadRangeAndTable(long loadId, long startBatchId, long endBatchId, String tableName) - Specified by:
getOutgoingBatchByLoadRangeAndTable
in interfaceIOutgoingBatchService
-
getOutgoingBatchErrors
- Specified by:
getOutgoingBatchErrors
in interfaceIOutgoingBatchService
-
getNodesInError
- Specified by:
getNodesInError
in interfaceIOutgoingBatchService
-
getNextOutgoingBatchForEachNode
-
isInitialLoadComplete
- Specified by:
isInitialLoadComplete
in interfaceIOutgoingBatchService
-
areAllLoadBatchesComplete
- Specified by:
areAllLoadBatchesComplete
in interfaceIOutgoingBatchService
-
isUnsentDataOnChannelForNode
- Specified by:
isUnsentDataOnChannelForNode
in interfaceIOutgoingBatchService
-
buildStatusList
-
findOutgoingBatchSummaryByNode
public List<OutgoingBatchSummary> findOutgoingBatchSummaryByNode(String nodeId, Date sinceCreateTime, AbstractBatch.Status... statuses) - Specified by:
findOutgoingBatchSummaryByNode
in interfaceIOutgoingBatchService
-
findOutgoingBatchSummary
- Specified by:
findOutgoingBatchSummary
in interfaceIOutgoingBatchService
-
findOutgoingBatchSummaryByChannel
public List<OutgoingBatchSummary> findOutgoingBatchSummaryByChannel(AbstractBatch.Status... statuses) - Specified by:
findOutgoingBatchSummaryByChannel
in interfaceIOutgoingBatchService
-
getAllBatches
- Specified by:
getAllBatches
in interfaceIOutgoingBatchService
-
getBatchesInProgress
- Specified by:
getBatchesInProgress
in interfaceIOutgoingBatchService
-
getReadyQueues
- Specified by:
getReadyQueues
in interfaceIOutgoingBatchService
-
getReadyQueues
- Specified by:
getReadyQueues
in interfaceIOutgoingBatchService
-
getReadyChannelsFromDb
- Specified by:
getReadyChannelsFromDb
in interfaceIOutgoingBatchService
-