|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.Repository
public class Repository
Encapsulates the retrieving, storing, modifying and deleting of resources. This class only deals with the current versions of resources and it is unaware of any versioning or snapshot activity. Only the current version related tables are accessed and updated from the methods of this class.
Constructor Summary | |
---|---|
Repository(DataAccessManager dataAccessManager,
VersionRepository versionRepository,
boolean versionOnChange,
RecursionRepository recursionRepository)
Constructs a Repository |
Method Summary | |
---|---|
String |
copy(ResourcePath sourceResourcePath,
ResourcePath targetResourcePath)
Method to copy a resource from source to target. |
void |
delete(String path)
Deletes the pure resource referred by the path. |
void |
deleteNode(ResourceIDImpl resourceID,
ResourceDO resourceDO,
boolean keepAuthorization)
Method to delete just the node in the collection hierarchy. |
void |
deleteSubTree(ResourceIDImpl resourceID,
ResourceDO resourceDO,
boolean keepAuthorization)
Method to delete a sub tree of the collection hierarchy. |
void |
dump(String path,
Writer writer)
Method to do a dump. |
Resource |
get(String path)
Gets the pure resource referred by the given path. |
Collection |
get(String path,
int start,
int pageLen)
Method to get a paged collection. |
Resource |
getMetaData(String path)
Gets the meta data of resource referred by the given path. |
String |
importResource(String path,
String sourceURL,
Resource metaResource)
Creates a resource with the content imported from the source URL and meta data extracted from the given meta data resource instance. |
String |
move(ResourcePath oldResourcePath,
String newPath)
Moves the resource at oldPath to the newPath. |
String |
moveRecursively(ResourceIDImpl sourceID,
String targetPath,
ResourceIDImpl targetParentResourceID)
Method to do a recursive move. |
void |
prepareDumpRestore(String path)
This will delete only the current resource, keeps the authorizations. |
void |
prepareVersionRestore(String path)
This will delete the entire resource, except it keeps the authorizations. |
void |
put(String path,
Resource resource)
Adds or updates the resource in the given path with the given resource. |
String |
rename(ResourcePath oldResourcePath,
String newName)
Renames the resource at oldPath with the given newName. |
boolean |
resourceExists(String path)
Checks if a pure resource exists in the given path. |
void |
restore(String path,
Reader reader)
Method to restore a dump. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Repository(DataAccessManager dataAccessManager, VersionRepository versionRepository, boolean versionOnChange, RecursionRepository recursionRepository)
dataAccessManager
- the data access manager that is used for database communication.versionRepository
- the version repository.versionOnChange
- whether versioning needs to be done on change.recursionRepository
- the recursion repository for recursive operations.Method Detail |
---|
public boolean resourceExists(String path) throws RegistryException
path
- Path of a possible pure resource.
RegistryException
- if the operation failed.public Resource getMetaData(String path) throws RegistryException
path
- Path of a "pure" resource. Path should map to an actual resource stored in the
database. Paths referring to virtual resource are not handled (e.g.
/c1/r1;comments).
RegistryException
- if the operation failed.public Resource get(String path) throws RegistryException
path
- Path of a "pure" resource. Path should map to an actual resource stored in the
database. Paths referring to virtual resource are not handled (e.g.
/c1/r1;comments).
RegistryException
- if the operation failed.public Collection get(String path, int start, int pageLen) throws RegistryException
path
- the collection path.start
- the starting index.pageLen
- the page length.
RegistryException
- if the operation failed.public void put(String path, Resource resource) throws RegistryException
path
- Path of the resource to be added or updated. Path should only refer to
current version a pure resource. i.e. Path should not contain any version
information as it is impossible to add or update old versions.resource
- Resource to be added or updated.
RegistryException
- if the operation failed.public String importResource(String path, String sourceURL, Resource metaResource) throws RegistryException
path
- Path to put the resourcesourceURL
- URL to import resource contentmetaResource
- Meta data for the new resource is extracted from this meta data resource
RegistryException
- for all exceptional scenariospublic void delete(String path) throws RegistryException
path
- path Path of the resource deleted. Path should only refer to current version a
pure resource. i.e. Path should not contain any version information as it is
impossible to delete old versions.
RegistryException
- if the operation failed.public void prepareVersionRestore(String path) throws RegistryException
path
- the path to be restored.
RegistryException
- if the operation failed.public void prepareDumpRestore(String path) throws RegistryException
path
- the path to be prepared to restore.
RegistryException
- if the operation failed.public void deleteSubTree(ResourceIDImpl resourceID, ResourceDO resourceDO, boolean keepAuthorization) throws RegistryException
resourceID
- the resource identifier.resourceDO
- the resource data object.keepAuthorization
- whether to keep authorizations.
RegistryException
- if the operation failed.public void deleteNode(ResourceIDImpl resourceID, ResourceDO resourceDO, boolean keepAuthorization) throws RegistryException
resourceID
- the resource identifier.resourceDO
- the resource data object.keepAuthorization
- whether to keep authorizations.
RegistryException
- if the operation failed.public String rename(ResourcePath oldResourcePath, String newName) throws RegistryException
oldResourcePath
- Path of the resource to be renamed.newName
- New name for the resource. Name should not contain "/".
RegistryException
- if the operation failed.public String move(ResourcePath oldResourcePath, String newPath) throws RegistryException
oldResourcePath
- Path of a existing resourcenewPath
- New path of the resource
RegistryException
- if the operation failed.public String moveRecursively(ResourceIDImpl sourceID, String targetPath, ResourceIDImpl targetParentResourceID) throws RegistryException
sourceID
- the source resource's identifier.targetPath
- the target resource path.targetParentResourceID
- the target resource's parent's identifier.
RegistryException
- if the operation failed.public String copy(ResourcePath sourceResourcePath, ResourcePath targetResourcePath) throws RegistryException
sourceResourcePath
- the source path.targetResourcePath
- the target path.
RegistryException
- if the operation failed.public void restore(String path, Reader reader) throws RegistryException
path
- the path to restore from a dump.reader
- the reader used.
RegistryException
- if the operation failed.public void dump(String path, Writer writer) throws RegistryException
path
- the path to obtain the dump from.writer
- the writer used.
RegistryException
- if the operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |