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

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.dao.JDBCAssociationDAO
All Implemented Interfaces:
AssociationDAO

public class JDBCAssociationDAO
extends Object
implements AssociationDAO

An implementation of the AssociationDAO to store associations on a JDBC-based database.


Constructor Summary
JDBCAssociationDAO()
           
 
Method Summary
 void addAssociation(String sourcePath, String targetPath, String associationType)
          Method to persist an association.
 void copyAssociations(String fromPath, String toPath)
          Method to copy associations for a given path to a new path.
 Association[] getAllAssociations(String resourcePath)
          Method to get all association.
 Association[] getAllAssociationsForType(String resourcePath, String associationType)
          Method to get all association of a given type.
 void removeAllAssociations(String resourcePath)
          Method to remove all associations for a given path.
 void removeAssociation(String sourcePath, String targetPath, String associationType)
          Method to remove an association.
 void replaceAssociations(String oldPath, String newPath)
          Method to replace all associations, when moving or renaming a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCAssociationDAO

public JDBCAssociationDAO()
Method Detail

addAssociation

public void addAssociation(String sourcePath,
                           String targetPath,
                           String associationType)
                    throws RegistryException
Description copied from interface: AssociationDAO
Method to persist an association.

Specified by:
addAssociation in interface AssociationDAO
Parameters:
sourcePath - the source path
targetPath - the target path
associationType - the type of the association
Throws:
RegistryException - if some error occurs while adding associations

removeAssociation

public void removeAssociation(String sourcePath,
                              String targetPath,
                              String associationType)
                       throws RegistryException
Description copied from interface: AssociationDAO
Method to remove an association.

Specified by:
removeAssociation in interface AssociationDAO
Parameters:
sourcePath - the source path
targetPath - the target path
associationType - the type of the association
Throws:
RegistryException - if some error occurs while removing associations

getAllAssociations

public Association[] getAllAssociations(String resourcePath)
                                 throws RegistryException
Description copied from interface: AssociationDAO
Method to get all association.

Specified by:
getAllAssociations in interface AssociationDAO
Parameters:
resourcePath - the source path
Returns:
the array of all associations
Throws:
RegistryException - if some error occurs while getting all associations

getAllAssociationsForType

public Association[] getAllAssociationsForType(String resourcePath,
                                               String associationType)
                                        throws RegistryException
Description copied from interface: AssociationDAO
Method to get all association of a given type.

Specified by:
getAllAssociationsForType in interface AssociationDAO
Parameters:
resourcePath - the source path
associationType - the type of the association
Returns:
the array of associations of a given type
Throws:
RegistryException - if some error occurs while getting associations of a given type

replaceAssociations

public void replaceAssociations(String oldPath,
                                String newPath)
                         throws RegistryException
Description copied from interface: AssociationDAO
Method to replace all associations, when moving or renaming a resource. All the associations towards a given path can be replaced by the new path by calling this method.

Specified by:
replaceAssociations in interface AssociationDAO
Parameters:
oldPath - the old resource path
newPath - the new resource path
Throws:
RegistryException - if an error occurs while

removeAllAssociations

public void removeAllAssociations(String resourcePath)
                           throws RegistryException
Description copied from interface: AssociationDAO
Method to remove all associations for a given path.

Specified by:
removeAllAssociations in interface AssociationDAO
Parameters:
resourcePath - the source path
Throws:
RegistryException - if an error occurs while

copyAssociations

public void copyAssociations(String fromPath,
                             String toPath)
                      throws RegistryException
Description copied from interface: AssociationDAO
Method to copy associations for a given path to a new path.

Specified by:
copyAssociations in interface AssociationDAO
Parameters:
fromPath - the source path
toPath - the destination path
Throws:
RegistryException - if an error occurs while


Copyright © 2013 WSO2 Inc. All Rights Reserved.