You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SampleKnownConsumer.java 2.6KB

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