View Javadoc
1   package org.apache.archiva.repository.scanner;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.archiva.admin.model.beans.ManagedRepository;
23  import org.apache.archiva.consumers.AbstractMonitoredConsumer;
24  import org.apache.archiva.consumers.ConsumerException;
25  import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
26  
27  import java.util.Date;
28  import java.util.List;
29  
30  /**
31   * SampleKnownConsumer 
32   *
33   *
34   */
35  public class SampleKnownConsumer
36    extends AbstractMonitoredConsumer
37      implements KnownRepositoryContentConsumer
38  {
39      /**
40       * default-value="unset-id"
41       */
42      private String id = "unset-id";
43      
44      @Override
45      public void beginScan( ManagedRepository repository, Date whenGathered )
46          throws ConsumerException
47      {
48          /* nothing to do */
49      }
50  
51      @Override
52      public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
53          throws ConsumerException
54      {
55          beginScan( repository, whenGathered );
56      }
57  
58      @Override
59      public void completeScan()
60      {
61          /* nothing to do */
62      }
63  
64      @Override
65      public void completeScan( boolean executeOnEntireRepo )
66      {
67          completeScan();
68      }
69  
70      @Override
71      public List<String> getExcludes()
72      {
73          return null;
74      }
75  
76      @Override
77      public List<String> getIncludes()
78      {
79          return null;
80      }
81  
82      @Override
83      public void processFile( String path )
84          throws ConsumerException
85      {
86          /* nothing to do */
87      }
88  
89      @Override
90      public void processFile( String path, boolean executeOnEntireRepo )
91          throws Exception
92      {
93          processFile( path );
94      }
95  
96      @Override
97      public String getDescription()
98      {
99          return "Sample Known Consumer";
100     }
101 
102     @Override
103     public String getId()
104     {
105         return id;
106     }
107 
108     public void setId( String id )
109     {
110         this.id = id;
111     }
112 }