1 34 package org.dspace.checker; 35 36 import java.util.Date ; 37 38 49 public final class BitstreamInfo 50 { 51 52 private boolean deleted; 53 54 55 private DSpaceBitstreamInfo dspaceBitstream; 56 57 62 private boolean infoFound; 63 64 65 private boolean bitstreamFound; 66 67 68 private String calculatedChecksum; 69 70 71 private boolean toBeProcessed; 72 73 74 private String checksumCheckResult; 75 76 77 private Date processStartDate; 78 79 80 private Date processEndDate; 81 82 85 private BitstreamInfo() 86 { 87 ; 88 } 89 90 96 public BitstreamInfo(int bid) 97 { 98 deleted = false; 99 100 dspaceBitstream = new DSpaceBitstreamInfo(bid); 101 102 infoFound = true; 105 bitstreamFound = false; 106 calculatedChecksum = null; 107 processEndDate = null; 108 toBeProcessed = false; 109 processStartDate = new Date (); 110 } 111 112 144 public BitstreamInfo(boolean del, int storeNo, int sz, String bitstrmFmt, 145 int bitstrmId, String usrFmtDesc, String intrnlId, String src, 146 String chksumAlgorthm, String chksum, String nm, Date procEndDate, 147 boolean toBeProc, Date procStartDate) 148 { 149 dspaceBitstream = new DSpaceBitstreamInfo(del, storeNo, sz, bitstrmFmt, 150 bitstrmId, usrFmtDesc, intrnlId, src, chksumAlgorthm, chksum, 151 nm, ""); 152 153 this.deleted = del; 154 this.processEndDate = procEndDate; 155 this.toBeProcessed = toBeProc; 156 this.processStartDate = procStartDate; 157 this.infoFound = true; 158 } 159 160 165 public boolean getDeleted() 166 { 167 return deleted; 168 } 169 170 176 public void setDeleted(boolean deleted) 177 { 178 this.deleted = deleted; 179 } 180 181 186 public int getStoreNumber() 187 { 188 return dspaceBitstream.getStoreNumber(); 189 } 190 191 197 public void setStoreNumber(int storeNumber) 198 { 199 dspaceBitstream.setStoreNumber(storeNumber); 200 } 201 202 207 public int getSize() 208 { 209 return dspaceBitstream.getSize(); 210 } 211 212 218 public void setSize(int size) 219 { 220 dspaceBitstream.setSize(size); 221 } 222 223 228 public String getBitstreamFormatId() 229 { 230 return dspaceBitstream.getBitstreamFormatId(); 231 } 232 233 239 public void setBitstreamFormatId(String bitstrmFmt) 240 { 241 dspaceBitstream.setBitstreamFormatId(bitstrmFmt); 242 } 243 244 249 public int getBitstreamId() 250 { 251 return dspaceBitstream.getBitstreamId(); 252 } 253 254 259 public String getUserFormatDescription() 260 { 261 return dspaceBitstream.getUserFormatDescription(); 262 } 263 264 270 public void setUserFormatDescription(String userFormatDescription) 271 { 272 dspaceBitstream.setUserFormatDescription(userFormatDescription); 273 } 274 275 280 public String getInternalId() 281 { 282 return dspaceBitstream.getInternalId(); 283 } 284 285 291 public void setInternalId(String internalId) 292 { 293 dspaceBitstream.setInternalId(internalId); 294 } 295 296 301 public String getSource() 302 { 303 return dspaceBitstream.getSource(); 304 } 305 306 312 public void setSource(String source) 313 { 314 dspaceBitstream.setSource(source); 315 } 316 317 322 public String getChecksumAlgorithm() 323 { 324 return dspaceBitstream.getChecksumAlgorithm(); 325 } 326 327 333 public void setChecksumAlgorithm(String checksumAlgorithm) 334 { 335 dspaceBitstream.setChecksumAlgorithm(checksumAlgorithm); 336 } 337 338 343 public String getStoredChecksum() 344 { 345 return dspaceBitstream.getStoredChecksum(); 346 } 347 348 354 public void setStoredChecksum(String checksum) 355 { 356 dspaceBitstream.setStoredChecksum(checksum); 357 } 358 359 364 public String getName() 365 { 366 return dspaceBitstream.getName(); 367 } 368 369 375 public void setName(String nm) 376 { 377 dspaceBitstream.setName(nm); 378 } 379 380 385 public String getCalculatedChecksum() 386 { 387 return calculatedChecksum; 388 } 389 390 396 public void setCalculatedChecksum(String calculatedChecksum) 397 { 398 this.calculatedChecksum = calculatedChecksum; 399 } 400 401 406 public boolean getInfoFound() 407 { 408 return this.infoFound; 409 } 410 411 417 public void setInfoFound(boolean found) 418 { 419 this.infoFound = found; 420 } 421 422 427 public boolean getBitstreamFound() 428 { 429 return this.bitstreamFound; 430 } 431 432 438 public void setBitstreamFound(boolean found) 439 { 440 this.bitstreamFound = found; 441 } 442 443 448 public boolean equals(Object o) 449 { 450 if (this == o) 451 { 452 return true; 453 } 454 455 if (!(o instanceof BitstreamInfo)) 456 { 457 return false; 458 } 459 460 BitstreamInfo other = (BitstreamInfo) o; 461 462 return (this.getBitstreamId() == other.getBitstreamId()); 463 } 464 465 470 public int hashCode() 471 { 472 return getBitstreamId(); 473 } 474 475 480 public String toString() 481 { 482 return new StringBuffer ("ChecksumInformation for id ").append( 483 getBitstreamId()).toString(); 484 } 485 486 492 public void setToBeProcessed(boolean toBeProcessed) 493 { 494 this.toBeProcessed = toBeProcessed; 495 } 496 497 502 public boolean getToBeProcessed() 503 { 504 return this.toBeProcessed; 505 } 506 507 512 public String getChecksumCheckResult() 513 { 514 return this.checksumCheckResult; 515 } 516 517 523 public void setChecksumCheckResult(String resultCode) 524 { 525 this.checksumCheckResult = resultCode; 526 } 527 528 533 public Date getProcessStartDate() 534 { 535 return this.processStartDate; 536 } 537 538 544 public void setProcessStartDate(Date startDate) 545 { 546 this.processStartDate = startDate; 547 } 548 549 554 public Date getProcessEndDate() 555 { 556 return this.processEndDate; 557 } 558 559 565 public void setProcessEndDate(Date endDate) 566 { 567 this.processEndDate = endDate; 568 } 569 } 570 | Popular Tags |