Skip to content

Commit

Permalink
0003203: list outgoing batches query does not work on Sybase ASE when a
Browse files Browse the repository at this point in the history
load is specified
  • Loading branch information
maxwellpettit committed Aug 1, 2017
1 parent 0679d7e commit 63bdc64
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 163 deletions.
@@ -1,79 +1,79 @@
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.jumpmind.symmetric.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.symmetric.model.BatchId;
import org.jumpmind.symmetric.model.IncomingBatch;

/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.jumpmind.symmetric.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.symmetric.model.BatchId;
import org.jumpmind.symmetric.model.IncomingBatch;

/**
* This service provides an API to access to the incoming batch table.
*/
public interface IIncomingBatchService {

public List<String> getNodesInError();
public interface IIncomingBatchService {

public List<String> getNodesInError();

public int countIncomingBatchesInError();

public int countIncomingBatchesInError(String channelId);

public IncomingBatch findIncomingBatch(long batchId, String nodeId);

public void refreshIncomingBatch(IncomingBatch batch);

public List<IncomingBatch> findIncomingBatchErrors(int maxRows);

public boolean acquireIncomingBatch(IncomingBatch batch);

public void insertIncomingBatch(ISqlTransaction transaction, IncomingBatch batch);


public IncomingBatch findIncomingBatch(long batchId, String nodeId);

public void refreshIncomingBatch(IncomingBatch batch);

public List<IncomingBatch> findIncomingBatchErrors(int maxRows);

public boolean acquireIncomingBatch(IncomingBatch batch);

public void insertIncomingBatch(ISqlTransaction transaction, IncomingBatch batch);

public void insertIncomingBatch(IncomingBatch batch);

public int updateIncomingBatch(ISqlTransaction transaction, IncomingBatch batch);
public int updateIncomingBatch(ISqlTransaction transaction, IncomingBatch batch);

public int updateIncomingBatch(IncomingBatch batch);

public int deleteIncomingBatch(IncomingBatch batch);

public List<Date> listIncomingBatchTimes(List<String> nodeIds, List<String> channels,
List<IncomingBatch.Status> statuses, List<String> loads, boolean ascending);
List<IncomingBatch.Status> statuses, List<Long> loads, boolean ascending);

public List<IncomingBatch> listIncomingBatches(List<String> nodeIds, List<String> channels,
List<IncomingBatch.Status> statuses, List<String> loads, Date startAtCreateTime, int maxRowsToRetrieve, boolean ascending);
List<IncomingBatch.Status> statuses, List<Long> loads, Date startAtCreateTime, int maxRowsToRetrieve, boolean ascending);

public void markIncomingBatchesOk(String nodeId);

public void markIncomingBatchesOk(String nodeId);

public void removingIncomingBatches(String nodeId);

public List<IncomingBatch> listIncomingBatchesInErrorFor(String nodeId);

public List<IncomingBatch> listIncomingBatchesInErrorFor(String nodeId);

public boolean isRecordOkBatchesEnabled();

public Map<String,BatchId> findMaxBatchIdsByChannel();

public List<BatchId> getAllBatches();


public Map<String,BatchId> findMaxBatchIdsByChannel();

public List<BatchId> getAllBatches();

}
@@ -1,124 +1,124 @@
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.jumpmind.symmetric.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.symmetric.model.LoadSummary;
import org.jumpmind.symmetric.model.NodeGroupLinkAction;
import org.jumpmind.symmetric.model.OutgoingBatch;
import org.jumpmind.symmetric.model.OutgoingBatchSummary;
import org.jumpmind.symmetric.model.OutgoingBatches;
import org.jumpmind.symmetric.model.OutgoingLoadSummary;
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.jumpmind.symmetric.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.symmetric.model.LoadSummary;
import org.jumpmind.symmetric.model.NodeGroupLinkAction;
import org.jumpmind.symmetric.model.OutgoingBatch;
import org.jumpmind.symmetric.model.OutgoingBatchSummary;
import org.jumpmind.symmetric.model.OutgoingBatches;
import org.jumpmind.symmetric.model.OutgoingLoadSummary;
import org.jumpmind.symmetric.service.impl.OutgoingBatchService.LoadStatusSummary;

/**
* This service provides an API to access to the outgoing batch table.
*/
public interface IOutgoingBatchService {

public List<String> getNodesInError();

public void markAllAsSentForNode(String nodeId, boolean includeConfigChannel);

public void markAllConfigAsSentForNode(String nodeId);

public void markAllChannelAsSent(String channelId);

public void markAllChannelAsSent(String channelId, String tableName);
public interface IOutgoingBatchService {

public List<String> getNodesInError();

public void markAllAsSentForNode(String nodeId, boolean includeConfigChannel);

public void markAllConfigAsSentForNode(String nodeId);

public void markAllChannelAsSent(String channelId);

public void markAllChannelAsSent(String channelId, String tableName);

public void updateAbandonedRoutingBatches();

public OutgoingBatch findOutgoingBatch(long batchId, String nodeId);

public OutgoingBatches getOutgoingBatches(String nodeId, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatches(String nodeId, String channelId, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, NodeGroupLinkAction eventAction,
NodeGroupLinkAction defaultEventAction, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatchRange(long startBatchId, long endBatchId);

public OutgoingBatches getOutgoingBatchByLoad(long loadI);

public int cancelLoadBatches(long loadId);

public OutgoingBatches getOutgoingBatchRange(String nodeId, Date startDate, Date endDate, String... channels);

public OutgoingBatches getOutgoingBatchErrors(int maxRows);

public List<OutgoingBatch> getNextOutgoingBatchForEachNode();

public boolean isInitialLoadComplete(String nodeId);

public boolean areAllLoadBatchesComplete(String nodeId);

public boolean isUnsentDataOnChannelForNode(String channelId, String nodeId);

public void updateOutgoingBatch(OutgoingBatch batch);

public void updateOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch);

public void updateOutgoingBatches(List<OutgoingBatch> batches);

public OutgoingBatch findOutgoingBatch(long batchId, String nodeId);

public OutgoingBatches getOutgoingBatches(String nodeId, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatches(String nodeId, String channelId, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, NodeGroupLinkAction eventAction,
NodeGroupLinkAction defaultEventAction, boolean includeDisabledChannels);

public OutgoingBatches getOutgoingBatchRange(long startBatchId, long endBatchId);

public OutgoingBatches getOutgoingBatchByLoad(long loadI);

public int cancelLoadBatches(long loadId);

public OutgoingBatches getOutgoingBatchRange(String nodeId, Date startDate, Date endDate, String... channels);

public OutgoingBatches getOutgoingBatchErrors(int maxRows);

public List<OutgoingBatch> getNextOutgoingBatchForEachNode();

public boolean isInitialLoadComplete(String nodeId);

public boolean areAllLoadBatchesComplete(String nodeId);

public boolean isUnsentDataOnChannelForNode(String channelId, String nodeId);

public void updateOutgoingBatch(OutgoingBatch batch);

public void updateOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch);

public void updateOutgoingBatches(List<OutgoingBatch> batches);

public void insertOutgoingBatch(OutgoingBatch outgoingBatch);

public void insertOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch);


public void insertOutgoingBatch(ISqlTransaction transaction, OutgoingBatch outgoingBatch);

public int countOutgoingBatchesInError();

public int countOutgoingBatchesUnsent();

public int countOutgoingBatchesInError(String channelId);

public int countOutgoingBatchesUnsent(String channelId);

public int countOutgoingBatchesUnsent(String channelId);

public Map<String, Integer> countOutgoingBatchesPendingByChannel(String nodeId);

public List<OutgoingBatchSummary> findOutgoingBatchSummary(OutgoingBatch.Status ... statuses);

public int countOutgoingBatches(List<String> nodeIds, List<String> channels,
List<OutgoingBatch.Status> statuses, List<String> loads);
List<OutgoingBatch.Status> statuses, List<Long> loads);

public List<OutgoingBatch> listOutgoingBatches(List<String> nodeIds, List<String> channels,
List<OutgoingBatch.Status> statuses, List<String> loads, long startAtBatchId, int rowsExpected, boolean ascending);

public List<OutgoingLoadSummary> getLoadSummaries(boolean activeOnly);

public Set<Long> getActiveLoads(String sourceNodeId);

public List<String> getQueuedLoads(String sourceNodeId);

public LoadSummary getLoadSummary(long loadId);

public Map<String, Map<String, LoadStatusSummary>> getLoadStatusSummarySql(long loadId);

public void copyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId);

public List<Long> getAllBatches();

List<OutgoingBatch.Status> statuses, List<Long> loads, long startAtBatchId, int rowsExpected, boolean ascending);

public List<OutgoingLoadSummary> getLoadSummaries(boolean activeOnly);

public Set<Long> getActiveLoads(String sourceNodeId);

public List<String> getQueuedLoads(String sourceNodeId);

public LoadSummary getLoadSummary(long loadId);

public Map<String, Map<String, LoadStatusSummary>> getLoadStatusSummarySql(long loadId);

public void copyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId);

public List<Long> getAllBatches();

}
Expand Up @@ -205,7 +205,7 @@ protected boolean isCalledFromSymmetricAdminTool() {
}

protected String buildBatchWhere(List<String> nodeIds, List<String> channels,
List<?> statuses, List<String> loads) {
List<?> statuses, List<Long> loads) {
boolean containsErrorStatus = statuses.contains(OutgoingBatch.Status.ER)
|| statuses.contains(IncomingBatch.Status.ER);
boolean containsIgnoreStatus = statuses.contains(OutgoingBatch.Status.IG)
Expand Down
Expand Up @@ -133,7 +133,7 @@ public boolean isRecordOkBatchesEnabled() {
}

public List<Date> listIncomingBatchTimes(List<String> nodeIds, List<String> channels,
List<IncomingBatch.Status> statuses, List<String> loads, boolean ascending) {
List<IncomingBatch.Status> statuses, List<Long> loads, boolean ascending) {

String whereClause = buildBatchWhere(nodeIds, channels, statuses, loads);

Expand All @@ -149,7 +149,7 @@ 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<String> loads, Date startAtCreateTime,
List<IncomingBatch.Status> statuses, List<Long> loads, Date startAtCreateTime,
final int maxRowsToRetrieve, boolean ascending) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("NODES", nodeIds);
Expand Down

0 comments on commit 63bdc64

Please sign in to comment.