org.wso2.carbon.registry.core.jdbc.dao
Class JDBCPathCache

java.lang.Object
  extended by org.wso2.carbon.registry.core.caching.PathCache
      extended by org.wso2.carbon.registry.core.jdbc.dao.JDBCPathCache

public class JDBCPathCache
extends PathCache

An extension of the PathCache to store paths of registry resources on a JDBC-based database.


Field Summary
 
Fields inherited from class org.wso2.carbon.registry.core.caching.PathCache
pathCache
 
Constructor Summary
JDBCPathCache()
           
 
Method Summary
 int addEntry(String path, int parentPathId)
          Method to add resource path entry to the database.
 String getPath(Connection conn, int id)
          Method to get the path of a given path id.
static JDBCPathCache getPathCache()
           
 int getPathID(Connection conn, String path)
          Method to get the path id of a given path.
 
Methods inherited from class org.wso2.carbon.registry.core.caching.PathCache
hitRate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCPathCache

public JDBCPathCache()
Method Detail

getPathCache

public static JDBCPathCache getPathCache()

addEntry

public int addEntry(String path,
                    int parentPathId)
             throws SQLException,
                    RegistryException
Method to add resource path entry to the database.

Parameters:
path - the path to add.
parentPathId - the parent path's id.
Returns:
the path's id.
Throws:
RegistryException - if the data access manager was invalid.
SQLException - if an error occurs while adding the entry.

getPath

public String getPath(Connection conn,
                      int id)
               throws SQLException
Method to get the path of a given path id.

Parameters:
conn - the database connection to use.
id - the path.
Returns:
the path corresponding to the given path id.
Throws:
SQLException - if an error occurs while obtaining the path id.

getPathID

public int getPathID(Connection conn,
                     String path)
              throws SQLException
Method to get the path id of a given path.

Parameters:
conn - the database connection to use.
path - the path.
Returns:
the path id corresponding to the given path.
Throws:
SQLException - if an error occurs while obtaining the path id.


Copyright © 2012 WSO2 Inc. All Rights Reserved.