1 package org.jahia.services.search; 2 3 import org.quartz.JobDetail; 4 5 import java.util.Vector ; 6 7 14 public class IndexationJobDetail extends JobDetail { 15 16 private Vector documents = new Vector (); 17 18 private long sleepInterval = 1000; 19 20 private boolean shutdown = false; 21 22 private int nbDocs; 23 24 public IndexationJobDetail() { 25 super(); 26 } 27 28 public IndexationJobDetail(String s, String s1, Class aClass) { 29 super(s, s1,aClass); 30 } 31 32 public IndexationJobDetail(String s, String s1, Class aClass, boolean b, boolean b1, boolean b2) { 33 super(s, s1, aClass, b, b1, b2); 34 } 35 36 public synchronized void addDocument (JahiaIndexableDocument doc){ 37 if ( doc != null ){ 38 this.documents.add(doc); 39 nbDocs++; 40 } 41 } 42 43 47 public synchronized Vector getAllDocuments() { 48 Vector v = new Vector (); 49 v.addAll(this.documents); 50 this.documents = new Vector (); 51 return v; 52 } 53 54 public long getSleepInterval() { 55 return sleepInterval; 56 } 57 58 public void setSleepInterval(long sleepInterval) { 59 this.sleepInterval = sleepInterval; 60 } 61 62 public boolean isShutdown() { 63 return shutdown; 64 } 65 66 public void setShutdown(boolean shutdown) { 67 this.shutdown = shutdown; 68 } 69 70 public synchronized int getNbDocs() { 71 return nbDocs; 72 } 73 74 public synchronized void decrementNbDocs() { 75 this.nbDocs--; 76 } 77 78 } 79 | Popular Tags |