@Test public void testInsertNullStream() throws Exception { MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory(); MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage)messageFactory.newMessage(); try { InputStreamWithEncoding stream = new InputStreamWithEncoding(null, ENCODING); MultiPayloadStreamOutputParameter parameter = new MultiPayloadStreamOutputParameter(); parameter.insert(stream, ID, message); } catch (Exception e) { } }
@Override public void insert(InputStreamWithEncoding data, InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { insert(data, m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } else { throw new InterlokException("Cannot insert payload into message type " + m.getClass().getName() + " as it does not support multiple payloads."); } }
MultiPayloadStreamOutputParameter extends PayloadStreamOutputParameter implements DataOutputParameter<InputStreamWithEncoding> { @Override public void insert(InputStreamWithEncoding data, InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { insert(data, m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } else { throw new InterlokException("Cannot insert payload into message type " + m.getClass().getName() + " as it does not support multiple payloads."); } } }
MultiPayloadStreamOutputParameter extends PayloadStreamOutputParameter implements DataOutputParameter<InputStreamWithEncoding> { @Override public void insert(InputStreamWithEncoding data, InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { insert(data, m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } else { throw new InterlokException("Cannot insert payload into message type " + m.getClass().getName() + " as it does not support multiple payloads."); } }  }
MultiPayloadStreamOutputParameter extends PayloadStreamOutputParameter implements DataOutputParameter<InputStreamWithEncoding> { @Override public void insert(InputStreamWithEncoding data, InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { insert(data, m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } else { throw new InterlokException("Cannot insert payload into message type " + m.getClass().getName() + " as it does not support multiple payloads."); } }  String getPayloadId(); void setPayloadId(String payloadId); @Override void insert(InputStreamWithEncoding data, InterlokMessage m); void insert(InputStreamWithEncoding data, String id, MultiPayloadAdaptrisMessage m); }
MultiPayloadStreamOutputParameter extends PayloadStreamOutputParameter implements DataOutputParameter<InputStreamWithEncoding> { @Override public void insert(InputStreamWithEncoding data, InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { insert(data, m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } else { throw new InterlokException("Cannot insert payload into message type " + m.getClass().getName() + " as it does not support multiple payloads."); } }  String getPayloadId(); void setPayloadId(String payloadId); @Override void insert(InputStreamWithEncoding data, InterlokMessage m); void insert(InputStreamWithEncoding data, String id, MultiPayloadAdaptrisMessage m);  }