Search in sources :

Example 1 with SenderSeries

use of nl.nn.adapterframework.senders.SenderSeries in project iaf by ibissource.

the class ForEachAttachmentPipeTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    pipe = createForEachAttachmentPipe();
    pipe.registerForward(new PipeForward("success", null));
    SenderSeries series = new SenderSeries();
    series.registerSender(new EchoSender());
    pipe.setSender(series);
}
Also used : PipeForward(nl.nn.adapterframework.core.PipeForward) SenderSeries(nl.nn.adapterframework.senders.SenderSeries) EchoSender(nl.nn.adapterframework.senders.EchoSender) Before(org.junit.Before)

Example 2 with SenderSeries

use of nl.nn.adapterframework.senders.SenderSeries in project iaf by ibissource.

the class InputOutputSenderWrapperProcessorTest method getSenderWrapper.

public SenderWrapperBase getSenderWrapper() {
    SenderSeries senderSeries = new SenderSeries();
    senderSeries.registerSender(new SenderBase() {

        @Override
        public Message sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException {
            try {
                return new Message("Sender 1: [" + message.asString() + "]");
            } catch (IOException e) {
                throw new SenderException(e);
            }
        }
    });
    senderSeries.registerSender(new SenderBase() {

        @Override
        public Message sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException {
            try {
                secondSenderOutput = "Sender 2: [" + message.asString() + "]";
                return new Message(secondSenderOutput);
            } catch (IOException e) {
                throw new SenderException(e);
            }
        }
    });
    return senderSeries;
}
Also used : Message(nl.nn.adapterframework.stream.Message) SenderBase(nl.nn.adapterframework.senders.SenderBase) PipeLineSession(nl.nn.adapterframework.core.PipeLineSession) IOException(java.io.IOException) SenderException(nl.nn.adapterframework.core.SenderException) SenderSeries(nl.nn.adapterframework.senders.SenderSeries) TimeoutException(nl.nn.adapterframework.core.TimeoutException)

Example 3 with SenderSeries

use of nl.nn.adapterframework.senders.SenderSeries in project iaf by ibissource.

the class ParallelXsltTest method createPipe.

@Override
public SenderPipe createPipe() {
    SenderPipe pipe = new SenderPipe();
    SenderSeries psenders = createSenderContainer();
    xsltSenders = new ArrayList<XsltSender>();
    for (int i = 0; i < NUM_SENDERS; i++) {
        XsltSender sender = new XsltSender();
        // sender.setSessionKey("out"+i);
        sender.setOmitXmlDeclaration(true);
        sender.addParameter(new Parameter("header", "header" + i));
        session.put("sessionKey" + i, "sessionKeyValue" + i);
        sender.addParameter(ParameterBuilder.create().withName("sessionKey").withSessionKey("sessionKey" + i));
        autowireByType(sender);
        psenders.registerSender(sender);
        xsltSenders.add(sender);
    }
    session.put("sessionKeyGlobal", "sessionKeyGlobalValue");
    psenders.addParameter(ParameterBuilder.create().withName("sessionKeyGlobal").withSessionKey("sessionKeyGlobal"));
    pipe.setSender(psenders);
    return pipe;
}
Also used : SenderPipe(nl.nn.adapterframework.pipes.SenderPipe) Parameter(nl.nn.adapterframework.parameters.Parameter) XsltSender(nl.nn.adapterframework.senders.XsltSender) SenderSeries(nl.nn.adapterframework.senders.SenderSeries)

Example 4 with SenderSeries

use of nl.nn.adapterframework.senders.SenderSeries in project iaf by ibissource.

the class ParallelXsltTest method createSenderContainer.

protected SenderSeries createSenderContainer() {
    SenderSeries senders = new ParallelSenders();
    autowireByType(senders);
    return senders;
}
Also used : ParallelSenders(nl.nn.adapterframework.senders.ParallelSenders) SenderSeries(nl.nn.adapterframework.senders.SenderSeries)

Aggregations

SenderSeries (nl.nn.adapterframework.senders.SenderSeries)4 IOException (java.io.IOException)1 PipeForward (nl.nn.adapterframework.core.PipeForward)1 PipeLineSession (nl.nn.adapterframework.core.PipeLineSession)1 SenderException (nl.nn.adapterframework.core.SenderException)1 TimeoutException (nl.nn.adapterframework.core.TimeoutException)1 Parameter (nl.nn.adapterframework.parameters.Parameter)1 SenderPipe (nl.nn.adapterframework.pipes.SenderPipe)1 EchoSender (nl.nn.adapterframework.senders.EchoSender)1 ParallelSenders (nl.nn.adapterframework.senders.ParallelSenders)1 SenderBase (nl.nn.adapterframework.senders.SenderBase)1 XsltSender (nl.nn.adapterframework.senders.XsltSender)1 Message (nl.nn.adapterframework.stream.Message)1 Before (org.junit.Before)1