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
ConstructorsConstructorDescriptionOutgoingBatchService(IParameterService parameterService, ISymmetricDialect symmetricDialect, INodeService nodeService, IConfigurationService configurationService, ISequenceService sequenceService, IClusterService clusterService, IExtensionService extensionService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanareAllLoadBatchesComplete(String nodeId) protected StringBuilderbuildStatusList(Object[] args, AbstractBatch.Status... statuses) intcancelLoadBatches(long loadId) protected booleancontainsOnlyStatus(AbstractBatch.Status status, List<AbstractBatch.Status> statuses) voidcopyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId) intcountOutgoingBatches(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads) intintcountOutgoingBatchesInError(String channelId) intintcountOutgoingBatchesUnsent(String channelId) intintint[]intcountUnsentBatchesByTargetNode(String nodeId, boolean includeHeartbeats) longcountUnsentRowsByTargetNode(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) voidinsertOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch) voidinsertOutgoingBatch(OutgoingBatch outgoingBatch) voidinsertOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize, boolean isCommon) booleaninTimeWindow(List<NodeGroupChannelWindow> windows, String targetNodeId) IfNodeGroupChannelWindows 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.booleanisInitialLoadComplete(String nodeId) booleanisUnsentDataOnChannelForNode(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) voidmarkAllAsSentForNode(String nodeId, boolean includeConfigChannel) voidmarkAllConfigAsSentForNode(String nodeId) toStringList(List<AbstractBatch.Status> statuses) voidvoidupdateCommonBatchExtractStatistics(OutgoingBatch outgoingBatch) voidupdateOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch) voidupdateOutgoingBatch(OutgoingBatch outgoingBatch) voidupdateOutgoingBatches(List<OutgoingBatch> outgoingBatches) voidupdateOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize) voidupdateOutgoingBatchStatus(ISqlTransaction transaction, AbstractBatch.Status status, String nodeId, long startBatchId, long endBatchId) voidupdateOutgoingError(long batchId, String nodeId) voidupdateOutgoingFinalizeBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long minBatchId, String fromStatus, String toStatus) voidupdateOutgoingLoadBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long startDataBatchId, long endDataBatchId, String fromStatus, String toStatus) voidupdateOutgoingSetupBatchStatusByStatus(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
public OutgoingBatchService(IParameterService parameterService, ISymmetricDialect symmetricDialect, INodeService nodeService, IConfigurationService configurationService, ISequenceService sequenceService, IClusterService clusterService, IExtensionService extensionService)
-
-
Method Details
-
updateOutgoingError
- Specified by:
updateOutgoingErrorin interfaceIOutgoingBatchService
-
cancelLoadBatches
public int cancelLoadBatches(long loadId) - Specified by:
cancelLoadBatchesin interfaceIOutgoingBatchService
-
markAllAsSentForNode
- Specified by:
markAllAsSentForNodein interfaceIOutgoingBatchService
-
markAllConfigAsSentForNode
- Specified by:
markAllConfigAsSentForNodein interfaceIOutgoingBatchService
-
copyOutgoingBatches
public void copyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId) - Specified by:
copyOutgoingBatchesin interfaceIOutgoingBatchService
-
updateAbandonedRoutingBatches
public void updateAbandonedRoutingBatches()- Specified by:
updateAbandonedRoutingBatchesin interfaceIOutgoingBatchService
-
updateOutgoingBatches
- Specified by:
updateOutgoingBatchesin interfaceIOutgoingBatchService
-
updateOutgoingBatch
- Specified by:
updateOutgoingBatchin interfaceIOutgoingBatchService
-
updateCommonBatchExtractStatistics
- Specified by:
updateCommonBatchExtractStatisticsin interfaceIOutgoingBatchService
-
updateOutgoingBatch
- Specified by:
updateOutgoingBatchin interfaceIOutgoingBatchService
-
updateOutgoingBatches
public void updateOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize) - Specified by:
updateOutgoingBatchesin interfaceIOutgoingBatchService
-
updateOutgoingBatchStatus
public void updateOutgoingBatchStatus(ISqlTransaction transaction, AbstractBatch.Status status, String nodeId, long startBatchId, long endBatchId) - Specified by:
updateOutgoingBatchStatusin interfaceIOutgoingBatchService
-
updateOutgoingSetupBatchStatusByStatus
public void updateOutgoingSetupBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long maxBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingSetupBatchStatusByStatusin interfaceIOutgoingBatchService
-
updateOutgoingLoadBatchStatusByStatus
public void updateOutgoingLoadBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long startDataBatchId, long endDataBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingLoadBatchStatusByStatusin interfaceIOutgoingBatchService
-
updateOutgoingFinalizeBatchStatusByStatus
public void updateOutgoingFinalizeBatchStatusByStatus(ISqlTransaction transaction, String targetNodeId, long loadId, long minBatchId, String fromStatus, String toStatus) - Specified by:
updateOutgoingFinalizeBatchStatusByStatusin interfaceIOutgoingBatchService
-
insertOutgoingBatch
- Specified by:
insertOutgoingBatchin interfaceIOutgoingBatchService
-
insertOutgoingBatch
- Specified by:
insertOutgoingBatchin interfaceIOutgoingBatchService
-
insertOutgoingBatches
public void insertOutgoingBatches(ISqlTransaction transaction, List<OutgoingBatch> batches, int flushSize, boolean isCommon) - Specified by:
insertOutgoingBatchesin interfaceIOutgoingBatchService
-
findOutgoingBatch
- Specified by:
findOutgoingBatchin interfaceIOutgoingBatchService
-
countOutgoingBatchesInError
public int countOutgoingBatchesInError()- Specified by:
countOutgoingBatchesInErrorin interfaceIOutgoingBatchService
-
countOutgoingBatchesInError
- Specified by:
countOutgoingBatchesInErrorin interfaceIOutgoingBatchService
-
getOutgoingBatchesLatestUpdateSql
- Specified by:
getOutgoingBatchesLatestUpdateSqlin interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsent
public int countOutgoingBatchesUnsent()- Specified by:
countOutgoingBatchesUnsentin interfaceIOutgoingBatchService
-
countOutgoingNonSystemBatchesRowsUnsent
public int[] countOutgoingNonSystemBatchesRowsUnsent()- Specified by:
countOutgoingNonSystemBatchesRowsUnsentin interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsent
- Specified by:
countOutgoingBatchesUnsentin interfaceIOutgoingBatchService
-
countOutgoingBatchesUnsentHeartbeat
public int countOutgoingBatchesUnsentHeartbeat()- Specified by:
countOutgoingBatchesUnsentHeartbeatin interfaceIOutgoingBatchService
-
countOutgoingBatchesPendingByChannel
- Specified by:
countOutgoingBatchesPendingByChannelin interfaceIOutgoingBatchService
-
countUnsentBatchesByTargetNode
- Specified by:
countUnsentBatchesByTargetNodein interfaceIOutgoingBatchService
-
countUnsentRowsByTargetNode
- Specified by:
countUnsentRowsByTargetNodein interfaceIOutgoingBatchService
-
countOutgoingBatches
public int countOutgoingBatches(List<String> nodeIds, List<String> channels, List<AbstractBatch.Status> statuses, List<Long> loads) - Specified by:
countOutgoingBatchesin 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:
listOutgoingBatchesin interfaceIOutgoingBatchService
-
listOutgoingBatchesWithLimit
public List<OutgoingBatch> listOutgoingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter, String orderColumn, String orderDirection) - Specified by:
listOutgoingBatchesWithLimitin interfaceIOutgoingBatchService
-
countOutgoingBatchesWithLimit
- Specified by:
countOutgoingBatchesWithLimitin 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:
getOutgoingBatchesin interfaceIOutgoingBatchService
-
getOutgoingBatches
public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, boolean includeDisabledChannels) - Specified by:
getOutgoingBatchesin interfaceIOutgoingBatchService
-
getOutgoingBatches
public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, NodeGroupLinkAction eventAction, NodeGroupLinkAction defaultEventAction, boolean includeDisabledChannels) - Specified by:
getOutgoingBatchesin interfaceIOutgoingBatchService
-
getBatchesForChannelWindows
public List<OutgoingBatch> getBatchesForChannelWindows(OutgoingBatches batches, String targetNodeId, NodeChannel channel, List<NodeGroupChannelWindow> windows) -
inTimeWindow
IfNodeGroupChannelWindows 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:
getOutgoingBatchRangein interfaceIOutgoingBatchService
-
getOutgoingBatchRange
- Specified by:
getOutgoingBatchRangein interfaceIOutgoingBatchService
-
getOutgoingBatchByLoad
- Specified by:
getOutgoingBatchByLoadin interfaceIOutgoingBatchService
-
getOutgoingBatchByLoadRangeAndTable
public OutgoingBatches getOutgoingBatchByLoadRangeAndTable(long loadId, long startBatchId, long endBatchId, String tableName) - Specified by:
getOutgoingBatchByLoadRangeAndTablein interfaceIOutgoingBatchService
-
getOutgoingBatchErrors
- Specified by:
getOutgoingBatchErrorsin interfaceIOutgoingBatchService
-
getNodesInError
- Specified by:
getNodesInErrorin interfaceIOutgoingBatchService
-
getNextOutgoingBatchForEachNode
-
isInitialLoadComplete
- Specified by:
isInitialLoadCompletein interfaceIOutgoingBatchService
-
areAllLoadBatchesComplete
- Specified by:
areAllLoadBatchesCompletein interfaceIOutgoingBatchService
-
isUnsentDataOnChannelForNode
- Specified by:
isUnsentDataOnChannelForNodein interfaceIOutgoingBatchService
-
buildStatusList
-
findOutgoingBatchSummaryByNode
public List<OutgoingBatchSummary> findOutgoingBatchSummaryByNode(String nodeId, Date sinceCreateTime, AbstractBatch.Status... statuses) - Specified by:
findOutgoingBatchSummaryByNodein interfaceIOutgoingBatchService
-
findOutgoingBatchSummary
- Specified by:
findOutgoingBatchSummaryin interfaceIOutgoingBatchService
-
findOutgoingBatchSummaryByChannel
public List<OutgoingBatchSummary> findOutgoingBatchSummaryByChannel(AbstractBatch.Status... statuses) - Specified by:
findOutgoingBatchSummaryByChannelin interfaceIOutgoingBatchService
-
getAllBatches
- Specified by:
getAllBatchesin interfaceIOutgoingBatchService
-
getBatchesInProgress
- Specified by:
getBatchesInProgressin interfaceIOutgoingBatchService
-