Search in sources :

Example 11 with BranchingServiceCollection

use of com.adaptris.core.BranchingServiceCollection in project interlok by adaptris.

the class JettyRoutingServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    BranchingServiceCollection sl = new BranchingServiceCollection();
    JettyRoutingService service = new JettyRoutingService("NotHandled", createRoutes());
    service.setUniqueId("handleRouting");
    sl.addService(service);
    sl.setFirstServiceId(service.getUniqueId());
    sl.addService(new LogMessageService("handleGet"));
    sl.addService(new LogMessageService("handleDelete"));
    sl.addService(new LogMessageService("handleInsert"));
    sl.addService(new ThrowExceptionService("handleUpdate", new ConfiguredException("cannot handle updates")));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) ThrowExceptionService(com.adaptris.core.services.exception.ThrowExceptionService) LogMessageService(com.adaptris.core.services.LogMessageService) ConfiguredException(com.adaptris.core.services.exception.ConfiguredException)

Example 12 with BranchingServiceCollection

use of com.adaptris.core.BranchingServiceCollection in project interlok by adaptris.

the class MetadataBranchingServiceTest method create.

protected BranchingServiceCollection create(MetadataValueMatcherCreator m) {
    BranchingServiceCollection sl = new BranchingServiceCollection();
    MetadataValueBranchingService service = new MetadataValueBranchingService();
    service.setValueMatcher(m.create());
    service.setDefaultServiceId("DefaultServiceId");
    service.addMetadataKey("FirstMetadataKeyWhoseValueWeWantToCheck");
    // service.addMetadataKey("Second_Metadata_Key_Whose_Value_Is_Appended_To_FirstMetadataKeyWhoseValueWeWantToCheck");
    service.setMetadataToServiceIdMappings(m.createMappings());
    service.setUniqueId("CheckMetadataValue");
    sl.addService(service);
    sl.setFirstServiceId(service.getUniqueId());
    sl.addService(new LogMessageService("FirstServiceId"));
    sl.addService(new ThrowExceptionService("SecondServiceId", new ConfiguredException("Fail")));
    sl.addService(new LogMessageService("DefaultServiceId"));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) ThrowExceptionService(com.adaptris.core.services.exception.ThrowExceptionService) LogMessageService(com.adaptris.core.services.LogMessageService) ConfiguredException(com.adaptris.core.services.exception.ConfiguredException)

Example 13 with BranchingServiceCollection

use of com.adaptris.core.BranchingServiceCollection in project interlok by adaptris.

the class MetadataExistsBranchingServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    BranchingServiceCollection sl = new BranchingServiceCollection();
    service.setUniqueId("CheckMetadataExists");
    sl.addService(service);
    sl.setFirstServiceId(service.getUniqueId());
    sl.addService(new LogMessageService("exists"));
    sl.addService(new LogMessageService("default"));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) LogMessageService(com.adaptris.core.services.LogMessageService)

Aggregations

BranchingServiceCollection (com.adaptris.core.BranchingServiceCollection)13 LogMessageService (com.adaptris.core.services.LogMessageService)7 ConfiguredException (com.adaptris.core.services.exception.ConfiguredException)3 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)3 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)2 Test (org.junit.Test)2 MetadataElement (com.adaptris.core.MetadataElement)1 NullService (com.adaptris.core.NullService)1 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)1