1 18 19 20 package sync4j.framework.core; 21 22 import sync4j.framework.core.*; 23 24 33 public class SyncHdr 34 implements java.io.Serializable { 35 36 public static final String COMMAND_NAME = "SyncHdr"; 38 39 41 private VerDTD verDTD ; 42 private VerProto verProto ; 43 private SessionID sessionID; 44 private String msgID ; 45 private Target target ; 46 private Source source ; 47 private String respURI ; 48 private Boolean noResp ; 49 private Cred cred ; 50 private Meta meta ; 51 52 54 55 protected SyncHdr(){} 56 57 72 public SyncHdr(final VerDTD verDTD, 73 final VerProto verProto, 74 final SessionID sessionID, 75 final String msgID, 76 final Target target, 77 final Source source, 78 final String respURI, 79 final boolean noResp, 80 final Cred cred, 81 final Meta meta) { 82 83 setMsgID(msgID); 84 setVerDTD(verDTD); 85 setVerProto(verProto); 86 setSessionID(sessionID); 87 setTarget(target); 88 setSource(source); 89 90 this.noResp = (noResp) ? new Boolean (noResp) : null; 91 this.respURI = respURI; 92 93 this.cred = cred; 94 this.meta = meta; 95 } 96 97 99 104 public VerDTD getVerDTD() { 105 return verDTD; 106 } 107 108 114 public void setVerDTD(VerDTD verDTD) { 115 if (verDTD == null) { 116 throw new IllegalArgumentException ("verDTD cannot be null"); 117 } 118 this.verDTD = verDTD; 119 } 120 121 126 public VerProto getVerProto() { 127 return verProto; 128 } 129 130 135 public void setVerProto(VerProto verProto) { 136 if (verProto == null) { 137 throw new IllegalArgumentException ("verProto cannot be null"); 138 } 139 this.verProto = verProto; 140 } 141 142 147 public SessionID getSessionID() { 148 return sessionID; 149 } 150 151 157 public void setSessionID(SessionID sessionID) { 158 if (sessionID == null) { 159 throw new IllegalArgumentException ("sessionID cannot be null"); 160 } 161 this.sessionID = sessionID; 162 } 163 164 169 public String getMsgID() { 170 return msgID; 171 } 172 173 178 public void setMsgID(String msgID) { 179 if (msgID == null || msgID.length() == 0) { 180 throw new IllegalArgumentException ( 181 "msgID cannot be null or empty"); 182 } 183 this.msgID = msgID; 184 } 185 186 191 public Target getTarget() { 192 return target; 193 } 194 195 200 public void setTarget(Target target) { 201 if (target == null) { 202 throw new IllegalArgumentException ("target cannot be null"); 203 } 204 this.target = target; 205 } 206 207 212 public Source getSource() { 213 return source; 214 } 215 216 221 public void setSource(Source source) { 222 if (source == null) { 223 throw new IllegalArgumentException ("source cannot be null"); 224 } 225 this.source = source; 226 } 227 228 233 public String getRespURI() { 234 return respURI; 235 } 236 237 242 public void setRespURI(String uri) { 243 this.respURI = uri; 244 } 245 246 251 public boolean isNoResp() { 252 return (noResp != null); 253 } 254 255 260 public Boolean getNoResp() { 261 if (!noResp.booleanValue()) { 262 return null; 263 } 264 return noResp; 265 } 266 267 272 public void setNoResp(Boolean noResp) { 273 this.noResp = (noResp.booleanValue()) ? noResp : null; 274 } 275 276 281 public Cred getCred() { 282 return cred; 283 } 284 285 290 public void setCred(Cred cred) { 291 this.cred = cred; 292 } 293 294 299 public Meta getMeta() { 300 return meta; 301 } 302 303 308 public void setMeta(Meta meta) { 309 this.meta = meta; 310 } 311 } | Popular Tags |