From 732a2d49e6cb369e0fb90e7c4b0ef819dd307160 Mon Sep 17 00:00:00 2001
From: DieGurke <55625494+DieGurke@users.noreply.github.com>
Date: Thu, 26 Mar 2020 16:06:55 +0100
Subject: [PATCH] Refactored every identifier to fit the new naming convention,
pom.xml
---
pom.xml | 2 +-
src/main/java/envoy/server/data/Message.java | 6 +++---
.../processors/ContactOperationProcessor.java | 2 +-
.../envoy/server/processors/MessageProcessor.java | 14 +++++++-------
.../processors/MessageStatusChangeProcessor.java | 2 +-
.../processors/UserStatusChangeProcessor.java | 6 +++---
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/pom.xml b/pom.xml
index 244170b..046ec55 100755
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
com.github.informatik-ag-ngl
envoy-common
- f~groups-SNAPSHOT
+ develop-SNAPSHOT
com.github.informatik-ag-ngl
diff --git a/src/main/java/envoy/server/data/Message.java b/src/main/java/envoy/server/data/Message.java
index 3a6604c..76c133c 100755
--- a/src/main/java/envoy/server/data/Message.java
+++ b/src/main/java/envoy/server/data/Message.java
@@ -76,14 +76,14 @@ public class Message {
*/
public Message(envoy.data.Message message) {
PersistenceManager persMan = PersistenceManager.getInstance();
- id = message.getId();
+ id = message.getID();
status = message.getStatus();
text = message.getText();
creationDate = message.getCreationDate();
receivedDate = message.getReceivedDate();
readDate = message.getReadDate();
- sender = persMan.getUserById(message.getSenderId());
- recipient = persMan.getUserById(message.getRecipientId());
+ sender = persMan.getUserById(message.getSenderID());
+ recipient = persMan.getUserById(message.getRecipientID());
forwarded = message.isForwarded();
// TODO: attachment = message.getAttachment().toByteArray();DOES NOT WORK YET
}
diff --git a/src/main/java/envoy/server/processors/ContactOperationProcessor.java b/src/main/java/envoy/server/processors/ContactOperationProcessor.java
index f906fb7..aaa9a29 100755
--- a/src/main/java/envoy/server/processors/ContactOperationProcessor.java
+++ b/src/main/java/envoy/server/processors/ContactOperationProcessor.java
@@ -26,7 +26,7 @@ public class ContactOperationProcessor implements ObjectProcessor {
message.nextStatus();
ConnectionManager connectionManager = ConnectionManager.getInstance();
- Contact recipient = PersistenceManager.getInstance().getContactById(message.getId());
+ Contact recipient = PersistenceManager.getInstance().getContactById(message.getID());
if (recipient instanceof envoy.server.data.User) {
System.out.println("The received message is a direct message.");
@@ -39,15 +39,15 @@ public class MessageProcessor implements ObjectProcessor {
try {
writeProxy.write(socketId, new MessageStatusChangeEvent(message));
} catch (IOException e) {
- System.err.println("Could not send messageStatusChangeEvent to the sender of this message with ID: " + message.getId());
+ System.err.println("Could not send messageStatusChangeEvent to the sender of this message with ID: " + message.getID());
e.printStackTrace();
}
} else {
System.out.println("The received message is a group message.");
- final var members = PersistenceManager.getInstance().getGroupById(message.getRecipientId()).getMembers();
+ final var members = PersistenceManager.getInstance().getGroupById(message.getRecipientID()).getMembers();
final var generator = IDGeneratorRequestProcessor.createIDGenerator(members.size());
members.forEach(user -> {
- envoy.data.Message returnMessage = new MessageBuilder(message.getRecipientId(), user.getID(), generator)
+ envoy.data.Message returnMessage = new MessageBuilder(message.getRecipientID(), user.getID(), generator)
.setDate(message.getCreationDate())
.setText(message.getText())
.setAttachment(message.getAttachment())
@@ -64,15 +64,15 @@ public class MessageProcessor implements ObjectProcessor {
}
private void sendToUser(ConnectionManager connectionManager, Message message, ObjectWriteProxy writeProxy) {
- if (connectionManager.isOnline(message.getRecipientId())) try {
+ if (connectionManager.isOnline(message.getRecipientID())) try {
// If recipient is online, send the message directly
- writeProxy.write(connectionManager.getSocketId(message.getRecipientId()), message);
+ writeProxy.write(connectionManager.getSocketId(message.getRecipientID()), message);
// Update the message status to RECEIVED
message.setReceivedDate(new Date());
message.nextStatus();
} catch (IOException e) {
- System.err.println("Recipient online. Failed to send message" + message.getId());
+ System.err.println("Recipient online. Failed to send message" + message.getID());
e.printStackTrace();
}
}
diff --git a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java
index 3dce652..bd9c215 100755
--- a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java
+++ b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java
@@ -27,7 +27,7 @@ public class MessageStatusChangeProcessor implements ObjectProcessor