1 package org.apache.maven.archiva.scheduled;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
23 import org.apache.maven.archiva.consumers.ConsumerException;
24 import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
25 import org.apache.maven.archiva.model.ArchivaArtifact;
26
27 import java.util.List;
28
29
30
31
32
33
34 public class TestDatabaseCleanupConsumer
35 extends AbstractMonitoredConsumer
36 implements DatabaseCleanupConsumer
37 {
38 private int countBegin = 0;
39 private int countComplete = 0;
40 private int countProcessed = 0;
41
42 public void resetCount()
43 {
44 countBegin = 0;
45 countProcessed = 0;
46 countComplete = 0;
47 }
48
49 public void beginScan()
50 {
51 countBegin++;
52 }
53
54 public void completeScan()
55 {
56 countComplete++;
57 }
58
59 public List<String> getIncludedTypes()
60 {
61 return null;
62 }
63
64 public void processArchivaArtifact( ArchivaArtifact artifact )
65 throws ConsumerException
66 {
67 countProcessed++;
68 }
69
70 public String getDescription()
71 {
72 return "Test Consumer for Database Cleanup";
73 }
74
75 public String getId()
76 {
77 return "test-db-cleanup";
78 }
79
80 public boolean isPermanent()
81 {
82 return false;
83 }
84
85 public int getCountBegin()
86 {
87 return countBegin;
88 }
89
90 public int getCountComplete()
91 {
92 return countComplete;
93 }
94
95 public int getCountProcessed()
96 {
97 return countProcessed;
98 }
99 }