|
||||||||||
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(javax.sql.DataSource dataSource)
|
Method Summary | |
---|---|
void |
add(ResourceImpl resource,
java.sql.Connection conn)
Adds the given resource to the database. |
void |
addAssociation(long sourceID,
long associationID,
java.lang.String associationType,
java.sql.Connection con)
|
void |
addProperties(long resourceID,
java.util.Properties props,
java.sql.Connection conn)
|
long |
addResourceVersion(ResourceImpl resource,
java.sql.Connection connection)
|
static byte[] |
convertToBytes(java.lang.Object object)
|
void |
deleteResource(ResourceImpl 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 |
ResourceImpl |
get(java.lang.String path,
long versionNumber,
java.sql.Connection conn)
Returns the given version of the artifact. |
Association[] |
getAllAssociations(java.lang.String resourcePath,
java.sql.Connection con)
|
Association[] |
getAllAssociationsForType(java.lang.String resourcePath,
java.lang.String associationType,
java.sql.Connection con)
|
java.lang.String[] |
getChildPaths(long artifcatID,
long versionNumber,
java.sql.Connection connection)
|
java.util.List |
getChildren(long resourceID,
long versionNumber,
java.sql.Connection connection)
|
long |
getCurrentVersionNumber(java.lang.String path,
java.sql.Connection conn)
To get the current version for a give resource , current version may not be the latest version in all the cases. |
java.lang.String[] |
getLatestChildPaths(long resourceID,
long versionNumber,
java.sql.Connection connection)
|
ResourceImpl |
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)
|
ResourceImpl |
getResourceByID(long artifactID,
long versionNumber,
java.sql.Connection conn)
|
java.io.InputStream |
getResourceContentStream(long resourceID,
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,
UserRealm realm,
Registry registry)
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. |
void |
renameWithoutDelete(java.lang.String oldPath,
java.lang.String newPath,
java.lang.String userId,
UserRealm realm,
Registry registry)
This method will copy a resource from oldpath to newpath , the internal implementation is such that copy all the resources from oldpath to new path including tags , comments and ratings. |
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,
ResourceImpl 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(javax.sql.DataSource dataSource)
Method Detail |
---|
public ResourceImpl get(java.lang.String path, long versionNumber, java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException
path
- : path of the artifactversionNumber
- : Version numberconn
- : Connection to DB
java.sql.SQLException
- : If something went wrong
java.io.IOException
public void addAssociation(long sourceID, long associationID, java.lang.String associationType, java.sql.Connection con) throws java.sql.SQLException
java.sql.SQLException
public Association[] getAllAssociations(java.lang.String resourcePath, java.sql.Connection con) throws java.sql.SQLException
java.sql.SQLException
public Association[] getAllAssociationsForType(java.lang.String resourcePath, java.lang.String associationType, java.sql.Connection con) throws java.sql.SQLException
java.sql.SQLException
public ResourceImpl getResourceByID(long artifactID, long versionNumber, java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.io.InputStream getResourceContentStream(long resourceID, long versionNumber, java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public ResourceImpl getLatestVersion(java.lang.String path, java.sql.Connection conn) throws RegistryException, java.sql.SQLException, java.io.IOException
path
- : path of the artifactconn
- :Connection to DB
java.sql.SQLException
- : if something went wrong
RegistryException
java.io.IOException
public long getCurrentVersionNumber(java.lang.String path, java.sql.Connection conn) throws RegistryException
path
- : Resource IDconn
- : Connection to DB
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(ResourceImpl resource, java.sql.Connection conn) throws java.sql.SQLException, RegistryException
resource
- New resourceconn
- : Connection to Db
java.sql.SQLException
- : if something went wrong
RegistryException
public void update(java.lang.String path, ResourceImpl resource, java.sql.Connection conn) throws java.sql.SQLException, RegistryException
java.sql.SQLException
RegistryException
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 renameWithoutDelete(java.lang.String oldPath, java.lang.String newPath, java.lang.String userId, UserRealm realm, Registry registry) throws java.sql.SQLException, RegistryException, java.io.IOException
oldPath
- : Current path of the resourcenewPath
- : Where to move the resourceuserId
- : current userrealm
- : Realm
RegistryException
- : If something went wrong
java.sql.SQLException
java.io.IOException
public void renameResource(java.lang.String oldPath, java.lang.String newPath, java.sql.Connection conn, java.lang.String userId, UserRealm realm, Registry registry) throws java.sql.SQLException, java.io.IOException, 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
java.io.IOException
public long addResourceVersion(ResourceImpl resource, java.sql.Connection connection) throws java.sql.SQLException, java.io.IOException, RegistryException
java.sql.SQLException
java.io.IOException
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, java.io.IOException, RegistryException
java.sql.SQLException
java.io.IOException
RegistryException
public void deleteResource(ResourceImpl resource, java.sql.Connection connection) throws java.sql.SQLException, java.io.IOException, RegistryException
resource
- : Resource to be deletedconnection
- : Connection to the DB
java.sql.SQLException
- : if something went wrong
java.io.IOException
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 |