Search in sources :

Example 1 with LogMessageService

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

the class DoWhileTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    ConditionMetadata condition = new ConditionMetadata();
    condition.setMetadataKey("key1");
    condition.setOperator(new NotNull());
    ConditionMetadata condition2 = new ConditionMetadata();
    condition2.setMetadataKey("key2");
    condition2.setOperator(new IsNull());
    ConditionOr conditionOr = new ConditionOr();
    conditionOr.getConditions().add(condition);
    conditionOr.getConditions().add(condition2);
    ThenService thenSrvc = new ThenService();
    thenSrvc.setService(new LogMessageService());
    doWhile.setCondition(conditionOr);
    doWhile.setThen(thenSrvc);
    DoWhile doWhile = new DoWhile();
    doWhile.setCondition(conditionOr);
    doWhile.setThen(thenSrvc);
    return doWhile;
}
Also used : ConditionOr(com.adaptris.core.services.conditional.conditions.ConditionOr) LogMessageService(com.adaptris.core.services.LogMessageService) ConditionMetadata(com.adaptris.core.services.conditional.conditions.ConditionMetadata) IsNull(com.adaptris.core.services.conditional.operator.IsNull) NotNull(com.adaptris.core.services.conditional.operator.NotNull)

Example 2 with LogMessageService

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

the class ForEachTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    ForEach forEach = new ForEach();
    ThenService then = new ThenService();
    then.setService(new LogMessageService());
    forEach.setThen(then);
    return forEach;
}
Also used : LogMessageService(com.adaptris.core.services.LogMessageService)

Example 3 with LogMessageService

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

the class ServiceFromCacheTest method createCache.

private CacheConnection createCache(String key) throws Exception {
    ExpiringMapCache cacheInstance = new ExpiringMapCache();
    CacheConnection conn = new CacheConnection();
    conn.setCacheInstance(cacheInstance);
    LifecycleHelper.initAndStart(conn);
    conn.retrieveCache().put(key, DynamicServiceExecutorTest.createMessage(new ServiceList(new LogMessageService())).getContent());
    return conn;
}
Also used : ExpiringMapCache(com.adaptris.core.cache.ExpiringMapCache) ServiceList(com.adaptris.core.ServiceList) LogMessageService(com.adaptris.core.services.LogMessageService) CacheConnection(com.adaptris.core.services.cache.CacheConnection)

Example 4 with LogMessageService

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

the class WhileTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    ConditionMetadata condition = new ConditionMetadata();
    condition.setMetadataKey("key1");
    condition.setOperator(new NotNull());
    ConditionMetadata condition2 = new ConditionMetadata();
    condition2.setMetadataKey("key2");
    condition2.setOperator(new IsNull());
    ConditionOr conditionOr = new ConditionOr();
    conditionOr.getConditions().add(condition);
    conditionOr.getConditions().add(condition2);
    ThenService thenSrvc = new ThenService();
    thenSrvc.setService(new LogMessageService());
    logicalExpression.setCondition(conditionOr);
    logicalExpression.setThen(thenSrvc);
    // We init and start the service in the setup, lets stop it.
    try {
        StopMe(logicalExpression);
    } catch (Exception e) {
    }
    return logicalExpression;
}
Also used : ConditionOr(com.adaptris.core.services.conditional.conditions.ConditionOr) LogMessageService(com.adaptris.core.services.LogMessageService) ConditionMetadata(com.adaptris.core.services.conditional.conditions.ConditionMetadata) IsNull(com.adaptris.core.services.conditional.operator.IsNull) NotNull(com.adaptris.core.services.conditional.operator.NotNull) ServiceException(com.adaptris.core.ServiceException) CoreException(com.adaptris.core.CoreException)

Example 5 with LogMessageService

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

the class CheckMetadataValueServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    CheckMetadataValueService s = createChecker();
    s.setNextServiceIdIfDuplicate("duplicate");
    s.setNextServiceIdIfUnique("unique");
    s.setUniqueId("CheckMetadataAgainstPreviousValues");
    BranchingServiceCollection sl = new BranchingServiceCollection();
    sl.addService(s);
    sl.setFirstServiceId(s.getUniqueId());
    sl.addService(new LogMessageService("duplicate"));
    sl.addService(new LogMessageService("unique"));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) LogMessageService(com.adaptris.core.services.LogMessageService)

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