|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.archiva.consumers.AbstractMonitoredConsumer org.apache.archiva.consumers.core.repository.RepositoryPurgeConsumer
@Service(value="knownRepositoryContentConsumer#repository-purge") @Scope(value="prototype") public class RepositoryPurgeConsumer
Consumer for removing old snapshots in the repository based on the criteria specified by the user.
Field Summary | |
---|---|
private RepositoryPurge |
cleanUp
|
private ArchivaConfiguration |
configuration
|
private boolean |
deleteReleasedSnapshots
|
private String |
description
default-value="Purge repository of old snapshots" |
private FileTypes |
filetypes
|
private String |
id
default-value="repository-purge" |
private List<String> |
includes
|
private List<RepositoryListener> |
listeners
|
private ManagedRepositoryAdmin |
managedRepositoryAdmin
|
private MetadataTools |
metadataTools
|
private RepositoryPurge |
repoPurge
|
private RepositoryContentFactory |
repositoryContentFactory
|
private RepositorySession |
repositorySession
|
private RepositorySessionFactory |
repositorySessionFactory
FIXME: this could be multiple implementations and needs to be configured. |
Constructor Summary | |
---|---|
RepositoryPurgeConsumer()
|
Method Summary | |
---|---|
void |
afterConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry,
String propertyName,
Object propertyValue)
|
void |
beforeConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry,
String propertyName,
Object propertyValue)
|
void |
beginScan(ManagedRepository repository,
Date whenGathered)
Event that triggers at the beginning of a scan. |
void |
beginScan(ManagedRepository repository,
Date whenGathered,
boolean executeOnEntireRepo)
Event that triggers at the beginning of a scan, where you can also indicate whether the consumers will be executed on an entire repository or on a specific resource. |
void |
completeScan()
Event that triggers on the completion of a scan. |
void |
completeScan(boolean executeOnEntireRepo)
|
RepositoryPurge |
getCleanUp()
|
ArchivaConfiguration |
getConfiguration()
|
String |
getDescription()
The human readable description for this consumer. |
List<String> |
getExcludes()
Get the list of excluded file patterns for this consumer. |
FileTypes |
getFiletypes()
|
String |
getId()
This is the id for the consumer. |
List<String> |
getIncludes()
Get the list of included file patterns for this consumer. |
MetadataTools |
getMetadataTools()
|
RepositoryPurge |
getRepoPurge()
|
RepositoryContentFactory |
getRepositoryContentFactory()
|
RepositorySession |
getRepositorySession()
|
RepositorySessionFactory |
getRepositorySessionFactory()
|
void |
initialize()
|
private void |
initIncludes()
|
boolean |
isDeleteReleasedSnapshots()
|
boolean |
isPermanent()
Flag indicating permanance of consumer. |
boolean |
isProcessUnmodified()
Whether the consumer should process files that have not been modified since the time passed in to the scan method. |
void |
processFile(String path)
Event indicating a file is to be processed by this consumer. |
void |
processFile(String path,
boolean executeOnEntireRepo)
|
void |
setCleanUp(RepositoryPurge cleanUp)
|
void |
setConfiguration(ArchivaConfiguration configuration)
|
void |
setDeleteReleasedSnapshots(boolean deleteReleasedSnapshots)
|
void |
setFiletypes(FileTypes filetypes)
|
void |
setMetadataTools(MetadataTools metadataTools)
|
void |
setRepoPurge(RepositoryPurge repoPurge)
|
void |
setRepositoryContentFactory(RepositoryContentFactory repositoryContentFactory)
|
void |
setRepositorySession(RepositorySession repositorySession)
|
void |
setRepositorySessionFactory(RepositorySessionFactory repositorySessionFactory)
|
Methods inherited from class org.apache.archiva.consumers.AbstractMonitoredConsumer |
---|
addConsumerMonitor, getDefaultArtifactExclusions, removeConsumerMonitor, triggerConsumerError, triggerConsumerInfo, triggerConsumerWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.archiva.consumers.Consumer |
---|
addConsumerMonitor, removeConsumerMonitor |
Field Detail |
---|
private String id
private String description
@Inject @Named(value="archivaConfiguration#default") private ArchivaConfiguration configuration
@Inject private ManagedRepositoryAdmin managedRepositoryAdmin
@Inject @Named(value="repositoryContentFactory#default") private RepositoryContentFactory repositoryContentFactory
@Inject private MetadataTools metadataTools
@Inject @Named(value="fileTypes") private FileTypes filetypes
private List<String> includes
private RepositoryPurge repoPurge
private RepositoryPurge cleanUp
private boolean deleteReleasedSnapshots
@Inject private List<RepositoryListener> listeners
@Inject private RepositorySessionFactory repositorySessionFactory
private RepositorySession repositorySession
Constructor Detail |
---|
public RepositoryPurgeConsumer()
Method Detail |
---|
public String getId()
Consumer
getId
in interface Consumer
public String getDescription()
Consumer
getDescription
in interface Consumer
public boolean isPermanent()
Consumer
isPermanent
in interface Consumer
public List<String> getExcludes()
RepositoryContentConsumer
getExcludes
in interface RepositoryContentConsumer
String
patterns. (example: "**/*.pom"
) - (can be null for no exclusions)public List<String> getIncludes()
RepositoryContentConsumer
getIncludes
in interface RepositoryContentConsumer
String
patterns. (example: "**/*.pom"
)public void beginScan(ManagedRepository repository, Date whenGathered) throws ConsumerException
RepositoryContentConsumer
Event that triggers at the beginning of a scan.
NOTE: This would be a good place to initialize the consumer, to lock any resources, and to generally start tracking the scan as a whole.
beginScan
in interface RepositoryContentConsumer
repository
- the repository that this consumer is being used for.whenGathered
- the start of the repository scan
ConsumerException
- if there was a problem with using the provided repository with the consumer.public void beginScan(ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo) throws ConsumerException
RepositoryContentConsumer
Event that triggers at the beginning of a scan, where you can also indicate whether the consumers will be executed on an entire repository or on a specific resource.
beginScan
in interface RepositoryContentConsumer
repository
- the repository that this consumer is being used for.whenGathered
- the start of the repository scanexecuteOnEntireRepo
- flags whether the consumer will be executed on an entire repository or just on a specific resource
ConsumerException
- if there was a problem with using the provided repository with the consumer.RepositoryContentConsumer.beginScan(ManagedRepository, java.util.Date)
public void processFile(String path) throws ConsumerException
RepositoryContentConsumer
Event indicating a file is to be processed by this consumer.
NOTE: The consumer does not need to process the file immediately, can can opt to queue and/or track
the files to be processed in batch. Just be sure to complete the processing by the RepositoryContentConsumer.completeScan()
event.
processFile
in interface RepositoryContentConsumer
path
- the relative file path (in the repository) to process.
ConsumerException
- if there was a problem processing this file.public void processFile(String path, boolean executeOnEntireRepo) throws Exception
processFile
in interface RepositoryContentConsumer
Exception
public void completeScan()
RepositoryContentConsumer
Event that triggers on the completion of a scan.
NOTE: If the consumer opted to batch up processing requests in the RepositoryContentConsumer.processFile(String)
event
this would be the last opportunity to drain any processing queue's.
completeScan
in interface RepositoryContentConsumer
public void completeScan(boolean executeOnEntireRepo)
completeScan
in interface RepositoryContentConsumer
public void afterConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue)
afterConfigurationChange
in interface org.apache.archiva.redback.components.registry.RegistryListener
public void beforeConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue)
beforeConfigurationChange
in interface org.apache.archiva.redback.components.registry.RegistryListener
private void initIncludes()
@PostConstruct public void initialize()
public boolean isProcessUnmodified()
RepositoryContentConsumer
isProcessUnmodified
in interface RepositoryContentConsumer
isProcessUnmodified
in class AbstractMonitoredConsumer
public ArchivaConfiguration getConfiguration()
public void setConfiguration(ArchivaConfiguration configuration)
public RepositoryContentFactory getRepositoryContentFactory()
public void setRepositoryContentFactory(RepositoryContentFactory repositoryContentFactory)
public MetadataTools getMetadataTools()
public void setMetadataTools(MetadataTools metadataTools)
public FileTypes getFiletypes()
public void setFiletypes(FileTypes filetypes)
public RepositoryPurge getRepoPurge()
public void setRepoPurge(RepositoryPurge repoPurge)
public RepositoryPurge getCleanUp()
public void setCleanUp(RepositoryPurge cleanUp)
public boolean isDeleteReleasedSnapshots()
public void setDeleteReleasedSnapshots(boolean deleteReleasedSnapshots)
public RepositorySessionFactory getRepositorySessionFactory()
public void setRepositorySessionFactory(RepositorySessionFactory repositorySessionFactory)
public RepositorySession getRepositorySession()
public void setRepositorySession(RepositorySession repositorySession)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |