public abstract class AbstractBaseRepository extends Object implements Repository
Repository.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
AbstractBaseRepository.ResourceMapper |
Repository.ProtocolVersion| Modifier and Type | Field and Description |
|---|---|
protected Resource |
base |
protected org.apache.http.client.HttpClient |
client |
protected AbstractBaseRepository.ResourceMapper |
config |
protected org.apache.http.protocol.HttpContext |
context |
protected URI |
repository |
protected UUID |
repositoryId |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBaseRepository(URI repository,
Resource base,
UUID id,
AbstractBaseRepository.ResourceMapper config,
org.apache.http.client.HttpClient client,
org.apache.http.protocol.HttpContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Transaction transaction,
Resource resource,
boolean parents,
InputStream content)
Upload a new revision of the resource and set properties.
|
void |
copy(Transaction transaction,
Resource sourceResource,
Revision sourceRevision,
Resource targetResource,
boolean parents)
Recursively copy a resource in the given revision.
|
View |
createView()
Create a new
View to query consistent repository information. |
void |
delete(Transaction transaction,
Resource resource)
Delete the resource from the repository.
|
protected Revision |
determineHeadRevision() |
InputStream |
download(Resource resource,
Revision revision)
Download the resource.
|
InputStream |
download(View view,
Resource resource,
Revision revision)
Download the resource.
|
URI |
downloadURI(Resource resource,
Revision revision)
Determine the HTTP download URI for the resource.
|
URI |
downloadURI(View view,
Resource resource,
Revision revision)
Determine the HTTP download URI for the resource.
|
boolean |
exists(Resource resource,
Revision revision)
Check if the resource already exists in the latest revision of the repository.
|
boolean |
exists(View view,
Resource resource,
Revision revision)
Check if the resource already exists in the latest revision of the repository.
|
Resource |
getBasePath()
Returns the
Resource to the base for this Repository. |
URI |
getBaseUri()
Returns the
URI to the root of this Repository. |
protected Revision |
getConcreteRevision(View view,
Revision revision) |
protected Set<Info> |
getInfoSetWithLockTokens(Transaction transaction) |
UUID |
getRepositoryId()
Returns the
UUID that identifies the Repository globally. |
Info |
info(Resource resource,
Revision revision,
ResourceProperty.Key... keys)
Retrieve information for the resource.
|
Info |
info(View view,
Resource resource,
Revision revision,
ResourceProperty.Key... keys)
Retrieve information for the resource.
|
Set<Info> |
list(Resource resource,
Revision revision,
Depth depth,
ResourceProperty.Key... keys)
Retrieve information for the resource in the given revision and its child resources (depending on depth
parameter).
|
Set<Info> |
list(View view,
Resource resource,
Revision revision,
Depth depth,
ResourceProperty.Key... keys)
Retrieve information for the resource in the given revision and its child resources (depending on depth
parameter).
|
void |
lock(Resource resource,
boolean steal)
Mark the expected revision of the resource as locked.
|
List<Log> |
log(Resource resource,
Revision startRevision,
Revision endRevision,
int limit,
boolean stopOnCopy)
Retrieve the log information for the revisions between startRevision and endRevision of the resource.
|
List<Log> |
log(View view,
Resource resource,
Revision startRevision,
Revision endRevision,
int limit,
boolean stopOnCopy)
Retrieve the log information for the revisions between startRevision and endRevision of the resource.
|
void |
mkdir(Transaction transaction,
Resource resource,
boolean parent)
Create a folder with all necessary parents folders.
|
void |
move(Transaction transaction,
Resource srcResource,
Resource targetResource,
boolean parents)
Recursively move a resource (latest revision).
|
void |
propertiesDelete(Transaction transaction,
Resource resource,
ResourceProperty... properties)
Remove the given properties form the resource.
|
void |
propertiesSet(Transaction transaction,
Resource resource,
ResourceProperty... properties)
Set the given properties for the resource (new properties will be added, existing properties will be
overridden).
|
protected void |
propertiesUpdate(Transaction transaction,
QualifiedResource resource,
de.shadowhunt.subversion.internal.PropertiesUpdateOperation.Type type,
ResourceProperty... properties) |
protected abstract void |
registerResource(Transaction transaction,
Resource resource,
Revision revision) |
protected QualifiedResource |
resolve(View view,
QualifiedResource resource,
Revision revision,
boolean resolve) |
void |
rollback(Transaction transaction)
Abort the current running
Transaction and revert all modifications. |
void |
rollbackIfNotCommitted(Transaction transaction)
Abort the current running
Transaction and revert all modifications if the transaction is not committed. |
void |
unlock(Resource resource,
boolean force)
Remove the lock on the expected revision of the resource.
|
protected void |
validateRevision(View view,
Revision revision) |
protected void |
validateTransaction(Transaction transaction) |
protected void |
validateView(View view) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommit, createTransaction, getProtocolVersionprotected final Resource base
protected final org.apache.http.client.HttpClient client
protected final AbstractBaseRepository.ResourceMapper config
protected final org.apache.http.protocol.HttpContext context
protected final URI repository
protected final UUID repositoryId
protected AbstractBaseRepository(URI repository, Resource base, UUID id, AbstractBaseRepository.ResourceMapper config, org.apache.http.client.HttpClient client, org.apache.http.protocol.HttpContext context)
public void add(Transaction transaction, Resource resource, boolean parents, InputStream content)
Repositoryadd in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)parents - whether to create missing parents folders or notcontent - InputStream from which the content will be read (will be closed after transfer)public void copy(Transaction transaction, Resource sourceResource, Revision sourceRevision, Resource targetResource, boolean parents)
Repositorycopy in interface Repositorytransaction - the current running TransactionsourceResource - the Resource of the source resource (relative to the repository root)sourceRevision - Revision of the resource to copytargetResource - the Resource of the target resource (relative to the repository root)parents - whether to create missing parents folders or notpublic View createView()
RepositoryView to query consistent repository information.createView in interface RepositoryViewpublic void delete(Transaction transaction, Resource resource)
Repositorydelete in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)protected Revision determineHeadRevision()
public InputStream download(Resource resource, Revision revision)
Repositorydownload in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrieveInputStream from which the content can be read (caller has to close the stream properly)public final InputStream download(View view, Resource resource, Revision revision)
Repositorydownload in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrieveInputStream from which the content can be read (caller has to close the stream properly)public URI downloadURI(Resource resource, Revision revision)
RepositorydownloadURI in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrieveURI for the resourcepublic final URI downloadURI(View view, Resource resource, Revision revision)
RepositorydownloadURI in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrieveURI for the resourcepublic boolean exists(Resource resource, Revision revision)
Repositoryexists in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievetrue if the resource already exists in the latest revision of the repository otherwise falsepublic final boolean exists(View view, Resource resource, Revision revision)
Repositoryexists in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievetrue if the resource already exists in the latest revision of the repository otherwise falsepublic final Resource getBasePath()
RepositoryResource to the base for this Repository.getBasePath in interface RepositoryResource to the base for this Repository.public final URI getBaseUri()
RepositoryURI to the root of this Repository.getBaseUri in interface RepositoryURI to the root of this Repositoryprotected Set<Info> getInfoSetWithLockTokens(Transaction transaction)
public final UUID getRepositoryId()
RepositoryUUID that identifies the Repository globally.getRepositoryId in interface RepositoryUUID that identifies the Repository globallypublic Info info(Resource resource, Revision revision, ResourceProperty.Key... keys)
Repositoryinfo in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievekeys - request only the specified ResourceProperty.Keys, empty for allInfo for the resource (if keys where specified, only reduced Info will be returned)public Info info(View view, Resource resource, Revision revision, ResourceProperty.Key... keys)
Repositoryinfo in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievekeys - request only the specified ResourceProperty.KeysInfo for the resource (if keys where specified, only reduced Info will be returned)public Set<Info> list(Resource resource, Revision revision, Depth depth, ResourceProperty.Key... keys)
Repositorylist in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievedepth - whether to retrieve only for the given resource, its children or only part of its children depending
on the value of Depthkeys - request only the specified ResourceProperty.KeysSet of Info for the resource and its child resources (depending on depth parameter), if
keys where specified, only reduced Info will contained in the Setpublic Set<Info> list(View view, Resource resource, Revision revision, Depth depth, ResourceProperty.Key... keys)
Repositorylist in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrievedepth - whether to retrieve only for the given resource, its children or only part of its children depending
on the value of Depthkeys - request only the specified ResourceProperty.KeysSet of Info for the resource and its child resources (depending on depth parameter), if
keys where specified, only reduced Info will contained in the Setpublic final void lock(Resource resource, boolean steal)
Repositorylock in interface Repositoryresource - the Resource of the resource (relative to the repository root)steal - if the resource is locked by another user true will override the lock, otherwise the
operation will failpublic List<Log> log(Resource resource, Revision startRevision, Revision endRevision, int limit, boolean stopOnCopy)
Repositorylog in interface Repositoryresource - the Resource of the resource (relative to the repository root)startRevision - the first Revision of the resource to retrieve (including)endRevision - the last Revision of the resource to retrieve (including)limit - maximal number of Log entries, if the value is lower or equal to 0 all entries will be returnedstopOnCopy - do not cross copies while traversing historyList of Log for the revisions between startRevision and
endRevision of the resourcepublic final List<Log> log(View view, Resource resource, Revision startRevision, Revision endRevision, int limit, boolean stopOnCopy)
Repositorylog in interface Repositoryview - the current valid Viewresource - the Resource of the resource (relative to the repository root)startRevision - the first Revision of the resource to retrieve (including)endRevision - the last Revision of the resource to retrieve (including)limit - maximal number of Log entries, if the value is lower or equal to 0 all entries will be returnedstopOnCopy - do not cross copies while traversing historyList of Log for the revisions between startRevision and
endRevision of the resourcepublic void mkdir(Transaction transaction, Resource resource, boolean parent)
Repositorymkdir in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)parent - whether to create missing parents folders or notpublic void move(Transaction transaction, Resource srcResource, Resource targetResource, boolean parents)
Repositorymove in interface Repositorytransaction - the current running TransactionsrcResource - the Resource of the source resource (relative to the repository root)targetResource - the Resource of the target resource (relative to the repository root)parents - whether to create missing parents folders or notpublic void propertiesDelete(Transaction transaction, Resource resource, ResourceProperty... properties)
RepositorypropertiesDelete in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)properties - ResourceProperty to removepublic void propertiesSet(Transaction transaction, Resource resource, ResourceProperty... properties)
RepositorypropertiesSet in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)properties - ResourceProperty to add or overrideprotected void propertiesUpdate(Transaction transaction, QualifiedResource resource, de.shadowhunt.subversion.internal.PropertiesUpdateOperation.Type type, ResourceProperty... properties)
protected abstract void registerResource(Transaction transaction, Resource resource, Revision revision)
protected QualifiedResource resolve(View view, QualifiedResource resource, Revision revision, boolean resolve)
public void rollback(Transaction transaction)
RepositoryTransaction and revert all modifications.rollback in interface Repositorytransaction - the current running Transactionpublic void rollbackIfNotCommitted(Transaction transaction)
RepositoryTransaction and revert all modifications if the transaction is not committed.rollbackIfNotCommitted in interface Repositorytransaction - the current running Transactionpublic final void unlock(Resource resource, boolean force)
Repositoryunlock in interface Repositoryresource - the Resource of the resource (relative to the repository root)force - the user that created the lock must match the user who wants to delete it, unless force is trueprotected void validateTransaction(Transaction transaction)
protected void validateView(View view)
Copyright © 2013–2017 shadowhunt. All rights reserved.