1 18 19 20 package sync4j.framework.core; 21 22 import java.util.*; 23 24 import sync4j.framework.core.RepresentationException; 25 26 34 public final class SyncML 35 implements java.io.Serializable { 36 37 39 private SyncHdr header; 40 private SyncBody body; 41 42 44 47 protected SyncML(){}; 48 49 56 public SyncML(final SyncHdr header, 57 final SyncBody body) 58 throws RepresentationException { 59 60 setSyncHdr(header); 61 setSyncBody(body); 62 } 63 64 66 72 public SyncHdr getSyncHdr() { 73 return header; 74 } 75 76 83 public void setSyncHdr(SyncHdr header) { 84 if (header == null) { 85 throw new IllegalArgumentException ("header cannot be null"); 86 } 87 this.header = header; 88 } 89 90 96 public SyncBody getSyncBody() { 97 return body; 98 } 99 100 107 public void setSyncBody(SyncBody body) { 108 if (body == null) { 109 throw new IllegalArgumentException ("body cannot be null"); 110 } 111 this.body = body; 112 } 113 114 119 public boolean isLastMessage() { 120 return body.isFinalMsg(); 121 } 122 123 129 public void setLastMessage() { 130 body.setFinalMsg(Boolean.TRUE); 131 } 132 } 133 | Popular Tags |