com.dtolabs.rundeck.core.storage
Class AuthRundeckStorageTree

java.lang.Object
  extended by com.dtolabs.rundeck.core.storage.AuthRundeckStorageTree
All Implemented Interfaces:
AuthStorageTree, AuthTree<ResourceMeta>, ExtTree<AuthContext,ResourceMeta>

public class AuthRundeckStorageTree
extends java.lang.Object
implements AuthStorageTree

AuthRundeckStorageTree provides authorized access to a tree using an AuthContext for each request.

Since:
2014-03-20

Field Summary
static java.lang.String CREATE
           
static java.lang.String DELETE
           
static java.lang.String NAME_RES_KEY
           
static java.lang.String PATH_RES_KEY
           
static java.lang.String PROJECT_PATH_COMPONENT
           
static java.lang.String READ
           
static java.lang.String STORAGE_PATH_AUTH_RES_TYPE
           
static java.lang.String UPDATE
           
 
Constructor Summary
AuthRundeckStorageTree(StorageTree storageTree)
           
 
Method Summary
 Resource<ResourceMeta> createResource(AuthContext auth, Path path, ResourceMeta content)
          Create a resource
 boolean deleteResource(AuthContext auth, Path path)
          Delete a resource at a path
 Resource<ResourceMeta> getPath(AuthContext auth, Path path)
          Return the resource or directory at the path
 Resource<ResourceMeta> getResource(AuthContext auth, Path path)
          Return the resource at the path
 boolean hasDirectory(AuthContext auth, Path path)
          Return true if a directory at the path exists
 boolean hasPath(AuthContext auth, Path path)
          Return true if the path exists
 boolean hasResource(AuthContext auth, Path path)
          Return true if a resource at the path exists
 java.util.Set<Resource<ResourceMeta>> listDirectory(AuthContext auth, Path path)
          Return the set of resources at the directory path
 java.util.Set<Resource<ResourceMeta>> listDirectoryResources(AuthContext auth, Path path)
          Return the set of non-directory resources at the directory path
 java.util.Set<Resource<ResourceMeta>> listDirectorySubdirs(AuthContext auth, Path path)
          Return the set of sub directory resources within the directory path
 Resource<ResourceMeta> updateResource(AuthContext auth, Path path, ResourceMeta content)
          Update an existing resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ

public static final java.lang.String READ
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

CREATE

public static final java.lang.String CREATE
See Also:
Constant Field Values

UPDATE

public static final java.lang.String UPDATE
See Also:
Constant Field Values

STORAGE_PATH_AUTH_RES_TYPE

public static final java.lang.String STORAGE_PATH_AUTH_RES_TYPE
See Also:
Constant Field Values

PATH_RES_KEY

public static final java.lang.String PATH_RES_KEY
See Also:
Constant Field Values

NAME_RES_KEY

public static final java.lang.String NAME_RES_KEY
See Also:
Constant Field Values

PROJECT_PATH_COMPONENT

public static final java.lang.String PROJECT_PATH_COMPONENT
See Also:
Constant Field Values
Constructor Detail

AuthRundeckStorageTree

public AuthRundeckStorageTree(StorageTree storageTree)
Method Detail

hasPath

public boolean hasPath(AuthContext auth,
                       Path path)
Description copied from interface: ExtTree
Return true if the path exists

Specified by:
hasPath in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
true if it exists

hasResource

public boolean hasResource(AuthContext auth,
                           Path path)
Description copied from interface: ExtTree
Return true if a resource at the path exists

Specified by:
hasResource in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
true if a resource exists

hasDirectory

public boolean hasDirectory(AuthContext auth,
                            Path path)
Description copied from interface: ExtTree
Return true if a directory at the path exists

Specified by:
hasDirectory in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
true if the path is a directory

getPath

public Resource<ResourceMeta> getPath(AuthContext auth,
                                      Path path)
Description copied from interface: ExtTree
Return the resource or directory at the path

Specified by:
getPath in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
Resource or directory

getResource

public Resource<ResourceMeta> getResource(AuthContext auth,
                                          Path path)
Description copied from interface: ExtTree
Return the resource at the path

Specified by:
getResource in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
Resource

listDirectoryResources

public java.util.Set<Resource<ResourceMeta>> listDirectoryResources(AuthContext auth,
                                                                    Path path)
Description copied from interface: ExtTree
Return the set of non-directory resources at the directory path

Specified by:
listDirectoryResources in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
set of resources

listDirectory

public java.util.Set<Resource<ResourceMeta>> listDirectory(AuthContext auth,
                                                           Path path)
Description copied from interface: ExtTree
Return the set of resources at the directory path

Specified by:
listDirectory in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
set of resources

listDirectorySubdirs

public java.util.Set<Resource<ResourceMeta>> listDirectorySubdirs(AuthContext auth,
                                                                  Path path)
Description copied from interface: ExtTree
Return the set of sub directory resources within the directory path

Specified by:
listDirectorySubdirs in interface ExtTree<AuthContext,ResourceMeta>
path - directory path
Returns:
set of subdirectories

deleteResource

public boolean deleteResource(AuthContext auth,
                              Path path)
Description copied from interface: ExtTree
Delete a resource at a path

Specified by:
deleteResource in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
true if the resource was deleted

createResource

public Resource<ResourceMeta> createResource(AuthContext auth,
                                             Path path,
                                             ResourceMeta content)
Description copied from interface: ExtTree
Create a resource

Specified by:
createResource in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
the resource

updateResource

public Resource<ResourceMeta> updateResource(AuthContext auth,
                                             Path path,
                                             ResourceMeta content)
Description copied from interface: ExtTree
Update an existing resource

Specified by:
updateResource in interface ExtTree<AuthContext,ResourceMeta>
path - path
Returns:
the resource