use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class SharedConnectionConfigurationCheckerTest method createAdapterConfig.
private static String createAdapterConfig(AdaptrisConnection sharedComponent, AdaptrisConnection consumeConnection, AdaptrisConnection produceConnection, AdaptrisConnection serviceConnection) throws Exception {
Adapter adapter = new Adapter();
if (sharedComponent != null) {
adapter.getSharedComponents().addConnection(sharedComponent);
}
Channel channel = new Channel();
if (consumeConnection != null) {
channel.setConsumeConnection(consumeConnection);
}
if (produceConnection != null) {
channel.setProduceConnection(produceConnection);
}
if (serviceConnection != null) {
StandardWorkflow standardWorkflow = new StandardWorkflow();
StandaloneProducer sp = new StandaloneProducer(serviceConnection, new NullMessageProducer());
standardWorkflow.getServiceCollection().add(sp);
channel.getWorkflowList().add(standardWorkflow);
}
adapter.getChannelList().add(channel);
return DefaultMarshaller.getDefaultMarshaller().marshal(adapter);
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class SharedServiceConfigurationCheckerTest method createAdapterConfig.
private static String createAdapterConfig(Service sharedComponent, Service service) throws Exception {
Adapter adapter = new Adapter();
if (sharedComponent != null) {
adapter.getSharedComponents().addService(sharedComponent);
}
Channel channel = new Channel();
StandardWorkflow standardWorkflow = new StandardWorkflow();
channel.getWorkflowList().add(standardWorkflow);
adapter.getChannelList().add(channel);
if (service != null) {
standardWorkflow.getServiceCollection().add(service);
}
return DefaultMarshaller.getDefaultMarshaller().marshal(adapter);
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class DeprecatedConfigurationCheckerTest method createAdapterConfig.
private Adapter createAdapterConfig(boolean validates, boolean channels) throws Exception {
Adapter adapter = new Adapter();
// have a unique-id
adapter.setUniqueId("MyAdapter");
AddTimestampMetadataService atms = new AddTimestampMetadataService();
atms.setUniqueId("valid-add-timestamp-service");
adapter.getSharedComponents().addService(atms);
if (!validates) {
// Add a deprecated service
DeprecatedService ds = new DeprecatedService();
adapter.getSharedComponents().addService(ds);
// Add a service with deprecated member
DeprecatedMemberService dms = new DeprecatedMemberService();
dms.setDeprecated("value");
adapter.getSharedComponents().addService(dms);
}
if (channels) {
Channel c = new Channel();
StandardWorkflow w = new StandardWorkflow();
if (!validates) {
NullMessageConsumer consumer = new NullMessageConsumer();
w.setConsumer(consumer);
w.getServiceCollection().add(new DeprecatedService());
}
c.getWorkflowList().add(w);
adapter.getChannelList().add(c);
}
return adapter;
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class StatisticsMBeanCase method createWorkflow.
protected static StandardWorkflow createWorkflow(String uid, WorkflowInterceptor... interceptors) throws CoreException {
StandardWorkflow wf = new StandardWorkflow();
wf.setUniqueId(uid);
for (WorkflowInterceptor wi : interceptors) {
wf.addInterceptor(wi);
}
return wf;
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class ThrottlingInterceptorWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
StandardWorkflow wf = new StandardWorkflow();
ThrottlingInterceptor ti = new ThrottlingInterceptor();
ti.setMaximumMessages(60);
ti.setCacheName("60msgsPerMinute");
ti.setTimeSliceInterval(new TimeInterval(1L, TimeUnit.MINUTES.name()));
wf.addInterceptor(ti);
c.getWorkflowList().add(wf);
c.setUniqueId(UUID.randomUUID().toString());
wf.setUniqueId(UUID.randomUUID().toString());
return c;
}
Aggregations