org.rundeck.storage.conf
Class ConverterTree<T extends ContentMeta>

java.lang.Object
  extended by org.rundeck.storage.impl.StringToPathTree<T>
      extended by org.rundeck.storage.impl.BaseDelegateTree<T>
          extended by org.rundeck.storage.impl.DelegateTree<T>
              extended by org.rundeck.storage.conf.ConverterTree<T>
All Implemented Interfaces:
Tree<T>

public class ConverterTree<T extends ContentMeta>
extends DelegateTree<T>

Tree that can convert resource content with a ContentConverter


Constructor Summary
ConverterTree(Tree<T> delegate, ContentConverter<T> converter, PathSelector pathSelector)
          Convert content from the delegate with the given converter if it matches the selector
ConverterTree(Tree<T> delegate, ContentConverter<T> converter, PathSelector pathSelector, ResourceSelector<T> resourceSelector)
           
ConverterTree(Tree<T> delegate, ContentConverter<T> converter, ResourceSelector<T> resourceSelector)
           
 
Method Summary
 Resource<T> createResource(Path path, T content)
          Create a resource
 Resource<T> getPath(Path path)
          Return the resource or directory at the path
 Resource<T> getResource(Path path)
          Return the resource at the path
 Resource<T> updateResource(Path path, T content)
          Update an existing resource
 
Methods inherited from class org.rundeck.storage.impl.DelegateTree
deleteResource, hasDirectory, hasPath, hasResource, listDirectory, listDirectoryResources, listDirectorySubdirs
 
Methods inherited from class org.rundeck.storage.impl.BaseDelegateTree
getDelegate, setDelegate
 
Methods inherited from class org.rundeck.storage.impl.StringToPathTree
createResource, deleteResource, getPath, getResource, hasDirectory, hasPath, hasResource, listDirectory, listDirectoryResources, listDirectorySubdirs, updateResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rundeck.storage.api.Tree
createResource, deleteResource, getPath, getResource, hasDirectory, hasPath, hasResource, listDirectory, listDirectoryResources, listDirectorySubdirs, updateResource
 

Constructor Detail

ConverterTree

public ConverterTree(Tree<T> delegate,
                     ContentConverter<T> converter,
                     PathSelector pathSelector)
Convert content from the delegate with the given converter if it matches the selector

Parameters:
delegate - delegate
converter - converter
pathSelector - path selection

ConverterTree

public ConverterTree(Tree<T> delegate,
                     ContentConverter<T> converter,
                     ResourceSelector<T> resourceSelector)

ConverterTree

public ConverterTree(Tree<T> delegate,
                     ContentConverter<T> converter,
                     PathSelector pathSelector,
                     ResourceSelector<T> resourceSelector)
Method Detail

getResource

public Resource<T> getResource(Path path)
Description copied from interface: Tree
Return the resource at the path

Specified by:
getResource in interface Tree<T extends ContentMeta>
Overrides:
getResource in class DelegateTree<T extends ContentMeta>
Parameters:
path - path
Returns:
Resource

getPath

public Resource<T> getPath(Path path)
Description copied from interface: Tree
Return the resource or directory at the path

Specified by:
getPath in interface Tree<T extends ContentMeta>
Overrides:
getPath in class DelegateTree<T extends ContentMeta>
Parameters:
path - path
Returns:
Resource or directory

createResource

public Resource<T> createResource(Path path,
                                  T content)
Description copied from interface: Tree
Create a resource

Specified by:
createResource in interface Tree<T extends ContentMeta>
Overrides:
createResource in class DelegateTree<T extends ContentMeta>
Parameters:
path - path
Returns:
the resource

updateResource

public Resource<T> updateResource(Path path,
                                  T content)
Description copied from interface: Tree
Update an existing resource

Specified by:
updateResource in interface Tree<T extends ContentMeta>
Overrides:
updateResource in class DelegateTree<T extends ContentMeta>
Parameters:
path - path
Returns:
the resource