Search in sources :

Example 46 with Trigger

use of org.jumpmind.symmetric.model.Trigger in project symmetric-ds by JumpMind.

the class DataService method insertDataAndDataEventAndOutgoingBatch.

/**
 * @return The inserted batch id
 */
public long insertDataAndDataEventAndOutgoingBatch(ISqlTransaction transaction, Data data, String nodeId, String routerId, boolean isLoad, long loadId, String createBy, Status status) {
    long dataId = insertData(transaction, data);
    String channelId = null;
    if (isLoad) {
        TriggerHistory history = data.getTriggerHistory();
        if (history != null && channelId == null) {
            Trigger trigger = engine.getTriggerRouterService().getTriggerById(true, history.getTriggerId());
            channelId = getReloadChannelIdForTrigger(trigger, engine.getConfigurationService().getChannels(false));
        }
    } else {
        channelId = data.getChannelId();
    }
    return insertDataEventAndOutgoingBatch(transaction, dataId, channelId, nodeId, data.getDataEventType(), routerId, isLoad, loadId, createBy, status);
}
Also used : Trigger(org.jumpmind.symmetric.model.Trigger) TriggerHistory(org.jumpmind.symmetric.model.TriggerHistory)

Aggregations

Trigger (org.jumpmind.symmetric.model.Trigger)46 TriggerRouter (org.jumpmind.symmetric.model.TriggerRouter)21 ArrayList (java.util.ArrayList)17 TriggerHistory (org.jumpmind.symmetric.model.TriggerHistory)15 Router (org.jumpmind.symmetric.model.Router)14 ITriggerRouterService (org.jumpmind.symmetric.service.ITriggerRouterService)11 Test (org.junit.Test)11 Table (org.jumpmind.db.model.Table)6 Date (java.util.Date)5 CsvData (org.jumpmind.symmetric.io.data.CsvData)5 Data (org.jumpmind.symmetric.model.Data)5 Node (org.jumpmind.symmetric.model.Node)5 HashMap (java.util.HashMap)4 HashSet (java.util.HashSet)4 ISqlTransaction (org.jumpmind.db.sql.ISqlTransaction)4 LinkedHashMap (java.util.LinkedHashMap)3 Set (java.util.Set)3 ISymmetricDialect (org.jumpmind.symmetric.db.ISymmetricDialect)3 NodeGroupLink (org.jumpmind.symmetric.model.NodeGroupLink)3 INodeService (org.jumpmind.symmetric.service.INodeService)3