org.wso2.carbon.registry.core.jdbc
Class RecursionRepository

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

public class RecursionRepository
extends Object

This is used to handle recursive repository operations that might need calling registry methods for non-recursive resources.


Constructor Summary
RecursionRepository(Registry registry)
          Constructor accepting registry.
RecursionRepository(Repository repository, Registry registry)
          Constructor accepting both registry and repository.
 
Method Summary
 String copy(ResourcePath sourceResourcePath, ResourcePath targetResourcePath)
          Method to do a copy from source to target.
 void deleteSubTree(ResourceIDImpl resourceID, ResourceDO resourceDO, boolean keepAuthorization)
          Method to delete a sub tree of the collection hierarchy.
 void dumpRecursively(String path, Writer writer)
          Method to dump a tree of resources recursively.
 String moveRecursively(ResourceIDImpl sourceID, String targetPath, ResourceIDImpl targetParentResourceID)
          Method to do a recursive move operation.
 void restoreRecursively(String path, Reader reader)
          Method to restore a tree of resource recursively.
 void setRepository(Repository repository)
          Constructor accepting repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecursionRepository

public RecursionRepository(Repository repository,
                           Registry registry)
Constructor accepting both registry and repository.

Parameters:
repository - the repository
registry - the registry

RecursionRepository

public RecursionRepository(Registry registry)
Constructor accepting registry.

Parameters:
registry - the registry
Method Detail

setRepository

public void setRepository(Repository repository)
Constructor accepting repository.

Parameters:
repository - the repository

copy

public String copy(ResourcePath sourceResourcePath,
                   ResourcePath targetResourcePath)
            throws RegistryException
Method to do a copy from source to target.

Parameters:
sourceResourcePath - the source path.
targetResourcePath - the target path.
Returns:
the target path.
Throws:
RegistryException - if the operation failed.

moveRecursively

public String moveRecursively(ResourceIDImpl sourceID,
                              String targetPath,
                              ResourceIDImpl targetParentResourceID)
                       throws RegistryException
Method to do a recursive move operation.

Parameters:
sourceID - the source resource's identifier.
targetPath - the target resource path.
targetParentResourceID - the target resource's parent's identifier.
Returns:
the target path.
Throws:
RegistryException - if the operation failed.

deleteSubTree

public void deleteSubTree(ResourceIDImpl resourceID,
                          ResourceDO resourceDO,
                          boolean keepAuthorization)
                   throws RegistryException
Method to delete a sub tree of the collection hierarchy.

Parameters:
resourceID - the resource identifier.
resourceDO - the resource data object.
keepAuthorization - whether to keep authorizations.
Throws:
RegistryException - if the operation failed.

dumpRecursively

public void dumpRecursively(String path,
                            Writer writer)
                     throws RegistryException
Method to dump a tree of resources recursively.

Parameters:
path - the path to dump
writer - the xml writer the dump should be written to.
Throws:
RegistryException - if the operation failed.

restoreRecursively

public void restoreRecursively(String path,
                               Reader reader)
                        throws RegistryException
Method to restore a tree of resource recursively.

Parameters:
path - the path to dump
reader - the xml writer the dump should be read from.
Throws:
RegistryException - if the operation failed.


Copyright © 2012 WSO2 Inc. All Rights Reserved.