1 34 package org.dspace.checker; 35 36 import java.util.Date ; 37 38 47 public class SimpleDispatcher implements BitstreamDispatcher 48 { 49 50 53 private boolean loopContinuously = false; 54 55 58 private Date processStartTime = null; 59 60 64 private int bitstreamId = -1; 65 66 69 private BitstreamInfoDAO bitstreamInfoDAO; 70 71 80 public SimpleDispatcher(BitstreamInfoDAO bitstreamInfoDAO, Date startTime, 81 boolean looping) 82 { 83 this.bitstreamInfoDAO = bitstreamInfoDAO; 84 this.processStartTime = startTime; 85 this.loopContinuously = looping; 86 } 87 88 91 private SimpleDispatcher() 92 { 93 ; 94 } 95 96 101 public synchronized int next() 102 { 103 if (!loopContinuously && (processStartTime != null)) 106 { 107 return bitstreamInfoDAO.getOldestBitstream(new java.sql.Timestamp ( 108 processStartTime.getTime())); 109 } 110 else 111 { 112 return bitstreamInfoDAO.getOldestBitstream(); 113 } 114 115 } 116 } 117 | Popular Tags |