Skip to content

Commit

Permalink
0005465: Added new methods to get batches
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Sep 22, 2022
1 parent 2b0cc5c commit 62ad086
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
Expand Up @@ -64,6 +64,8 @@ public List<Date> listIncomingBatchTimes(List<String> nodeIds, List<String> chan
public List<IncomingBatch> listIncomingBatches(List<String> nodeIds, List<String> channels,
List<IncomingBatch.Status> statuses, List<Long> loads, Date startAtCreateTime, int maxRowsToRetrieve, boolean ascending);

public List<IncomingBatch> listIncomingBatches(List<FilterCriterion> filter);

public List<IncomingBatch> listIncomingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter,
String orderColumn, String orderDirection);

Expand Down
Expand Up @@ -118,6 +118,8 @@ public int countOutgoingBatches(List<String> nodeIds, List<String> channels,
public List<OutgoingBatch> listOutgoingBatches(List<String> nodeIds, List<String> channels,
List<OutgoingBatch.Status> statuses, List<Long> loads, long startAtBatchId, int rowsExpected, boolean ascending);

public List<OutgoingBatch> listOutgoingBatches(List<FilterCriterion> filter);

public List<OutgoingBatch> listOutgoingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter,
String orderColumn, String orderDirection);

Expand Down
Expand Up @@ -161,6 +161,17 @@ public List<IncomingBatch> listIncomingBatches(List<String> nodeIds, List<String
return sqlTemplateDirty.query(sql, maxRowsToRetrieve, new IncomingBatchMapper(), params);
}

public List<IncomingBatch> listIncomingBatches(List<FilterCriterion> filter) {
String where = filter != null ? buildBatchWhereFromFilter(filter) : null;
Map<String, Object> params = filter != null ? buildBatchParams(filter) : new HashMap<String, Object>();
String sql = getSql("selectIncomingBatchPrefixSql", where);
int maxBatches = parameterService.getInt("batch.screen.max.to.select");
if (maxBatches < 1) {
maxBatches = Integer.MAX_VALUE;
}
return sqlTemplateDirty.query(sql, maxBatches, new IncomingBatchMapper(), params);
}

public List<IncomingBatch> listIncomingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter,
String orderColumn, String orderDirection) {
String where = filter != null ? buildBatchWhereFromFilter(filter) : null;
Expand Down
Expand Up @@ -452,6 +452,17 @@ public List<OutgoingBatch> listOutgoingBatches(List<String> nodeIds, List<String
return sqlTemplateDirty.query(sql, maxRowsToRetrieve, new OutgoingBatchMapper(true), params);
}

public List<OutgoingBatch> listOutgoingBatches(List<FilterCriterion> filter) {
String where = filter != null ? buildBatchWhereFromFilter(filter) : null;
Map<String, Object> params = filter != null ? buildBatchParams(filter) : new HashMap<String, Object>();
String sql = getSql("selectOutgoingBatchPrefixSql", where);
int maxBatches = parameterService.getInt("batch.screen.max.to.select");
if (maxBatches < 1) {
maxBatches = Integer.MAX_VALUE;
}
return sqlTemplateDirty.query(sql, maxBatches, new OutgoingBatchMapper(true), params);
}

public List<OutgoingBatch> listOutgoingBatchesWithLimit(int offset, int limit, List<FilterCriterion> filter,
String orderColumn, String orderDirection) {
String where = filter != null ? buildBatchWhereFromFilter(filter) : null;
Expand Down

0 comments on commit 62ad086

Please sign in to comment.