Fixed formatting

This commit is contained in:
Kai S. K. Engelbart 2019-10-06 10:41:32 +02:00
parent 87738d0117
commit ab02a783c9

View File

@ -39,7 +39,6 @@ public class EnvoyClient {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public EnvoyClient() { public EnvoyClient() {
@ -73,11 +72,12 @@ public class EnvoyClient {
} }
// Send message // Send message
String url = String.format("%s:%s/envoy-server/rest/message/send", serverProps.getProperty("server"), String url = String.format("%s:%s/envoy-server/rest/message/send",
serverProps.getProperty("server"),
serverProps.getProperty("port")); serverProps.getProperty("port"));
Client client = ClientBuilder.newClient(); Client client = ClientBuilder.newClient();
WebTarget target = client.target(url); WebTarget target = client.target(url);
Response response = target.request().post(Entity.entity(message, "application/xml")); Response response = target.request().post(Entity.entity(message, "application/xml"));
System.out.println("Response code: " + response.getStatus()); System.out.println("Response code: " + response.getStatus());
response.close(); response.close();
client.close(); client.close();
@ -93,8 +93,8 @@ public class EnvoyClient {
* @return Prepared {@link Message} object * @return Prepared {@link Message} object
*/ */
public Message createMessage(String senderID, String recipientID, String textContent) { public Message createMessage(String senderID, String recipientID, String textContent) {
ObjectFactory factory = new ObjectFactory(); ObjectFactory factory = new ObjectFactory();
Message.MetaData metaData = factory.createMessageMetaData(); Message.MetaData metaData = factory.createMessageMetaData();
metaData.setSender(senderID); metaData.setSender(senderID);
metaData.setRecipient(recipientID); metaData.setRecipient(recipientID);
metaData.setState(false); metaData.setState(false);