KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > archive > cumulus > ConvertTask


1 package com.openedit.archive.cumulus;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5
6 import com.canto.cumulus.ServerCatalog;
7 import com.openedit.archive.Archive;
8 import com.openedit.config.Configuration;
9
10 public class ConvertTask implements Runnable JavaDoc
11 {
12     Archive fieldArchive;
13     ServerCatalog fieldServerCatalog;
14     ConvertStatus fieldStatus;
15     CumulusSyncConverter fieldConverter;
16     private static final Log log = LogFactory.getLog(ConvertTask.class);
17     public void run()
18     {
19         try
20         {
21             Configuration config = getArchive().getSettings().getChild("catalogsync");
22     
23             
24             Configuration setting = getConverter().openSettings(getServerCatalog().getName(),config);
25             if( Boolean.parseBoolean( setting.getAttribute("skip") ) )
26             {
27                 getStatus().add("Skipped catalog " + getServerCatalog().getName());
28                 log.debug("Skipped catalog " + getServerCatalog().getName());
29                 return;
30             }
31             //check for modifications since last time we checked
32
getConverter().syncOneCatalog( setting, getServerCatalog(), getArchive(), getStatus());
33         }
34         catch ( Exception JavaDoc ex)
35         {
36             log.error(ex);
37             log.info("Error in convert of " + getServerCatalog().getName() + " " + ex);
38             getStatus().setException(ex);
39         }
40         
41     }
42
43     
44
45     public Archive getArchive()
46     {
47         return fieldArchive;
48     }
49
50     public void setArchive(Archive inArchive)
51     {
52         fieldArchive = inArchive;
53     }
54
55     public ServerCatalog getServerCatalog()
56     {
57         return fieldServerCatalog;
58     }
59
60     public void setServerCatalog(ServerCatalog inServerCatalog)
61     {
62         fieldServerCatalog = inServerCatalog;
63     }
64
65
66     public CumulusSyncConverter getConverter()
67     {
68         return fieldConverter;
69     }
70
71     public void setConverter(CumulusSyncConverter inConverter)
72     {
73         fieldConverter = inConverter;
74     }
75
76     public ConvertStatus getStatus()
77     {
78         return fieldStatus;
79     }
80
81     public void setStatus(ConvertStatus inStatus)
82     {
83         fieldStatus = inStatus;
84     }
85
86 }
87
Popular Tags