/* Copyright 2013 Nationale-Nederlanden Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package nl.nn.adapterframework.processors; import nl.nn.adapterframework.core.IPipeLineSession; import nl.nn.adapterframework.core.PipeLine; import nl.nn.adapterframework.core.PipeLineResult; import nl.nn.adapterframework.core.PipeLineSessionBase; import nl.nn.adapterframework.core.PipeRunException; import nl.nn.adapterframework.util.Misc; /** * @author Jaco de Groot */ public class InputOutputPipeLineProcessor extends PipeLineProcessorBase { public PipeLineResult processPipeLine(PipeLine pipeLine, String messageId, String message, IPipeLineSession pipeLineSession, String firstPipe ) throws PipeRunException { if (pipeLineSession==null) { pipeLineSession= new PipeLineSessionBase(); } // reset the PipeLineSession and store the message and its id in the session if (messageId==null) { messageId=Misc.createSimpleUUID(); log.error("null value for messageId, setting to ["+messageId+"]"); } if (message == null) { throw new PipeRunException(null, "Pipeline of adapter ["+ pipeLine.getOwner().getName()+"] received null message"); } // store message and messageId in the pipeLineSession pipeLineSession.put(IPipeLineSession.originalMessageKey, message); pipeLineSession.put(IPipeLineSession.messageIdKey, messageId); return pipeLineProcessor.processPipeLine(pipeLine, messageId, message, pipeLineSession, firstPipe); } }