Search in sources :

Example 6 with LogMessageService

use of com.adaptris.core.services.LogMessageService in project interlok by adaptris.

the class ExampleChannelCase method createServiceCollection.

private ServiceCollection createServiceCollection() throws CoreException {
    ServiceCollection services = new ServiceList();
    AddMetadataService service = new AddMetadataService();
    service.addMetadataElement("key1", "val1");
    services.addService(service);
    services.addService(new LogMessageService());
    return services;
}
Also used : ServiceCollection(com.adaptris.core.ServiceCollection) ServiceList(com.adaptris.core.ServiceList) LogMessageService(com.adaptris.core.services.LogMessageService) AddMetadataService(com.adaptris.core.services.metadata.AddMetadataService)

Example 7 with LogMessageService

use of com.adaptris.core.services.LogMessageService in project interlok by adaptris.

the class SharedComponentListTest method createAdapter.

private Adapter createAdapter() throws CoreException, PasswordException {
    Adapter adapter = new Adapter();
    adapter.setUniqueId("upbeat_liskov");
    JmsConnection jmsConnection = createPtpConnection("jms-connection");
    adapter.getSharedComponents().addConnection(jmsConnection);
    ServiceList serviceList = new ServiceList();
    serviceList.setUniqueId("shared-service-list");
    serviceList.add(new LogMessageService("log-message-service"));
    adapter.getSharedComponents().addService(serviceList);
    StandardWorkflow wf1 = new StandardWorkflow();
    wf1.setUniqueId("reverent-edison");
    wf1.setConsumer(new FsConsumer().withBaseDirectoryUrl("in-directory"));
    wf1.setProducer(new FsProducer().withBaseDirectoryUrl("out-directory"));
    wf1.getServiceCollection().add(new SharedService("shared-service-list"));
    StandardWorkflow wf = new StandardWorkflow();
    wf.setUniqueId("pedantic_brown");
    wf.setConsumer(new JmsConsumer().withEndpoint("jms:queue:SampleQueue1"));
    wf.setProducer(new NullMessageProducer());
    wf.getServiceCollection().add(new StandaloneProducer(new SharedConnection("jms-connection"), new JmsProducer().withEndpoint("jms:topic:MyTopicName")));
    Channel channel = new Channel();
    channel.setUniqueId("quirky_shannon");
    channel.setConsumeConnection(new SharedConnection("jms-connection"));
    channel.getWorkflowList().add(wf);
    channel.getWorkflowList().add(wf1);
    adapter.getChannelList().add(channel);
    return adapter;
}
Also used : JmsProducer(com.adaptris.core.jms.JmsProducer) LogMessageService(com.adaptris.core.services.LogMessageService) FsProducer(com.adaptris.core.fs.FsProducer) JmsConsumer(com.adaptris.core.jms.JmsConsumer) FsConsumer(com.adaptris.core.fs.FsConsumer) JmsConnection(com.adaptris.core.jms.JmsConnection)

Example 8 with LogMessageService

use of com.adaptris.core.services.LogMessageService in project interlok by adaptris.

the class BranchingHttpRequestServiceTest method retrieveObjectForSampleConfig.

@Override
protected BranchingServiceCollection retrieveObjectForSampleConfig() {
    BranchingHttpRequestService service = createForExamples();
    BranchingServiceCollection sl = new BranchingServiceCollection();
    sl.addService(service);
    sl.setFirstServiceId(service.getUniqueId());
    sl.addService(new ThrowExceptionService("5XX Server Error", new ConfiguredException("Got 5XX error from server")));
    sl.addService(new ThrowExceptionService("4XX Client Error", new ConfiguredException("Got 4XX error from server")));
    sl.addService(new NullService("Not Found"));
    sl.addService(new LogMessageService("2XX OK"));
    sl.addService(new ThrowExceptionService("DefaultServiceId", new ConfiguredException("Unmatched Response")));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) ThrowExceptionService(com.adaptris.core.services.exception.ThrowExceptionService) NullService(com.adaptris.core.NullService) LogMessageService(com.adaptris.core.services.LogMessageService) ConfiguredException(com.adaptris.core.services.exception.ConfiguredException)

Example 9 with LogMessageService

use of com.adaptris.core.services.LogMessageService in project interlok by adaptris.

the class SyntaxBranchingServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    BranchingServiceCollection sl = new BranchingServiceCollection();
    SyntaxBranchingService sbs = new SyntaxBranchingService();
    sbs.setUniqueId("determineDocType");
    sbs.setSyntaxIdentifiers(createStandardIdentifiers());
    sbs.addSyntaxIdentifier(new AlwaysMatchSyntaxIdentifier("alwaysMatches"));
    sl.addService(sbs);
    sl.setFirstServiceId(sbs.getUniqueId());
    sl.addService(new LogMessageService("isPostcode"));
    sl.addService(new LogMessageService("isXml"));
    sl.addService(new LogMessageService("alwaysMatches"));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) LogMessageService(com.adaptris.core.services.LogMessageService)

Example 10 with LogMessageService

use of com.adaptris.core.services.LogMessageService in project interlok by adaptris.

the class ServiceFromUrlTest method createService.

private File createService() throws Exception {
    File f = TempFileUtils.createTrackedFile(this);
    String xml = DynamicServiceExecutorTest.createMessage(new ServiceList(new Service[] { new LogMessageService() })).getContent();
    try (FileWriter w = new FileWriter(f, false)) {
        w.write(xml);
    }
    return f;
}
Also used : ServiceList(com.adaptris.core.ServiceList) LogMessageService(com.adaptris.core.services.LogMessageService) FileWriter(java.io.FileWriter) File(java.io.File)

Aggregations

LogMessageService (com.adaptris.core.services.LogMessageService)18 BranchingServiceCollection (com.adaptris.core.BranchingServiceCollection)7 ServiceList (com.adaptris.core.ServiceList)4 ConditionMetadata (com.adaptris.core.services.conditional.conditions.ConditionMetadata)3 ConditionOr (com.adaptris.core.services.conditional.conditions.ConditionOr)3 NotNull (com.adaptris.core.services.conditional.operator.NotNull)3 ConfiguredException (com.adaptris.core.services.exception.ConfiguredException)3 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)3 IsNull (com.adaptris.core.services.conditional.operator.IsNull)2 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)2 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 CoreException (com.adaptris.core.CoreException)1 NullService (com.adaptris.core.NullService)1 ServiceCollection (com.adaptris.core.ServiceCollection)1 ServiceException (com.adaptris.core.ServiceException)1 ExpiringMapCache (com.adaptris.core.cache.ExpiringMapCache)1 ConstantDataInputParameter (com.adaptris.core.common.ConstantDataInputParameter)1 FsConsumer (com.adaptris.core.fs.FsConsumer)1 FsProducer (com.adaptris.core.fs.FsProducer)1 JmsConnection (com.adaptris.core.jms.JmsConnection)1