KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > search > IndexationJobDetail


1 package org.jahia.services.search;
2
3 import org.quartz.JobDetail;
4
5 import java.util.Vector JavaDoc;
6
7 /**
8  * Created by IntelliJ IDEA.
9  * User: hollis
10  * Date: 26 avr. 2005
11  * Time: 18:19:52
12  * To change this template use File | Settings | File Templates.
13  */

14 public class IndexationJobDetail extends JobDetail {
15
16     private Vector JavaDoc documents = new Vector JavaDoc();
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 JavaDoc s, String JavaDoc s1, Class JavaDoc aClass) {
29         super(s, s1,aClass);
30     }
31
32     public IndexationJobDetail(String JavaDoc s, String JavaDoc s1, Class JavaDoc 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     /**
44      * Return a vector containing all the documents, the internal vector is then reseted to new empty vector
45      *
46      */

47     public synchronized Vector JavaDoc getAllDocuments() {
48         Vector JavaDoc v = new Vector JavaDoc();
49         v.addAll(this.documents);
50         this.documents = new Vector JavaDoc();
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