org.apache.archiva.metadata.repository
Class RepositorySession
java.lang.Object
org.apache.archiva.metadata.repository.RepositorySession
public class RepositorySession
- extends Object
The repository session provides a single interface to accessing Archiva repositories. It provides access to three
resources:
MetadataRepository
- the metadata content repository for read/write access, in its current state (no
remote resources will be retrieved in the process
MetadataResolver
- access to resolve metadata content, accommodating metadata not yet stored or up to
date in the content repository (i.e. virtualised repositories, remote proxied content, or metadata in a different
model format in the repository storage)
RepositoryStorage
- access to the physical storage of a
repository and the source artifacts and project models
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
repository
private final MetadataRepository repository
resolver
private final MetadataResolver resolver
dirty
private boolean dirty
log
private org.slf4j.Logger log
RepositorySession
public RepositorySession(MetadataRepository metadataRepository,
MetadataResolver resolver)
getRepository
public MetadataRepository getRepository()
getResolver
public MetadataResolver getResolver()
save
public void save()
revert
public void revert()
close
public void close()
- Close the session. Required to be called for all open sessions to ensure resources are properly released.
If the session has been marked as dirty, it will be saved. This may save partial changes in the case of a typical
try { ... } finally { ... }
approach - if this is a problem, ensure you revert changes when an
exception occurs.
can throw RuntimeException
closeQuietly
public void closeQuietly()
- ignore RuntimeException when closing repository
- Since:
- 1.4-M4
markDirty
public void markDirty()
Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.