1 16 17 package org.apache.catalina.cluster.deploy; 18 19 import org.apache.catalina.cluster.ClusterMessage; 20 import org.apache.catalina.cluster.Member; 21 import java.io.Serializable ; 22 23 29 30 public class FileMessage implements ClusterMessage, Serializable { 31 private int messageNumber; 32 private byte[] data; 33 private int dataLength; 34 private org.apache.catalina.cluster.Member address; 35 36 private long timestamp; 37 private long totalLength; 38 private long totalNrOfMsgs; 39 private String fileName; 40 private String contextPath; 41 42 public FileMessage(Member source, 43 String fileName, 44 String contextPath) { 45 this.address=source; 46 this.fileName=fileName; 47 this.contextPath=contextPath; 48 } 49 50 59 60 public int getMessageNumber() { 61 return messageNumber; 62 } 63 public void setMessageNumber(int messageNumber) { 64 this.messageNumber = messageNumber; 65 } 66 public long getTotalNrOfMsgs() { 67 return totalNrOfMsgs; 68 } 69 public void setTotalNrOfMsgs(long totalNrOfMsgs) { 70 this.totalNrOfMsgs = totalNrOfMsgs; 71 } 72 public byte[] getData() { 73 return data; 74 } 75 public void setData(byte[] data, int length) { 76 this.data = data; 77 this.dataLength = length; 78 } 79 public int getDataLength() { 80 return dataLength; 81 } 82 public void setDataLength(int dataLength) { 83 this.dataLength = dataLength; 84 } 85 public long getTotalLength() { 86 return totalLength; 87 } 88 public void setTotalLength(long totalLength) { 89 this.totalLength = totalLength; 90 } 91 public org.apache.catalina.cluster.Member getAddress() { 92 return address; 93 } 94 public void setAddress(org.apache.catalina.cluster.Member address) { 95 this.address = address; 96 } 97 public String getUniqueId() { 98 StringBuffer result = new StringBuffer (getFileName()); 99 result.append("#-#"); 100 result.append(getMessageNumber()); 101 result.append("#-#"); 102 result.append(System.currentTimeMillis()); 103 return result.toString(); 104 } 105 106 public long getTimestamp() { 107 return timestamp; 108 } 109 public void setTimestamp(long timestamp) { 110 this.timestamp = timestamp; 111 } 112 public String getFileName() { 113 return fileName; 114 } 115 public void setFileName(String fileName) { 116 this.fileName = fileName; 117 } 118 public String getContextPath() { 119 return contextPath; 120 } 121 122 123 } 124 | Popular Tags |