Record.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package de.tudarmstadt.informatik.hostage.logging;
  2. import de.tudarmstadt.informatik.hostage.logging.MessageRecord.TYPE;
  3. import de.tudarmstadt.informatik.hostage.logging.formatter.Formatter;
  4. public class Record {
  5. //
  6. private MessageRecord message;
  7. // attack
  8. private AttackRecord attack;
  9. // network
  10. private NetworkRecord network;
  11. public Record(){
  12. message = new MessageRecord();
  13. attack = new AttackRecord();
  14. network = new NetworkRecord();
  15. }
  16. public float getAccuracy() {
  17. return network.getAccuracy();
  18. }
  19. public long getAttack_id() {
  20. return attack.getAttack_id();
  21. }
  22. public String getBssid() {
  23. return network.getBssid();
  24. }
  25. public String getExternalIP() {
  26. return attack.getExternalIP();
  27. }
  28. public int getId() {
  29. return message.getId();
  30. }
  31. public double getLatitude() {
  32. return network.getLatitude();
  33. }
  34. public String getLocalIP() {
  35. return attack.getLocalIP();
  36. }
  37. public int getLocalPort() {
  38. return attack.getLocalPort();
  39. }
  40. public double getLongitude() {
  41. return network.getLongitude();
  42. }
  43. public String getPacket() {
  44. return message.getPacket();
  45. }
  46. public String getProtocol() {
  47. return attack.getProtocol();
  48. }
  49. public String getRemoteIP() {
  50. return attack.getRemoteIP();
  51. }
  52. public int getRemotePort() {
  53. return attack.getRemotePort();
  54. }
  55. public String getSsid() {
  56. return network.getSsid();
  57. }
  58. public long getTimestamp() {
  59. return message.getTimestamp();
  60. }
  61. public long getTimestampLocation() {
  62. return network.getTimestampLocation();
  63. }
  64. public TYPE getType() {
  65. return message.getType();
  66. }
  67. public void setAccuracy(float accuracy) {
  68. network.setAccuracy(accuracy);
  69. }
  70. public void setAttack_id(long attack_id) {
  71. message.setAttack_id(attack_id);
  72. attack.setAttack_id(attack_id);
  73. }
  74. public void setBssid(String bssid) {
  75. attack.setBssid(bssid);
  76. network.setBssid(bssid);
  77. }
  78. public void setExternalIP(String externalIP) {
  79. attack.setExternalIP(externalIP);
  80. }
  81. public void setId(int id) {
  82. message.setId(id);
  83. }
  84. public void setLatitude(double latitude) {
  85. network.setLatitude(latitude);
  86. }
  87. public void setLocalIP(String localIP) {
  88. attack.setLocalIP(localIP);
  89. }
  90. public void setLocalPort(int localPort) {
  91. attack.setLocalPort(localPort);
  92. }
  93. public void setLongitude(double longitude) {
  94. network.setLongitude(longitude);
  95. }
  96. public void setPacket(String packet) {
  97. message.setPacket(packet);
  98. }
  99. public void setProtocol(String protocol) {
  100. attack.setProtocol(protocol);
  101. }
  102. public void setRemoteIP(String remoteIP) {
  103. attack.setRemoteIP(remoteIP);
  104. }
  105. public void setRemotePort(int remotePort) {
  106. attack.setRemotePort(remotePort);
  107. }
  108. public void setSsid(String ssid) {
  109. network.setSsid(ssid);
  110. }
  111. public void setTimestamp(long timestamp) {
  112. message.setTimestamp(timestamp);
  113. }
  114. public void setTimestampLocation(long timestampLocation) {
  115. network.setTimestampLocation(timestampLocation);
  116. }
  117. public void setType(TYPE type) {
  118. message.setType(type);
  119. }
  120. @Override
  121. public String toString() {
  122. return toString(null);
  123. }
  124. public String toString(Formatter formatter) {
  125. if (null == formatter) {
  126. return Formatter.getDefault().format(this);
  127. }
  128. return formatter.format(this);
  129. }
  130. }