public class VersionRepository extends Object
| Constructor and Description |
|---|
VersionRepository(DataAccessManager dataAccessManager)
Constructor accepting data access manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDescendants(ResourceIDImpl resourceID,
ArrayList<Long> versionList,
boolean isRenewing,
boolean keepProperties)
Here the versions of the descendants of the resource is added to the versionList array.
|
void |
createSnapshot(Resource resource,
boolean isRenewing,
boolean keepProperties)
Method used to create a snapshot of a given resource.
|
void |
createSnapshot(ResourcePath resourcePath,
boolean isRenewing,
boolean keepProperties)
Method used to create a snapshot of a given resource.
|
Resource |
get(VersionedPath versionedPath)
Gets the pure resource referred by the given path.
|
Collection |
get(VersionedPath versionedPath,
int start,
int pageLen)
Method to get a paged collection.
|
Resource |
getMetaData(VersionedPath versionedPath)
Gets the meta data of resource referred by the given path.
|
String[] |
getVersions(String resourcePath)
Method to obtain a list of versioned paths.
|
boolean |
removeVersionHistory(String path,
long snapshotId) |
boolean |
resourceExists(VersionedPath versionedPath)
Checks if a pure resource exists in the given path.
|
void |
restoreVersion(ResourcePath resourcePath)
Method to restore a version.
|
public VersionRepository(DataAccessManager dataAccessManager)
dataAccessManager - the data access manager that is used for database communications.public void createSnapshot(Resource resource, boolean isRenewing, boolean keepProperties) throws RegistryException
resource - the resource.isRenewing - whether we are renewing.keepProperties - whether to preserve properties.RegistryException - if the operation failed.public void createSnapshot(ResourcePath resourcePath, boolean isRenewing, boolean keepProperties) throws RegistryException
resourcePath - the resource path.isRenewing - whether we are renewing.keepProperties - whether to preserve properties.RegistryException - if the operation failed.public void addDescendants(ResourceIDImpl resourceID, ArrayList<Long> versionList, boolean isRenewing, boolean keepProperties) throws RegistryException
resourceID - the resource identifierversionList - a list of versions.isRenewing - whether we are renewing.keepProperties - whether to preserve properties.RegistryException - if the operation failed.public String[] getVersions(String resourcePath) throws RegistryException
resourcePath - the resource path.RegistryException - if the operation failed.public Resource getMetaData(VersionedPath versionedPath) throws RegistryException
versionedPath - Path of a versioned resource.RegistryException - if the operation failed.public boolean resourceExists(VersionedPath versionedPath) throws RegistryException
versionedPath - Path of a versioned resource.RegistryException - if the operation failed.public Resource get(VersionedPath versionedPath) throws RegistryException
versionedPath - Path of a versioned resource.RegistryException - if the operation failed.public Collection get(VersionedPath versionedPath, int start, int pageLen) throws RegistryException
versionedPath - the collection path (which also contains the version).start - the starting index.pageLen - the page length.RegistryException - if the operation failed.public void restoreVersion(ResourcePath resourcePath) throws RegistryException
resourcePath - the resource path (which also contains the version).RegistryException - if the operation failed.public boolean removeVersionHistory(String path, long snapshotId) throws RegistryException
RegistryExceptionCopyright © 2016 WSO2 Inc. All Rights Reserved.