public interface ResourceDAO
| Modifier and Type | Method and Description |
|---|---|
void |
add(String path,
ResourceIDImpl parentID,
ResourceImpl resourceImpl)
Add the resource to a pat when resource instance and the parent resource id is given.
|
void |
addContent(ResourceImpl resourceImpl)
Add the content for a resource.
|
int |
addContentBytes(InputStream contentStream)
Add the content to the content table and return the auto generated id of content table.
|
void |
addProperties(ResourceImpl resource)
Add the properties to the database from given resource
|
void |
addResourceDO(ResourceDO resourceDO)
Add the resource data object.
|
void |
addResourceWithNoUpdate(ResourceImpl resourceImpl)
Add a resource without setting the resource modified flag on.
|
void |
addResourceWithoutContentId(ResourceImpl resourceImpl,
boolean isUpdatingExisting)
Add a resource without a content id, provided whether it is overwriting existing one or not.
|
void |
addRoot(ResourceImpl resourceImpl)
Add the root collection.
|
void |
createAndApplyResourceID(String path,
ResourceIDImpl parentID,
ResourceImpl resourceImpl)
The method to create a resource id and assign to resource instance
|
ResourceIDImpl |
createResourceID(String path,
ResourceIDImpl parentID,
boolean isCollection)
Create a resource ID for a path given the parent resource id and whether it is a collection
or not.
|
void |
deleteContentStream(int contentID)
delete the content for a given content id.
|
void |
deleteResource(ResourceDO resourceDO)
Delete the resource provided as a resource DO
|
void |
fillChildren(CollectionImpl collection,
DataAccessManager dataAccessManager)
Fill the children for a resource that already filled with meta data.
|
void |
fillChildren(CollectionImpl collection,
int start,
int pageLen)
Fill the children for a resource that already filled with meta data.
|
void |
fillResource(CollectionImpl collection,
int start,
int pageLen)
Fill the children and the properties for a resource that already filled with meta data.
|
void |
fillResource(ResourceImpl resourceImpl)
Fill the content (for non-collection) and the properties for a resource that already filled
meta data
|
void |
fillResourceContent(ResourceImpl resourceImpl)
Fill resource content for a given resource implementation.
|
void |
fillResourceContentWithNoUpdate(ResourceImpl resourceImpl)
Fill resource content for a given resource implementation without setting the resource
modified flag on.
|
void |
fillResourceProperties(ResourceImpl resourceImpl)
Fill the properties for a resource, this will change the properties modified flag.
|
void |
fillResourcePropertiesWithNoUpdate(ResourceImpl resourceImpl)
Fill the properties for a resource without making the properties modified flag.
|
ResourceImpl |
get(ResourceIDImpl resourceID)
Returns the resource in the given path filled with meta-data and access to the content.
|
CollectionImpl |
get(ResourceIDImpl resourceID,
int start,
int pageLen)
Return a collection with children only at the range of the intersect of the given range and
resource existence range provided the resource id.
|
ResourceImpl |
get(String path)
Returns the resource in the given path filled with meta-data and access to the content.
|
CollectionImpl |
get(String path,
int start,
int pageLen)
Return a collection with children only at the range of the intersect of the given range and
resource existence range provided the resource path.
|
int |
getChildCount(CollectionImpl collection,
DataAccessManager dataAccessManager)
Method to return a child count of a collection (database connection should also be provided)
|
List<ResourceIDImpl> |
getChildPathIds(ResourceIDImpl resourceID)
Get the child path ids of a resource, (should be a collection)
|
String[] |
getChildren(CollectionImpl collection,
int start,
int pageLen)
Get the children of the collection.
|
String[] |
getChildren(CollectionImpl collection,
int start,
int pageLen,
DataAccessManager dataAccessManager)
Get the children of the collection.
|
InputStream |
getContentStream(int contentID)
Get the content input stream for a given content id.
|
String |
getPath(int pathId,
String resourceName,
boolean checkExistence)
Get the path given the path id, resource name and provided whether the resourceExistence
should be checked.
|
String |
getPath(long version)
Get the path provided the resource version.
|
String |
getPathFromId(int pathId)
Get the path from the path id.
|
ResourceDO |
getResourceDO(long version)
Method to return resourceDO from a version number.
|
ResourceDO |
getResourceDO(ResourceIDImpl resourceID)
Method to get resource from resource id.
|
ResourceIDImpl |
getResourceID(String path)
Returns the resource ID (RID) of the resource referred by the given path.
|
ResourceIDImpl |
getResourceID(String path,
boolean isCollection)
Returns the resource ID (RID) of the resource referred by the given path.
|
ResourceImpl |
getResourceMetaData(ResourceIDImpl resourceID)
Method to return the resource meta data (excluding properties, content and children)
|
ResourceImpl |
getResourceMetaData(String path)
Method to return the resource meta data (excluding properties, content and children)
|
ResourceImpl |
getResourceWithNoUpdate(ResourceIDImpl resourceID)
Method to get resource without setting the resource modified flags on.
|
long |
getVersion(ResourceIDImpl resourceID)
Method to return the version of a resource from resourceID
|
void |
moveProperties(ResourceIDImpl source,
ResourceIDImpl target)
Move the properties.
|
void |
movePropertyPaths(ResourceIDImpl source,
ResourceIDImpl target)
this function will move the paths from one path id to another regardless of the resource
name
|
void |
moveResourcePaths(ResourceIDImpl source,
ResourceIDImpl target)
This method will move the paths from one path id to another regardless of the resource name
|
void |
moveResources(ResourceIDImpl source,
ResourceIDImpl target)
Move resource provided the source and target resource ids.
|
void |
removeProperties(ResourceDO resourceDO)
Remove properties of a resource.
|
boolean |
resourceExists(ResourceIDImpl resourceID)
Method to check the whether a resource in the provided resource id exist or not.
|
boolean |
resourceExists(String path)
Method to check the resource existence for a given path.
|
boolean |
resourceExists(String path,
boolean isCollection)
Method to check the resource existence for a given path provided the resource is collection
or not.
|
void |
update(ResourceImpl resourceImpl)
Save the updates of a given resource.
|
void |
updateCollectionLastUpdatedTime(ResourceIDImpl resourceID)
Update the last updated time of a resource, This is called to update the parent's last
updated time when a child is created, deleted or moved out/in, copy in.
|
void |
updateContentId(ResourceImpl resourceImpl)
Update the content id of a resource, Normally this should be called after calling
addResourceWithoutContentId is called.
|
ResourceIDImpl getResourceID(String path) throws RegistryException
path - Pure path of the resourceRegistryException - throws the retrieval of resource id failedResourceIDImpl getResourceID(String path, boolean isCollection) throws RegistryException
path - Pure path of the resourceisCollection - true if it is a collectionRegistryException - throws the retrieval of resource id failedboolean resourceExists(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource id which is checked for existence of a resource.RegistryException - throws if checking existence failed.boolean resourceExists(String path) throws RegistryException
path - the path to check the resource existenceRegistryException - throws if checking existence failed.boolean resourceExists(String path, boolean isCollection) throws RegistryException
path - the path to check the resource existence.isCollection - provide whether the resource in the path is collection or not.RegistryException - throws if checking existence failed.long getVersion(ResourceIDImpl resourceID) throws RegistryException
resourceID - the id of the resource to get the version of.RegistryException - throws if the version retrieval failed.ResourceImpl get(String path) throws RegistryException
path - Path of the resource.RegistryException - throws if the resource retrieval failed.ResourceImpl get(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource idRegistryException - throws if resource retrieval failed.CollectionImpl get(String path, int start, int pageLen) throws RegistryException
path - path of the collectionstart - start value of the range of children.pageLen - the length of the children to retrieveRegistryException - throws if resource retrieval failed.CollectionImpl get(ResourceIDImpl resourceID, int start, int pageLen) throws RegistryException
resourceID - resourceID of the collectionstart - start value of the range of children.pageLen - the length of the children to retrieveRegistryException - throws if resource retrieval failed.void fillResource(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource instance to be filled with contents (if non-collection) and
fill properties.RegistryException - throws if resource filling failed.void fillResource(CollectionImpl collection, int start, int pageLen) throws RegistryException
collection - collection to fill the children and properties.start - start value of the range of children.pageLen - the length of the children to retrieveRegistryException - throws if resource filling failed.void fillResourcePropertiesWithNoUpdate(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource object.RegistryException - throws if the operation failed.void fillResourceProperties(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource object.RegistryException - throws if the operation failed.void addRoot(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource instanceRegistryException - throws if the operation failedvoid add(String path, ResourceIDImpl parentID, ResourceImpl resourceImpl) throws RegistryException
path - path of the resourceparentID - parent resourceIDresourceImpl - the instance of the resource to be added.RegistryException - throws if the operation failedvoid createAndApplyResourceID(String path, ResourceIDImpl parentID, ResourceImpl resourceImpl) throws RegistryException
path - path of the resourceparentID - parent path idresourceImpl - the resource instance to be assigned the resource id.RegistryException - throws if operation failed.ResourceIDImpl createResourceID(String path, ResourceIDImpl parentID, boolean isCollection) throws RegistryException
path - the path of the resourceparentID - parent resource idisCollection - whether the resource is a collection or notRegistryException - throws if operation failed.void deleteContentStream(int contentID)
throws RegistryException
contentID - content id.RegistryException - throws if the operation failed.InputStream getContentStream(int contentID) throws RegistryException
contentID - the content id as an argument.RegistryException - throws if the operation failed.void update(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource to be updated.RegistryException - throws if the operation failed.int getChildCount(CollectionImpl collection, DataAccessManager dataAccessManager) throws RegistryException
collection - the collection object which the children are calculated.dataAccessManager - the data access manager to access the database.RegistryException - throws if the operation failed.void fillChildren(CollectionImpl collection, int start, int pageLen) throws RegistryException
collection - collection to fill the children and properties.start - start value of the range of children.pageLen - the length of the children to retrieveRegistryException - if the operation failed.void fillChildren(CollectionImpl collection, DataAccessManager dataAccessManager) throws RegistryException
collection - collection to fill the children and properties.dataAccessManager - the data access manager to access the databaseRegistryException - if the operation failed.String[] getChildren(CollectionImpl collection, int start, int pageLen, DataAccessManager dataAccessManager) throws RegistryException
collection - collection to fill the children and properties.start - start value of the range of children.pageLen - the length of the children to retrievedataAccessManager - the data access manager to access the databaseRegistryException - throws if the operation failed.String[] getChildren(CollectionImpl collection, int start, int pageLen) throws RegistryException
collection - collection to fill the children and properties.start - start value of the range of children.pageLen - the length of the children to retrieveRegistryException - throws if the operation failed.ResourceImpl getResourceMetaData(String path) throws RegistryException
path - the of the resourceRegistryException - throws if the operation failed.ResourceImpl getResourceMetaData(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource idRegistryException - throws if the operation failed.ResourceImpl getResourceWithNoUpdate(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource id.RegistryException - throws if the operation failed.void fillResourceContent(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - resource object.RegistryException - throws if the operation failed.void fillResourceContentWithNoUpdate(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - resource object.RegistryException - throws if the operation failed.void updateCollectionLastUpdatedTime(ResourceIDImpl resourceID) throws RegistryException
resourceID - the id of the resource to get the version of.RegistryException - throws if the operation failed.void updateContentId(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource object.RegistryException - throws if the operation failed.void addResourceWithoutContentId(ResourceImpl resourceImpl, boolean isUpdatingExisting) throws RegistryException
resourceImpl - the resource object.isUpdatingExisting - whether the resource is updating or not.RegistryException - throws if the operation failed.void addResourceWithNoUpdate(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource to be added.RegistryException - throws if the operation failed.void addResourceDO(ResourceDO resourceDO) throws RegistryException
resourceDO - the resource data object.RegistryException - throws if the operation failed.void deleteResource(ResourceDO resourceDO) throws RegistryException
resourceDO - the resource to be deleted.RegistryException - throws if the operation failed.void addProperties(ResourceImpl resource) throws RegistryException
resource - to add properties forRegistryException - throws if the operation failed.void removeProperties(ResourceDO resourceDO) throws RegistryException
resourceDO - the resource DO which the properties have to be deleted.RegistryException - throws if the operation failed.void addContent(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource to add content.RegistryException - throws if the operation failed.int addContentBytes(InputStream contentStream) throws RegistryException
contentStream - the input stream.RegistryException - throws if the operation failed.ResourceDO getResourceDO(long version) throws RegistryException
version - the version of the resource.RegistryException - throws if the operation failed.ResourceDO getResourceDO(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource id.RegistryException - throws if the operation failed.List<ResourceIDImpl> getChildPathIds(ResourceIDImpl resourceID) throws RegistryException
resourceID - the resource id of the collection.RegistryException - throws if the operation failed.String getPathFromId(int pathId) throws RegistryException
pathId - the path id.RegistryException - throws if operation failed.String getPath(long version) throws RegistryException
version - the version of the resource.RegistryException - throws if the operation failed.String getPath(int pathId, String resourceName, boolean checkExistence) throws RegistryException
pathId - the path idresourceName - the resource namecheckExistence - boolean to indicate whether the resource existence should be checked.RegistryException - if the operation failed.void moveResources(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the resource Id of the source.target - the resource id of the target.RegistryException - throws if the operation failed.void moveResourcePaths(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the path id of the source resource.target - the path id of the target resource.RegistryException - throws if the operation failed.void moveProperties(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the resource id of the source resource.target - the resource id of the target resource.RegistryException - throws if the operation failed.void movePropertyPaths(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the resource id of the source resource.target - the resource id of the target resource.RegistryException - throws if the operation failed.Copyright © 2016 WSO2 Inc. All Rights Reserved.