|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.registry.jdbc.dao.VersionedResourceDAO
public class VersionedResourceDAO
Constructor Summary | |
---|---|
VersionedResourceDAO()
|
Method Summary | |
---|---|
void |
add(Resource resource,
java.sql.Connection conn)
Adds the given resource to the database. |
void |
addProperties(long resourceID,
java.util.Properties props,
java.sql.Connection conn)
|
long |
addResourceVersion(Resource resource,
java.sql.Connection connection)
|
static byte[] |
convertToBytes(java.lang.Object object)
|
void |
deleteResource(Resource resource,
java.sql.Connection connection)
To delete a resource , what actually happen here is that update the version table with the new data and resource will not actually removed from the table |
Resource |
get(java.lang.String path,
long versionNumber,
java.sql.Connection conn)
Returns the given version of the artifact. |
java.lang.String[] |
getChildPaths(long artifcatID,
long versionNumber,
java.sql.Connection connection)
|
java.util.List |
getChildren(long resourceID,
long versionNumber,
java.sql.Connection connection)
|
java.lang.String[] |
getLatestChildPaths(long resourceID,
long versionNumber,
java.sql.Connection connection)
|
Resource |
getLatestVersion(java.lang.String path,
java.sql.Connection conn)
Returns the latest (current) version of an artifact. |
long |
getLatestVersionNumber(long resourceId,
java.sql.Connection connection)
|
java.lang.String |
getParentPath(long resourceID,
long versionNumber,
java.sql.Connection connection)
|
Resource |
getResourceByID(long artifactID,
long versionNumber,
java.sql.Connection conn)
|
long |
getResourceID(java.lang.String path,
java.sql.Connection conn)
|
java.lang.String |
getResourcePath(long id,
java.sql.Connection conn)
|
java.lang.String[] |
getVersionNumbers(long resourceId,
java.sql.Connection connection)
|
boolean |
isResourceActive(java.lang.String resourcePath,
java.sql.Connection connection)
This method is use to see whether a give resource is active or not , one can delete a resource and try to access that giving the path of the resource in that case we should not return the resource if it is deleted. |
void |
markActivated(long id,
java.sql.Connection conn)
|
void |
markDeleted(java.lang.String path,
java.sql.Connection conn)
|
void |
removeProperties(long resourceID,
java.sql.Connection conn)
|
void |
renameResource(java.lang.String oldPath,
java.lang.String newPath,
java.sql.Connection conn,
java.lang.String userId,
org.wso2.usermanager.Realm realm)
This method will move a resource from oldpath to newpath , the internal implementation is such that frit the release will be deleted from oldPath parent and will be added to the newptah so if the oldpath is "foo/bar/r1" then the r1 will be removed from foo/bar. |
boolean |
resourceActive(java.lang.String path,
java.sql.Connection conn)
|
boolean |
resourceExist(java.lang.String path,
java.sql.Connection conn)
|
void |
restore(long resourceId,
long toVersion,
java.sql.Connection connection)
|
void |
update(java.lang.String path,
Resource resource,
java.sql.Connection conn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VersionedResourceDAO()
Method Detail |
---|
public Resource get(java.lang.String path, long versionNumber, java.sql.Connection conn) throws java.sql.SQLException
path
- : path of the artifactversionNumber
- : Version numberconn
- : Connection to DB
java.sql.SQLException
- : If something went wrongpublic Resource getResourceByID(long artifactID, long versionNumber, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public Resource getLatestVersion(java.lang.String path, java.sql.Connection conn) throws RegistryException, java.sql.SQLException
path
- : path of the artifactconn
- :Connection to DB
java.sql.SQLException
- : if something went wrong
RegistryException
public java.lang.String[] getChildPaths(long artifcatID, long versionNumber, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getParentPath(long resourceID, long versionNumber, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String[] getLatestChildPaths(long resourceID, long versionNumber, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public java.util.List getChildren(long resourceID, long versionNumber, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public void add(Resource resource, java.sql.Connection conn) throws java.sql.SQLException
resource
- New resourceconn
- : Connection to Db
java.sql.SQLException
- : if something went wrongpublic void update(java.lang.String path, Resource resource, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void markDeleted(java.lang.String path, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void markActivated(long id, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void addProperties(long resourceID, java.util.Properties props, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void removeProperties(long resourceID, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public boolean resourceExist(java.lang.String path, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public boolean resourceActive(java.lang.String path, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public long getResourceID(java.lang.String path, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getResourcePath(long id, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void renameResource(java.lang.String oldPath, java.lang.String newPath, java.sql.Connection conn, java.lang.String userId, org.wso2.usermanager.Realm realm) throws java.sql.SQLException, RegistryException
oldPath
- : Current path of the resourcenewPath
- : Where to move the resourceconn
- : Connection to DBuserId
- : current userrealm
- : Realm
RegistryException
- : If something went wrong
java.sql.SQLException
public long addResourceVersion(Resource resource, java.sql.Connection connection) throws java.sql.SQLException, RegistryException
java.sql.SQLException
RegistryException
public static byte[] convertToBytes(java.lang.Object object)
public long getLatestVersionNumber(long resourceId, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String[] getVersionNumbers(long resourceId, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public void restore(long resourceId, long toVersion, java.sql.Connection connection) throws java.sql.SQLException, RegistryException
java.sql.SQLException
RegistryException
public void deleteResource(Resource resource, java.sql.Connection connection) throws java.sql.SQLException, RegistryException
resource
- : Resource to be deletedconnection
- : Connection to the DB
java.sql.SQLException
- : if something went wrong
RegistryException
public boolean isResourceActive(java.lang.String resourcePath, java.sql.Connection connection)
resourcePath
- : Path of the resourceconnection
- : Connection to DB
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |