|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO
public class JDBCResourceVersionDAO
An implementation of the ResourceVersionDAO
to store resources on a JDBC-based database
with versioning enabled.
Constructor Summary | |
---|---|
JDBCResourceVersionDAO(DAOManager daoManager)
Default constructor |
Method Summary | |
---|---|
long |
createSnapshot(int pathId,
String name,
InputStream versionsStream)
Creates a new snapshot of the resource. |
void |
fillChildren(CollectionImpl collectionImpl,
VersionRetriever versionRetriever,
int parentVersionIndex,
int start,
int pageLen,
long snapshotID)
Fill the children for a resource that already filled with meta data. |
void |
fillResourceContentArchived(ResourceImpl resourceImpl)
Fill the archived content to the resource object. |
ResourceImpl |
get(ResourceIDImpl resourceID,
long snapshotID)
Returns the resource in the given path filled with meta-data and access to the content. |
CollectionImpl |
get(ResourceIDImpl resourceID,
long snapshotID,
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(String resourceID,
long versionNumber,
Connection conn)
Method to return a child count of a collection (database connection should also be provided) |
String[] |
getChildPaths(ResourceIDImpl resourceID,
VersionRetriever versionRetriever,
int parentVersionIndex,
int start,
int pageLen,
long snapshotID,
Connection conn)
Get the child paths of a resource, (should be a collection) |
String[] |
getChildPaths(ResourceIDImpl resourceID,
VersionRetriever versionRetriever,
int parentVersionIndex,
int start,
int pageLen,
long snapshotID,
DataAccessManager dataAccessManager)
Get the child paths of a resource, (should be a collection) |
Long[] |
getSnapshotIDs(String resourcePath)
Get the identifiers of the snapshots created for a given path. |
VersionRetriever |
getVersionList(long snapshotID)
Creates version retriever that can be used to get the list of versions of a given snapshot, which includes the versions of the children. |
VersionRetriever |
getVersionList(ResourceIDImpl resourceID,
long snapshotID)
Creates version retriever that can be used to get the list of versions of a given snapshot, which includes the versions of the children if this was a collection. |
boolean |
isContentHistoryExist(int contentId)
Check whether the content is already in the history. |
boolean |
isResourceHistoryExist(long version)
Check whether the resource is already in the history with the give version |
boolean |
isResourceHistoryExist(ResourceIDImpl resourceID)
Check whether the resource is already in the history with the give resourceID |
boolean |
isResourceHistoryExist(String path)
Check whether the resource is already in the history with the give path |
void |
putResourceToHistory(ResourceDO resourceDO)
Method to Archive Resource. |
void |
removePropertyValues(long regVersionId)
Removes any properties associated with a given version of a resource. |
void |
removeSnapshot(long snapshotId)
Removes a snapshot of a given resource. |
boolean |
resourceExists(ResourceIDImpl resourceID,
long snapshotID)
Method to check the resource existence for a given path. |
String |
restoreResources(long version,
long snapshotID)
Restore the resource to the given version. |
void |
versionResource(ResourceDO resourceDO,
boolean keepProperties)
Create a version of the given resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCResourceVersionDAO(DAOManager daoManager)
daoManager
- instance of the data access object manager.Method Detail |
---|
public Long[] getSnapshotIDs(String resourcePath) throws RegistryException
ResourceVersionDAO
getSnapshotIDs
in interface ResourceVersionDAO
resourcePath
- the resource path
RegistryException
- if an error occurs.public void fillResourceContentArchived(ResourceImpl resourceImpl) throws RegistryException
ResourceVersionDAO
fillResourceContentArchived
in interface ResourceVersionDAO
resourceImpl
- the resource object.
RegistryException
- if an error occurs.public ResourceImpl get(ResourceIDImpl resourceID, long snapshotID) throws RegistryException
ResourceVersionDAO
get
in interface ResourceVersionDAO
resourceID
- the resource idsnapshotID
- the snapshot id
RegistryException
- throws if resource retrieval failed.public boolean resourceExists(ResourceIDImpl resourceID, long snapshotID) throws RegistryException
ResourceVersionDAO
resourceExists
in interface ResourceVersionDAO
resourceID
- the resource idsnapshotID
- the snapshot id
RegistryException
- throws if checking existence failed.public VersionRetriever getVersionList(ResourceIDImpl resourceID, long snapshotID) throws RegistryException
ResourceVersionDAO
getVersionList
in interface ResourceVersionDAO
resourceID
- the resource idsnapshotID
- the snapshot id
RegistryException
- if the operation failed.VersionRetriever
public VersionRetriever getVersionList(long snapshotID) throws RegistryException
ResourceVersionDAO
getVersionList
in interface ResourceVersionDAO
snapshotID
- the snapshot id
RegistryException
- if the operation failed.VersionRetriever
public CollectionImpl get(ResourceIDImpl resourceID, long snapshotID, int start, int pageLen) throws RegistryException
ResourceVersionDAO
get
in interface ResourceVersionDAO
resourceID
- resource id of the collection.snapshotID
- snapshot id of the collection.start
- start value of the range of children.pageLen
- the length of the children to retrieve
RegistryException
- throws if resource retrieval failed.public void fillChildren(CollectionImpl collectionImpl, VersionRetriever versionRetriever, int parentVersionIndex, int start, int pageLen, long snapshotID) throws RegistryException
ResourceVersionDAO
fillChildren
in interface ResourceVersionDAO
collectionImpl
- collection to fill the children and properties.versionRetriever
- the version retriever used to get the versions.parentVersionIndex
- the version index of the parent.start
- start value of the range of children.pageLen
- the length of the children to retrieve.snapshotID
- the snapshot id.
RegistryException
- if the operation failed.public int getChildCount(String resourceID, long versionNumber, Connection conn) throws RegistryException
resourceID
- the resource id of the collection object which the children are
calculated.versionNumber
- the version number.conn
- the database connection.
RegistryException
- throws if the operation failed.public String[] getChildPaths(ResourceIDImpl resourceID, VersionRetriever versionRetriever, int parentVersionIndex, int start, int pageLen, long snapshotID, DataAccessManager dataAccessManager) throws RegistryException
ResourceVersionDAO
getChildPaths
in interface ResourceVersionDAO
resourceID
- the resource id of the collection.versionRetriever
- the version retriever to be used.parentVersionIndex
- the version index of the parent.start
- start value of the range of children.pageLen
- the length of the children to retrieve.snapshotID
- the snapshot id.dataAccessManager
- the data access manager to access the database.
RegistryException
- throws if the operation failed.public String[] getChildPaths(ResourceIDImpl resourceID, VersionRetriever versionRetriever, int parentVersionIndex, int start, int pageLen, long snapshotID, Connection conn) throws RegistryException
resourceID
- the resource id of the collection.versionRetriever
- the version retriever to be used.snapshotID
- the snapshot id.start
- start value of the range of children.pageLen
- the length of the children to retrieve.parentVersionIndex
- the version index of the parent.conn
- the database connection.
RegistryException
- throws if the operation failed.public long createSnapshot(int pathId, String name, InputStream versionsStream) throws RegistryException
ResourceVersionDAO
createSnapshot
in interface ResourceVersionDAO
pathId
- the path identifiername
- the name of the resourceversionsStream
- the input stream of versions
RegistryException
- if the operation failed.public boolean isResourceHistoryExist(long version) throws RegistryException
ResourceVersionDAO
isResourceHistoryExist
in interface ResourceVersionDAO
version
- the version
RegistryException
- if the operation failed.public boolean isResourceHistoryExist(String path) throws RegistryException
ResourceVersionDAO
isResourceHistoryExist
in interface ResourceVersionDAO
path
- the resource path
RegistryException
- if the operation failed.public boolean isResourceHistoryExist(ResourceIDImpl resourceID) throws RegistryException
ResourceVersionDAO
isResourceHistoryExist
in interface ResourceVersionDAO
resourceID
- the resource identifier.
RegistryException
- if the operation failed.public boolean isContentHistoryExist(int contentId) throws RegistryException
ResourceVersionDAO
isContentHistoryExist
in interface ResourceVersionDAO
contentId
- the content identifier.
RegistryException
- if the operation failed.public String restoreResources(long version, long snapshotID) throws RegistryException
ResourceVersionDAO
restoreResources
in interface ResourceVersionDAO
version
- the version.snapshotID
- the snapshot id
RegistryException
- if the operation failed.public void versionResource(ResourceDO resourceDO, boolean keepProperties) throws RegistryException
ResourceVersionDAO
versionResource
in interface ResourceVersionDAO
resourceDO
- the resource data object.keepProperties
- whether to keep properties or not.
RegistryException
- if the operation failed.ResourceVersionDAO.putResourceToHistory(org.wso2.carbon.registry.core.jdbc.dataobjects.ResourceDO)
public void putResourceToHistory(ResourceDO resourceDO) throws RegistryException
ResourceVersionDAO
putResourceToHistory
in interface ResourceVersionDAO
resourceDO
- the resource data object.
RegistryException
- if the operation failed.public void removeSnapshot(long snapshotId) throws RegistryException
ResourceVersionDAO
removeSnapshot
in interface ResourceVersionDAO
snapshotId
- id of the snapshot to be removed.
RegistryException
- if the operation failed.public void removePropertyValues(long regVersionId) throws RegistryException
ResourceVersionDAO
removePropertyValues
in interface ResourceVersionDAO
regVersionId
- version id of the resource.
RegistryException
- if the operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |