diff --git a/client/src/main/java/de/fitko/fitconnect/TestRunner.java b/client/src/main/java/de/fitko/fitconnect/TestRunner.java index d2f148e550148a0d25e3545e30bda020d57ec77f..420774113de162c1946f905c40dbe25c9188e577 100644 --- a/client/src/main/java/de/fitko/fitconnect/TestRunner.java +++ b/client/src/main/java/de/fitko/fitconnect/TestRunner.java @@ -16,6 +16,10 @@ public class TestRunner { private static void senderSample() { + // straight call in one go + SenderClient.build().send(UUID.randomUUID(), Collections.emptyList()); + SenderClient.build().send(UUID.randomUUID(), Collections.emptyList(), "some json or xml"); + // Without data SenderClient.build() .withDestination(UUID.randomUUID()) diff --git a/client/src/main/java/de/fitko/fitconnect/client/SenderClient.java b/client/src/main/java/de/fitko/fitconnect/client/SenderClient.java index d76d5608139d65c42aceb3c364dea17f674b03b3..6b0677fcf94c22422716d81226a54e16a5adffdb 100644 --- a/client/src/main/java/de/fitko/fitconnect/client/SenderClient.java +++ b/client/src/main/java/de/fitko/fitconnect/client/SenderClient.java @@ -42,6 +42,12 @@ public class SenderClient extends Client { * @return the upload step for attachments */ WithAttachments withDestination(UUID destinationId); + + SubmissionResponse send(UUID destinationId, List<File> attachments, String data); + + SubmissionResponse send(UUID destinationId, List<File> attachments, byte[] data); + + SubmissionResponse send(UUID destinationId, List<File> attachments); } public interface WithAttachments { @@ -98,6 +104,29 @@ public class SenderClient extends Client { return this; } + @Override + public SubmissionResponse send(UUID destinationId, List<File> attachments, String data) { + return this.withDestination(destinationId) + .withAttachments(attachments) + .withData(data) + .submit(); + } + + @Override + public SubmissionResponse send(UUID destinationId, List<File> attachments, byte[] data) { + return this.withDestination(destinationId) + .withAttachments(attachments) + .withData(data) + .submit(); + } + + @Override + public SubmissionResponse send(UUID destinationId, List<File> attachments) { + return this.withDestination(destinationId) + .withAttachments(attachments) + .submit(); + } + @Override public Submit withData(String data) { return withData(data.getBytes(StandardCharsets.UTF_8));