Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DatabaseScanningConfiguration |
|
| 0.0;0 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.archiva.configuration; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * | |
15 | * The scanning configuration for unprocessed | |
16 | * ArchivaArtifact database objects. | |
17 | * | |
18 | * | |
19 | * @version $Revision$ $Date$ | |
20 | */ | |
21 | 0 | public class DatabaseScanningConfiguration |
22 | implements java.io.Serializable | |
23 | { | |
24 | ||
25 | //--------------------------/ | |
26 | //- Class/Member Variables -/ | |
27 | //--------------------------/ | |
28 | ||
29 | /** | |
30 | * When to run the database scanning mechanism. Default is | |
31 | * every two hours on the hour. | |
32 | * | |
33 | */ | |
34 | 0 | private String cronExpression = "0 0 0/2 * * ?"; |
35 | ||
36 | /** | |
37 | * Field unprocessedConsumers. | |
38 | */ | |
39 | private java.util.List<String> unprocessedConsumers; | |
40 | ||
41 | /** | |
42 | * Field cleanupConsumers. | |
43 | */ | |
44 | private java.util.List<String> cleanupConsumers; | |
45 | ||
46 | ||
47 | //-----------/ | |
48 | //- Methods -/ | |
49 | //-----------/ | |
50 | ||
51 | /** | |
52 | * Method addCleanupConsumer. | |
53 | * | |
54 | * @param string | |
55 | */ | |
56 | public void addCleanupConsumer( String string ) | |
57 | { | |
58 | 0 | if ( !(string instanceof String) ) |
59 | { | |
60 | 0 | throw new ClassCastException( "DatabaseScanningConfiguration.addCleanupConsumers(string) parameter must be instanceof " + String.class.getName() ); |
61 | } | |
62 | 0 | getCleanupConsumers().add( string ); |
63 | 0 | } //-- void addCleanupConsumer( String ) |
64 | ||
65 | /** | |
66 | * Method addUnprocessedConsumer. | |
67 | * | |
68 | * @param string | |
69 | */ | |
70 | public void addUnprocessedConsumer( String string ) | |
71 | { | |
72 | 0 | if ( !(string instanceof String) ) |
73 | { | |
74 | 0 | throw new ClassCastException( "DatabaseScanningConfiguration.addUnprocessedConsumers(string) parameter must be instanceof " + String.class.getName() ); |
75 | } | |
76 | 0 | getUnprocessedConsumers().add( string ); |
77 | 0 | } //-- void addUnprocessedConsumer( String ) |
78 | ||
79 | /** | |
80 | * Method getCleanupConsumers. | |
81 | * | |
82 | * @return List | |
83 | */ | |
84 | public java.util.List<String> getCleanupConsumers() | |
85 | { | |
86 | 0 | if ( this.cleanupConsumers == null ) |
87 | { | |
88 | 0 | this.cleanupConsumers = new java.util.ArrayList<String>(); |
89 | } | |
90 | ||
91 | 0 | return this.cleanupConsumers; |
92 | } //-- java.util.List<String> getCleanupConsumers() | |
93 | ||
94 | /** | |
95 | * Get when to run the database scanning mechanism. Default is | |
96 | * every two hours on the hour. | |
97 | * | |
98 | * | |
99 | * @return String | |
100 | */ | |
101 | public String getCronExpression() | |
102 | { | |
103 | 0 | return this.cronExpression; |
104 | } //-- String getCronExpression() | |
105 | ||
106 | /** | |
107 | * Method getUnprocessedConsumers. | |
108 | * | |
109 | * @return List | |
110 | */ | |
111 | public java.util.List<String> getUnprocessedConsumers() | |
112 | { | |
113 | 0 | if ( this.unprocessedConsumers == null ) |
114 | { | |
115 | 0 | this.unprocessedConsumers = new java.util.ArrayList<String>(); |
116 | } | |
117 | ||
118 | 0 | return this.unprocessedConsumers; |
119 | } //-- java.util.List<String> getUnprocessedConsumers() | |
120 | ||
121 | /** | |
122 | * Method removeCleanupConsumer. | |
123 | * | |
124 | * @param string | |
125 | */ | |
126 | public void removeCleanupConsumer( String string ) | |
127 | { | |
128 | 0 | if ( !(string instanceof String) ) |
129 | { | |
130 | 0 | throw new ClassCastException( "DatabaseScanningConfiguration.removeCleanupConsumers(string) parameter must be instanceof " + String.class.getName() ); |
131 | } | |
132 | 0 | getCleanupConsumers().remove( string ); |
133 | 0 | } //-- void removeCleanupConsumer( String ) |
134 | ||
135 | /** | |
136 | * Method removeUnprocessedConsumer. | |
137 | * | |
138 | * @param string | |
139 | */ | |
140 | public void removeUnprocessedConsumer( String string ) | |
141 | { | |
142 | 0 | if ( !(string instanceof String) ) |
143 | { | |
144 | 0 | throw new ClassCastException( "DatabaseScanningConfiguration.removeUnprocessedConsumers(string) parameter must be instanceof " + String.class.getName() ); |
145 | } | |
146 | 0 | getUnprocessedConsumers().remove( string ); |
147 | 0 | } //-- void removeUnprocessedConsumer( String ) |
148 | ||
149 | /** | |
150 | * Set | |
151 | * The list of consumers for previously processed | |
152 | * ArchivaArtifact database | |
153 | * objects that no longer exist on the filesystem, | |
154 | * and might need to | |
155 | * undergo a cleanup. | |
156 | * | |
157 | * | |
158 | * @param cleanupConsumers | |
159 | */ | |
160 | public void setCleanupConsumers( java.util.List<String> cleanupConsumers ) | |
161 | { | |
162 | 0 | this.cleanupConsumers = cleanupConsumers; |
163 | 0 | } //-- void setCleanupConsumers( java.util.List ) |
164 | ||
165 | /** | |
166 | * Set when to run the database scanning mechanism. Default is | |
167 | * every two hours on the hour. | |
168 | * | |
169 | * | |
170 | * @param cronExpression | |
171 | */ | |
172 | public void setCronExpression( String cronExpression ) | |
173 | { | |
174 | 0 | this.cronExpression = cronExpression; |
175 | 0 | } //-- void setCronExpression( String ) |
176 | ||
177 | /** | |
178 | * Set | |
179 | * The list of consumers for the unprocessed | |
180 | * ArchivaArtifact database objects. | |
181 | * | |
182 | * | |
183 | * @param unprocessedConsumers | |
184 | */ | |
185 | public void setUnprocessedConsumers( java.util.List<String> unprocessedConsumers ) | |
186 | { | |
187 | 0 | this.unprocessedConsumers = unprocessedConsumers; |
188 | 0 | } //-- void setUnprocessedConsumers( java.util.List ) |
189 | ||
190 | ||
191 | } |