summaryrefslogtreecommitdiffstats
path: root/src/main/java/derms/frontend/MyRequest.java
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-11-26 15:52:51 -0500
committerSam Anthony <sam@samanthony.xyz>2024-11-26 15:52:51 -0500
commitab118d47c1c371e5d30f576216a8f347bd746974 (patch)
treeeb250f7f28a3a3b7d30a53188fa60f9a5ef80c6f /src/main/java/derms/frontend/MyRequest.java
parente70b94657e27ac898953643b771ba48d48740b26 (diff)
downloadsoen423-ab118d47c1c371e5d30f576216a8f347bd746974.zip
frontend
Diffstat (limited to 'src/main/java/derms/frontend/MyRequest.java')
-rw-r--r--src/main/java/derms/frontend/MyRequest.java131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/main/java/derms/frontend/MyRequest.java b/src/main/java/derms/frontend/MyRequest.java
new file mode 100644
index 0000000..b0f2758
--- /dev/null
+++ b/src/main/java/derms/frontend/MyRequest.java
@@ -0,0 +1,131 @@
+package derms.frontend;
+
+public class MyRequest {
+ private String function = "";
+ private String clientID = "";
+ private String resourceType = "";
+ private String OldResourceType = "";
+ private String resourceID = "";
+ private String OldResourceID = "";
+ private String FeIpAddress = "FE.FE_IP_Address";
+ private int duration = 0;
+ private int sequenceNumber = 0;
+ private String MessageType = "00";
+ private int retryCount = 1;
+
+ public MyRequest(String function, String clientID) {
+ setFunction(function);
+ setClientID(clientID);
+ }
+
+ public MyRequest(int rmNumber, String bugType) {
+ setMessageType(bugType + rmNumber);
+ }
+
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(String function) {
+ this.function = function;
+ }
+
+ public String getClientID() {
+ return clientID;
+ }
+
+ public void setClientID(String clientID) {
+ this.clientID = clientID;
+ }
+
+ public String getResourceType() {
+ return resourceType;
+ }
+
+ public void setResourceType(String resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ public String getOldResourceType() {
+ return OldResourceType;
+ }
+
+ public void setOldResourceType(String OldResourceType) {
+ this.OldResourceType = OldResourceType;
+ }
+
+ public String getResourceID() {
+ return resourceID;
+ }
+
+ public void setResourceID(String resourceID) {
+ this.resourceID = resourceID;
+ }
+
+ public String getOldResourceID() {
+ return OldResourceID;
+ }
+
+ public void setOldResourceID(String OldResourceID) {
+ this.OldResourceID = OldResourceID;
+ }
+
+ public int getDuration() {
+ return duration;
+ }
+
+ public void setDuration(int duration) {
+ this.duration = duration;
+ }
+
+ public String noRequestSendError() {
+ return "request: " + getFunction() + " from " + getClientID() + " not sent";
+ }
+
+ public int getSequenceNumber() {
+ return sequenceNumber;
+ }
+
+ public void setSequenceNumber(int sequenceNumber) {
+ this.sequenceNumber = sequenceNumber;
+ }
+
+ public String getFeIpAddress() {
+ return FeIpAddress;
+ }
+
+ public void setFeIpAddress(String feIpAddress) {
+ FeIpAddress = feIpAddress;
+ }
+
+ public String getMessageType() {
+ return MessageType;
+ }
+
+ public void setMessageType(String messageType) {
+ MessageType = messageType;
+ }
+
+ public boolean haveRetries() {
+ return retryCount > 0;
+ }
+
+ public void countRetry() {
+ retryCount--;
+ }
+
+ //Message Format: Sequence_id;FrontIpAddress;Message_Type;function(addResource,...);userID; newEventID;newEventType; oldEventID; oldEventType;bookingCapacity
+ @Override
+ public String toString() {
+ return getSequenceNumber() + ";" +
+ getFeIpAddress().toUpperCase() + ";" +
+ getMessageType().toUpperCase() + ";" +
+ getFunction().toUpperCase() + ";" +
+ getClientID().toUpperCase() + ";" +
+ getResourceID().toUpperCase() + ";" +
+ getResourceType().toUpperCase() + ";" +
+ getOldResourceID().toUpperCase() + ";" +
+ getOldResourceType().toUpperCase() + ";" +
+ getDuration();
+ }
+}