use of com.adaptris.core.Channel in project interlok by adaptris.
the class MultipleInterceptorWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
StandardWorkflow wf = new StandardWorkflow();
wf.setUniqueId("MyWorkflowName");
MessageMetricsInterceptor ti = new MessageMetricsInterceptor();
ti.setUniqueId("Metrics_For_MyWorkflowName");
ti.setTimesliceDuration(new TimeInterval(60L, TimeUnit.SECONDS));
wf.addInterceptor(ti);
ThrottlingInterceptor ti2 = new ThrottlingInterceptor();
ti2.setMaximumMessages(60);
ti2.setCacheName("60msgsPerMinute");
ti2.setTimeSliceInterval(new TimeInterval(1L, TimeUnit.MINUTES.name()));
wf.addInterceptor(ti2);
c.setUniqueId(UUID.randomUUID().toString());
wf.setUniqueId(UUID.randomUUID().toString());
c.getWorkflowList().add(wf);
return c;
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class SlowMessageNotificationWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
StandardWorkflow wf = new StandardWorkflow();
SlowMessageNotification ti = new SlowMessageNotification("SlowMessages_For_MyWorkflowName", new TimeInterval(30L, TimeUnit.SECONDS));
wf.addInterceptor(ti);
c.getWorkflowList().add(wf);
c.setUniqueId(UUID.randomUUID().toString());
wf.setUniqueId(UUID.randomUUID().toString());
return c;
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class MessageThresholdNotificationWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
StandardWorkflow wf = new StandardWorkflow();
MessageThresholdNotification ti = new MessageThresholdNotification("MessageCount_For_MyWorkflowName");
ti.setTimesliceDuration(new TimeInterval(30L, TimeUnit.SECONDS));
ti.setCountThreshold(20L);
wf.addInterceptor(ti);
c.setUniqueId(UUID.randomUUID().toString());
wf.setUniqueId(UUID.randomUUID().toString());
c.getWorkflowList().add(wf);
return c;
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class MetadataCountWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
StandardWorkflow wf = new StandardWorkflow();
wf.setUniqueId("MyWorkflowName");
MetadataCountInterceptor ti = new MetadataCountInterceptor("metadatakey1");
ti.setUniqueId("Metrics_For_MyWorkflowName");
ti.setTimesliceDuration(new TimeInterval(60L, TimeUnit.SECONDS));
wf.addInterceptor(ti);
c.setUniqueId(UUID.randomUUID().toString());
wf.setUniqueId(UUID.randomUUID().toString());
c.getWorkflowList().add(wf);
return c;
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class JmsTransactedWorkflowTest method testInit_UnsupportedConsumer.
@Test
public void testInit_UnsupportedConsumer() throws Exception {
Channel channel = createStartableChannel(activeMqBroker);
JmsTransactedWorkflow workflow = (JmsTransactedWorkflow) channel.getWorkflowList().get(0);
workflow.setConsumer(new FsConsumer().withBaseDirectoryUrl("file:////path/to/directory"));
try {
channel.requestInit();
} catch (CoreException expected) {
assertEquals("JmsTransactedWorkflow must be used with a JMSConsumer", expected.getMessage());
} finally {
channel.requestClose();
}
}
Aggregations