1 18 19 20 package sync4j.framework.core; 21 22 import java.util.*; 23 24 31 public final class DataStore 32 implements java.io.Serializable { 33 34 private SourceRef sourceRef; 36 private String displayName; 37 private long maxGUIDSize; 38 private ContentTypeInfo rxPref; 39 private ArrayList rx = new ArrayList(); 40 private ContentTypeInfo txPref; 41 private ArrayList tx = new ArrayList(); 42 private DSMem dsMem; 43 private SyncCap syncCap; 44 45 47 51 public DataStore() {} 52 53 74 public DataStore(final SourceRef sourceRef, 75 final String displayName, 76 final long maxGUIDSize, 77 final ContentTypeInfo rxPref, 78 final ContentTypeInfo[] rx, 79 final ContentTypeInfo txPref, 80 final ContentTypeInfo[] tx, 81 final DSMem dsMem, 82 final SyncCap syncCap) { 83 84 setSourceRef(sourceRef); 85 setMaxGUIDSize(maxGUIDSize); 86 setRxPref(rxPref); 87 setRx(rx); 88 setTxPref(txPref); 89 setTx(tx); 90 setSyncCap(syncCap); 91 92 this.displayName = displayName; 93 this.dsMem = dsMem; 94 } 95 96 98 103 public SourceRef getSourceRef() { 104 return sourceRef; 105 } 106 107 113 public void setSourceRef(SourceRef sourceRef) { 114 if (sourceRef == null) { 115 throw new IllegalArgumentException ("sourceRef cannot be null"); 116 } 117 this.sourceRef = sourceRef; 118 } 119 120 125 public String getDisplayName() { 126 return displayName; 127 } 128 129 135 public void setDisplayName(String displayName) { 136 this.displayName = displayName; 137 } 138 139 144 public long getMaxGUIDSize() { 145 return maxGUIDSize; 146 } 147 148 public void setMaxGUIDSize(long maxGUIDSize) { 149 if ((maxGUIDSize == 0) || (maxGUIDSize < -1)) { 150 throw new IllegalArgumentException ("illegal maxGUIDSize value"); 151 } 152 this.maxGUIDSize = maxGUIDSize; 153 } 154 155 160 public ContentTypeInfo getRxPref() { 161 return rxPref; 162 } 163 164 169 public void setRxPref(ContentTypeInfo rxPref) { 170 if (rxPref == null) { 171 throw new IllegalArgumentException ("rxPref cannot be null"); 172 } 173 this.rxPref = rxPref; 174 } 175 176 181 public ArrayList getRx() { 182 return rx; 183 } 184 185 190 public void setRx(ContentTypeInfo[] rxCTI) { 191 if (rxCTI == null) { 192 throw new IllegalArgumentException ("rx cannot be null"); 193 } 194 this.rx.clear(); 195 this.rx.addAll(Arrays.asList(rxCTI)); 196 } 197 198 199 204 public ContentTypeInfo getTxPref() { 205 return txPref; 206 } 207 208 213 public void setTxPref(ContentTypeInfo txPref) { 214 if (txPref == null) { 215 throw new IllegalArgumentException ("txPref cannot be null"); 216 } 217 this.txPref = txPref; 218 } 219 220 225 public ArrayList getTx() { 226 return tx; 227 } 228 229 234 public void setTx(ContentTypeInfo[] txCTI) { 235 if (txCTI == null) { 236 throw new IllegalArgumentException ("tx cannot be null"); 237 } 238 this.tx.clear(); 239 this.tx.addAll(Arrays.asList(txCTI)); 240 } 241 242 247 public DSMem getDSMem() { 248 return dsMem; 249 } 250 251 256 public void setDSMem(DSMem dsMem) { 257 this.dsMem = dsMem; 258 } 259 260 265 public SyncCap getSyncCap() { 266 return syncCap; 267 } 268 269 275 public void setSyncCap(SyncCap syncCap) { 276 if (syncCap == null) { 277 throw new IllegalArgumentException ("syncCap cannot be null"); 278 } 279 this.syncCap = syncCap; 280 } 281 } 282 | Popular Tags |