/** * Title: Data Transfer/Routing Simulation

* Description:

* Copyright: Copyright (c) Aaron Morris

* Company: CS522

* @author Aaron Morris * @version 1.0 */ //package datasend; public class Message { private String HeaderName; // "RESPONSE", "REQUEST" Etc.... private int MessageID; // ID of request private int HeaderSize; // Size of Attached Message private int OrigSendTime; // Sending time of Message private DataHandler SourceObject; // Original Sending Object of Message private int CurrentLoad; // Current Load of Responding Server private Message next; // For linked list implementation private DataHandler Source; // Source of Message private DataHandler Destination; // Target Destination of Message private String Body; // Body of message -- File, FileName private int sortValue; public Message(int Time, int ID, String headerName, int hs, String MBody, int CurrentLoad, DataHandler src) { next = null; HeaderName = new String(); HeaderName = headerName; HeaderSize = hs; OrigSendTime = Time; MessageID = ID; Body = MBody; CurrentLoad = 0; Source = src; //Destination = dst; sortValue = 0; } public String getHeaderName() { return HeaderName; } public void setHeaderName(String s) { HeaderName = s; } public String getBody() { return Body; } public void setBody(String s) { Body = s; } public int getCurrentLoad() { return CurrentLoad; } public void setCurrentLoad(int l) { CurrentLoad = l; } public int getHeaderSize() { return HeaderSize; } public void setHeaderSize(int x) { HeaderSize = x; } public int getMsgID() { return MessageID; } public int getSendTime() { return OrigSendTime; } public DataHandler getSource() { return Source; } public void setSource(DataHandler d) { Source = d; } public DataHandler getDestination() { return Destination; } public void setOrigTime(int Time) { OrigSendTime = Time; } public void setOrigObj(DataHandler d) { SourceObject = d; } public DataHandler getOrigObj() { return SourceObject; } public int getSortVal() { return this.sortValue; } public Message getNext() { return this.next; } public void setNext(Message m) { this.next = m; } // This will create a String representation of an event for reporting public String getStringRep() { return "[" + HeaderName + ",#" + MessageID + "," + OrigSendTime + ",Size " + HeaderSize + "]"; } }