@Test public void testInsertUseDefaultId() throws Exception { MultiPayloadByteArrayOutputParameter parameter = new MultiPayloadByteArrayOutputParameter(); MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory(); MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage)messageFactory.newMessage(); parameter.insert(PAYLOAD, null, message); assertArrayEquals(PAYLOAD, message.getPayload(messageFactory.getDefaultPayloadId())); }
@Override public void insert(byte[] 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."); } }
MultiPayloadByteArrayOutputParameter extends ByteArrayPayloadDataOutputParameter implements DataOutputParameter<byte[]> { @Override public void insert(byte[] 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."); } } }
MultiPayloadByteArrayOutputParameter extends ByteArrayPayloadDataOutputParameter implements DataOutputParameter<byte[]> { @Override public void insert(byte[] 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."); } }  }
MultiPayloadByteArrayOutputParameter extends ByteArrayPayloadDataOutputParameter implements DataOutputParameter<byte[]> { @Override public void insert(byte[] 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(byte[] data, InterlokMessage m); void insert(byte[] data, String id, MultiPayloadAdaptrisMessage m); }
MultiPayloadByteArrayOutputParameter extends ByteArrayPayloadDataOutputParameter implements DataOutputParameter<byte[]> { @Override public void insert(byte[] 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(byte[] data, InterlokMessage m); void insert(byte[] data, String id, MultiPayloadAdaptrisMessage m);  }