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

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.dao.AssociationDAO

public class AssociationDAO
extends Object

Data Access Object for Associations


Constructor Summary
AssociationDAO()
           
 
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

AssociationDAO

public AssociationDAO()
Method Detail

addAssociation

public void addAssociation(String sourcePath,
                           String targetPath,
                           String associationType)
                    throws RegistryException
Method to persist an association.

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
Method to remove an association.

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
Method to get all association.

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
Method to get all association of a given type.

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
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.

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
Method to remove all associations for a given path.

Parameters:
resourcePath - the source path
Throws:
RegistryException - if an error occurs while

copyAssociations

public void copyAssociations(String fromPath,
                             String toPath)
                      throws RegistryException
Method to copy associations for a given path to a new path.

Parameters:
fromPath - the source path
toPath - the destination path
Throws:
RegistryException - if an error occurs while


Copyright © 2010. All Rights Reserved.