@Test public void testWrongMessageType() { try { MultiPayloadByteArrayOutputParameter parameter = new MultiPayloadByteArrayOutputParameter(); AdaptrisMessage message = DefaultMessageFactory.getDefaultInstance().newMessage(); parameter.insert(PAYLOAD, message); fail(); } catch (Exception e) { } }
@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);  }