public List<Data> listData(long batchId, String nodeId, long startDataId, String channelId, final int maxRowsToRetrieve) { return sqlTemplate.query(getDataSelectSql(batchId, startDataId, channelId), maxRowsToRetrieve, this.dataMapper, batchId, nodeId, startDataId); }
public TriggerRouter findTriggerRouterById(String triggerId, String routerId) { List<TriggerRouter> configs = (List<TriggerRouter>) sqlTemplate.query( getTriggerRouterSql("selectTriggerRouterSql"), new TriggerRouterMapper(), triggerId, routerId); if (configs.size() > 0) { return configs.get(0); } else { return null; } }
public Map<Long, TriggerHistory> getHistoryRecords() { final Map<Long, TriggerHistory> retMap = new HashMap<Long, TriggerHistory>(); sqlTemplate.query(getSql("allTriggerHistSql"), new TriggerHistoryMapper(retMap)); return retMap; }
public List<ConflictNodeGroupLink> getConflictSettingsNodeGroupLinks() { List<ConflictNodeGroupLink> list = new ArrayList<DataLoaderService.ConflictNodeGroupLink>(); list = sqlTemplate.query(getSql("selectConflictSettingsSql"), new ConflictSettingsNodeGroupLinkMapper()); return list; }
/** * Get a list of trigger histories that are currently active */ public List<TriggerHistory> getActiveTriggerHistories() { return sqlTemplate.query(getSql("allTriggerHistSql", "activeTriggerHistSql"), new TriggerHistoryMapper()); }
public List<NodeGroupChannelWindow> getNodeGroupChannelWindows(String nodeGroupId, String channelId) { return (List<NodeGroupChannelWindow>) sqlTemplate.query( getSql("selectNodeGroupChannelWindowSql"), new NodeGroupChannelWindowMapper(), nodeGroupId, channelId); }
public List<JobStats> getJobStatsForPeriod(Date start, Date end, String nodeId) { return sqlTemplate.query(getSql("selectChannelStatsSql"), new JobStatsMapper(), start, end, nodeId); }
public List<String> transform(IDatabasePlatform platform, DataContext context, TransformColumn column, TransformedData data, Map<String, String> sourceValues, String newValue, String oldValue) throws IgnoreColumnException, IgnoreRowException { return platform.getSqlTemplate().query(column.getTransformExpression(), rowMapper, sourceValues); }
public List<TriggerRouter> getAllTriggerRoutersForReloadForCurrentNode( String sourceNodeGroupId, String targetNodeGroupId) { return sqlTemplate.query( getTriggerRouterSql("activeTriggersForReloadSql"), new TriggerRouterMapper(), sourceNodeGroupId, targetNodeGroupId, Constants.CHANNEL_CONFIG); }
public List<Date> listIncomingBatchTimes(List<String> nodeIds, List<String> channels, List<IncomingBatch.Status> statuses, boolean ascending) { String whereClause = buildBatchWhere(nodeIds, channels, statuses); Map<String, Object> params = new HashMap<String, Object>(); params.put("NODES", nodeIds); params.put("CHANNELS", channels); params.put("STATUSES", toStringList(statuses)); String sql = getSql("selectCreateTimePrefixSql", whereClause, ascending ? " order by create_time" : " order by create_time desc"); return sqlTemplate.query(sql, new DateMapper(), params); }
public String getRedirectionUrlFor(String externalId) { List<String> list = sqlTemplate.query(getSql("getRegistrationRedirectUrlSql"), new StringMapper(), new Object[] { externalId }, new int[] { Types.VARCHAR }); if (list.size() > 0) { return transportManager.resolveURL(list.get(0), parameterService.getRegistrationUrl()); } else { return null; } }
public OutgoingBatches getOutgoingBatchRange(String nodeId, Date startDate, Date endDate, String... channels) { OutgoingBatches batches = new OutgoingBatches(); List<OutgoingBatch> batchList = new ArrayList<OutgoingBatch>(); for (String channel : channels) { batchList.addAll(sqlTemplate.query( getSql("selectOutgoingBatchPrefixSql", "selectOutgoingBatchTimeRangeSql"), new OutgoingBatchMapper(true), nodeId, channel, startDate, endDate)); } batches.setBatches(batchList); return batches; }
public List<FileTriggerRouter> getFileTriggerRoutersForCurrentNode() { return sqlTemplate.query( getSql("selectFileTriggerRoutersSql", "fileTriggerRoutersForCurrentNodeWhere"), new FileTriggerRouterMapper(), parameterService.getNodeGroupId()); }
/** * Lookup a node in the database, which contains information for syncing * with it. */ public Node findNode(String id) { List<Node> list = sqlTemplate.query(getSql("selectNodePrefixSql", "findNodeSql"), new NodeRowMapper(), id); return (Node) getFirstEntry(list); }
public TreeMap<Date, Map<String, ChannelStats>> getChannelStatsForPeriod(Date start, Date end, String nodeId, int periodSizeInMinutes) { List<ChannelStats> list = sqlTemplate.query(getSql("selectChannelStatsSql"), new ChannelStatsMapper(), start, end, nodeId); return new ChannelStatsByPeriodMap(start, end, list, periodSizeInMinutes); }
public List<DataGap> findDataGapsByStatus(DataGap.Status status) { return sqlTemplate.query(getSql("findDataGapsByStatusSql"), new ISqlRowMapper<DataGap>() { public DataGap mapRow(Row rs) { return new DataGap(rs.getLong("start_id"), rs.getLong("end_id"), rs .getDateTime("create_time")); } }, status.name()); }
public List<Node> findSourceNodesFor(NodeGroupLinkAction eventAction) { Node node = findIdentity(); if (node != null) { return sqlTemplate.query(getSql("selectNodePrefixSql", "findNodesWhoTargetMeSql"), new NodeRowMapper(), node.getNodeGroupId(), eventAction.name()); } else { return Collections.emptyList(); } }
public List<Node> findTargetNodesFor(NodeGroupLinkAction eventAction) { Node node = findIdentity(); if (node != null) { return sqlTemplate.query(getSql("selectNodePrefixSql", "findNodesWhoITargetSql"), new NodeRowMapper(), node.getNodeGroupId(), eventAction.name()); } else { return Collections.emptyList(); } }
public OutgoingBatches getOutgoingBatchErrors(int maxRows) { OutgoingBatches batches = new OutgoingBatches(); batches.setBatches(sqlTemplate.query( getSql("selectOutgoingBatchPrefixSql", "selectOutgoingBatchErrorsSql"), maxRows, new OutgoingBatchMapper(true), null, null)); return batches; }
public DirectorySnapshot getDirectorySnapshot(FileTriggerRouter fileTriggerRouter) { return new DirectorySnapshot(fileTriggerRouter, sqlTemplate.query( getSql("selectFileSnapshotSql"), new FileSnapshotMapper(), fileTriggerRouter .getFileTrigger().getTriggerId(), fileTriggerRouter.getRouter() .getRouterId())); }