public class RepositorySession extends Object implements AutoCloseable
MetadataRepository
- the metadata content repository for read/write access, in its current state (no
remote resources will be retrieved in the processMetadataResolver
- 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 modelsModifier and Type | Field and Description |
---|---|
private boolean |
dirty |
private org.slf4j.Logger |
log |
private MetadataRepository |
repository |
private MetadataResolver |
resolver |
Constructor and Description |
---|
RepositorySession(MetadataRepository metadataRepository,
MetadataResolver resolver) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the session.
|
void |
closeQuietly()
ignore RuntimeException when closing repository
|
MetadataRepository |
getRepository() |
MetadataResolver |
getResolver() |
void |
markDirty() |
void |
revert() |
void |
save() |
private final MetadataRepository repository
private final MetadataResolver resolver
private boolean dirty
private org.slf4j.Logger log
public RepositorySession(MetadataRepository metadataRepository, MetadataResolver resolver)
public MetadataRepository getRepository()
public MetadataResolver getResolver()
public void save()
public void revert()
public void close()
try { ... } finally { ... }
approach - if this is a problem, ensure you revert changes when an
exception occurs.
can throw RuntimeExceptionclose
in interface AutoCloseable
public void closeQuietly()
public void markDirty()
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.