SyncMessage.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package de.tudarmstadt.informatik.hostage.sync;
  2. import java.io.Serializable;
  3. /**
  4. * Message class for synchronization between devices.
  5. * @author Lars Pandikow
  6. */
  7. public class SyncMessage implements Serializable{
  8. private static final long serialVersionUID = -7597101233186914926L;
  9. //REQUEST CODES
  10. public static final int SYNC_REQUEST = 0x00;
  11. public static final int SYNC_RESPONSE_NET_INFO = 0x01;
  12. public static final int SYNC_RESPONSE_SYNC_INFO = 0x02;
  13. private int message_code;
  14. private Object payload;
  15. public SyncMessage(int message_code, Object payload){
  16. this.message_code = message_code;
  17. this.payload = payload;
  18. }
  19. /**
  20. * @return the message_code
  21. */
  22. public int getMessage_code() {
  23. return message_code;
  24. }
  25. /**
  26. * @param message_code the message_code to set
  27. */
  28. public void setMessage_code(int message_code) {
  29. this.message_code = message_code;
  30. }
  31. /**
  32. * @return the payload
  33. */
  34. public Object getPayload() {
  35. return payload;
  36. }
  37. /**
  38. * @param payload the payload to set
  39. */
  40. public void setPayload(Object payload) {
  41. this.payload = payload;
  42. }
  43. }