@Test public void testWrongMessageType() { try { MultiPayloadByteArrayInputParameter parameter = new MultiPayloadByteArrayInputParameter(); AdaptrisMessage message = DefaultMessageFactory.getDefaultInstance().newMessage(PAYLOAD); parameter.extract(message); fail(); } catch (Exception e) { } }
@Override public byte[] extract(InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { return extract(m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } throw new InterlokException("Cannot extract payload from message type " + m.getClass().getName() + " as it does not support multiple payloads."); }
MultiPayloadByteArrayInputParameter implements DataInputParameter<byte[]> { @Override public byte[] extract(InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { return extract(m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } throw new InterlokException("Cannot extract payload from message type " + m.getClass().getName() + " as it does not support multiple payloads."); } }
MultiPayloadByteArrayInputParameter implements DataInputParameter<byte[]> { @Override public byte[] extract(InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { return extract(m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } throw new InterlokException("Cannot extract payload from message type " + m.getClass().getName() + " as it does not support multiple payloads."); }  }
MultiPayloadByteArrayInputParameter implements DataInputParameter<byte[]> { @Override public byte[] extract(InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { return extract(m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } throw new InterlokException("Cannot extract payload from message type " + m.getClass().getName() + " as it does not support multiple payloads."); }  String getPayloadId(); void setPayloadId(String payloadId); @Override byte[] extract(InterlokMessage m); byte[] extract(String id, MultiPayloadAdaptrisMessage m); }
MultiPayloadByteArrayInputParameter implements DataInputParameter<byte[]> { @Override public byte[] extract(InterlokMessage m) throws InterlokException { if (m instanceof MultiPayloadAdaptrisMessage) { return extract(m.resolve(getPayloadId()), (MultiPayloadAdaptrisMessage)m); } throw new InterlokException("Cannot extract payload from message type " + m.getClass().getName() + " as it does not support multiple payloads."); }  String getPayloadId(); void setPayloadId(String payloadId); @Override byte[] extract(InterlokMessage m); byte[] extract(String id, MultiPayloadAdaptrisMessage m);  }