org.wso2.registry.versions
Class VersionHandler

java.lang.Object
  extended by org.wso2.registry.versions.VersionHandler

public class VersionHandler
extends java.lang.Object

This class is to handle all the version related stuff , putting into the dependecy tables , updating the tables and ect..


Constructor Summary
VersionHandler()
           
 
Method Summary
static void addResourceToVersionTable(java.sql.Connection connection, Artifact artifact)
          To add a new resource or to update a new resource we can use this.
static void deleteResource(Artifact artifact, java.sql.Connection connection)
          To delete a artifact , what actualy happen here is that update the version table with the new data and artifact will not actualy removed from the table
static java.lang.String[] getChildrenPath(long artifcatID, java.sql.Connection connection)
          To get the depndents path for a given artifact
static java.lang.String[] getChildrenPath(long artifcatID, long versionNumber, java.sql.Connection connection)
           
static java.lang.String[] getLatestChildrenPath(long artifcatID, long versionNumber, java.sql.Connection connection)
           
static long getLatestVerison(long artifactId, java.sql.Connection connection)
          To get the version latest version number for a given artifact
static java.lang.String getParentPath(long artifcatID, long versionNumber, java.sql.Connection connection)
           
static java.lang.String[] getVersions(long artifactId, java.sql.Connection connection)
           
static void revert(long artifactId, long toVersion, java.sql.Connection connection)
          To restoreVersion or rollback artifcat to a given version number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionHandler

public VersionHandler()
Method Detail

addResourceToVersionTable

public static void addResourceToVersionTable(java.sql.Connection connection,
                                             Artifact artifact)
                                      throws java.sql.SQLException
To add a new resource or to update a new resource we can use this.

Parameters:
connection - : Connection to DB
artifact - : Artifcat need to put
Throws:
java.sql.SQLException - : If something went wrong

deleteResource

public static void deleteResource(Artifact artifact,
                                  java.sql.Connection connection)
                           throws java.sql.SQLException
To delete a artifact , what actualy happen here is that update the version table with the new data and artifact will not actualy removed from the table

Parameters:
artifact - : Artifact to be deleted
connection - : Connection to the DB
Throws:
java.sql.SQLException - : if something went wrong

getLatestVerison

public static long getLatestVerison(long artifactId,
                                    java.sql.Connection connection)
                             throws java.sql.SQLException
To get the version latest version number for a given artifact

Parameters:
artifactId - : Artifact ID
connection - : DB connection
Returns:
: will retuen the version number , it could be either -1 or valid version number
Throws:
java.sql.SQLException - : If something went wrong

getVersions

public static java.lang.String[] getVersions(long artifactId,
                                             java.sql.Connection connection)
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getChildrenPath

public static java.lang.String[] getChildrenPath(long artifcatID,
                                                 java.sql.Connection connection)
                                          throws java.sql.SQLException
To get the depndents path for a given artifact

Parameters:
artifcatID - : ID
connection - : Connection to DB
Returns:
: List of paths
Throws:
java.sql.SQLException - : If something went wrong

getChildrenPath

public static java.lang.String[] getChildrenPath(long artifcatID,
                                                 long versionNumber,
                                                 java.sql.Connection connection)
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getParentPath

public static java.lang.String getParentPath(long artifcatID,
                                             long versionNumber,
                                             java.sql.Connection connection)
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getLatestChildrenPath

public static java.lang.String[] getLatestChildrenPath(long artifcatID,
                                                       long versionNumber,
                                                       java.sql.Connection connection)
                                                throws java.sql.SQLException
Throws:
java.sql.SQLException

revert

public static void revert(long artifactId,
                          long toVersion,
                          java.sql.Connection connection)
                   throws java.sql.SQLException
To restoreVersion or rollback artifcat to a given version number

Parameters:
artifactId - : Artifact ID
connection - : Connection to DB
toVersion - : to which version we need to restoreVersion
Throws:
java.sql.SQLException - : If something went wrong


Copyright © 2007 Apache Web Services Project. All Rights Reserved.