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 org.apache.http.client.HttpClient |
client |
protected AbstractBaseRepository.ResourceMapper |
config |
protected org.apache.http.protocol.HttpContext |
context |
protected URI |
repository |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBaseRepository(URI repository,
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
|
void |
delete(Transaction transaction,
Resource resource)
Delete the resource from the repository
|
InputStream |
download(Resource resource,
Revision revision)
Download the resource
|
URI |
downloadURI(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
|
protected static RepositoryCache |
fromTransaction(Transaction transaction) |
URI |
getBaseUri()
Returns the
URI to the root of this Repository |
protected Set<Info> |
getInfosWithLockTokens(Transaction transaction) |
UUID |
getRepositoryId()
Returns the
UUID that identifies the Repository globally |
protected de.shadowhunt.subversion.internal.VersionParser |
getVersionParser() |
Info |
info(Resource resource,
Revision revision)
Retrieve information for the resource
|
Set<Info> |
list(Resource resource,
Revision revision,
Depth depth)
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)
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 abstract void |
registerResource(Transaction transaction,
Resource resource,
Revision revision) |
void |
rollback(Transaction transaction)
Abort the current running
Transaction and revert all modifications |
void |
unlock(Resource resource,
boolean force)
Remove the lock on the expected revision of the resource
|
protected void |
validateTransaction(Transaction transaction) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommit, createTransaction, getProtocolVersionprotected 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 AbstractBaseRepository(URI repository, AbstractBaseRepository.ResourceMapper config, org.apache.http.client.HttpClient client, org.apache.http.protocol.HttpContext context)
protected static RepositoryCache fromTransaction(Transaction transaction)
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 void delete(Transaction transaction, Resource resource)
Repositorydelete in interface Repositorytransaction - the current running Transactionresource - the Resource of the resource (relative to the repository root)public final 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 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 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 URI getBaseUri()
RepositoryURI to the root of this RepositorygetBaseUri in interface RepositoryURI to the root of this Repositoryprotected Set<Info> getInfosWithLockTokens(Transaction transaction)
public final UUID getRepositoryId()
RepositoryUUID that identifies the Repository globallygetRepositoryId in interface RepositoryUUID that identifies the Repository globallyprotected de.shadowhunt.subversion.internal.VersionParser getVersionParser()
public final Info info(Resource resource, Revision revision)
Repositoryinfo in interface Repositoryresource - the Resource of the resource (relative to the repository root)revision - the Revision of the resource to retrieveInfo for the resourcepublic final Set<Info> list(Resource resource, Revision revision, Depth depth)
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 DepthSet of Info for the resource and its child resources (depending on depth parameter)public 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 final List<Log> log(Resource resource, Revision startRevision, Revision endRevision, int limit)
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 returnedList 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 abstract void registerResource(Transaction transaction, Resource resource, Revision revision)
public void rollback(Transaction transaction)
RepositoryTransaction and revert all modificationsrollback 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)
Copyright © 2013–2014 shadowhunt. All rights reserved.