Interface StorageManager

  • All Known Implementing Classes:
    TreeStorageManager

    public interface StorageManager
    Interface for managing a storage backend
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addListener​(StorageManagerListener listener)
      Receive notification of changes
      org.rundeck.storage.api.Resource<ResourceMeta> createFileResource​(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.String> meta)
      Create new resource, fails if it exists
      boolean deleteAllFileResources​(java.lang.String root)
      Recursively delete all files from the root path
      boolean deleteFileResource​(java.lang.String path)
      delete a resource
      boolean existsDirResource​(java.lang.String path)  
      boolean existsFileResource​(java.lang.String path)  
      org.rundeck.storage.api.Resource<ResourceMeta> getFileResource​(java.lang.String path)
      Return config file contents
      java.util.List<java.lang.String> listDirPaths​(java.lang.String path)
      List the full paths of all resources in the directory at the given path
      java.util.List<java.lang.String> listDirPaths​(java.lang.String path, java.lang.String pattern)
      List the full paths of all resources in the directory at the given path
      long loadFileResource​(java.lang.String path, java.io.OutputStream output)
      Read the contents of a file at the path into the outputstream
      void removeListener​(StorageManagerListener listener)
      Remove a listener
      org.rundeck.storage.api.Resource<ResourceMeta> updateFileResource​(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.String> meta)
      Update contents of an existing file
      org.rundeck.storage.api.Resource<ResourceMeta> writeFileResource​(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.String> meta)
      Write to a resource, create if it does not exist
    • Method Detail

      • addListener

        void addListener​(StorageManagerListener listener)
        Receive notification of changes
        Parameters:
        listener -
      • removeListener

        void removeListener​(StorageManagerListener listener)
        Remove a listener
        Parameters:
        listener -
      • existsFileResource

        boolean existsFileResource​(java.lang.String path)
        Parameters:
        path -
        Returns:
        true if a file exists at the path
      • existsDirResource

        boolean existsDirResource​(java.lang.String path)
        Parameters:
        path -
        Returns:
        true if a dir exists at the path
      • listDirPaths

        java.util.List<java.lang.String> listDirPaths​(java.lang.String path,
                                                      java.lang.String pattern)
        List the full paths of all resources in the directory at the given path
        Parameters:
        path - path directory path
        pattern - pattern match
      • listDirPaths

        java.util.List<java.lang.String> listDirPaths​(java.lang.String path)
        List the full paths of all resources in the directory at the given path
        Parameters:
        path - path directory path
      • getFileResource

        org.rundeck.storage.api.Resource<ResourceMeta> getFileResource​(java.lang.String path)
        Return config file contents
        Parameters:
        path -
      • loadFileResource

        long loadFileResource​(java.lang.String path,
                              java.io.OutputStream output)
                       throws java.io.IOException
        Read the contents of a file at the path into the outputstream
        Parameters:
        path -
        output -
        Returns:
        number of bytes copied
        Throws:
        java.io.IOException
      • updateFileResource

        org.rundeck.storage.api.Resource<ResourceMeta> updateFileResource​(java.lang.String path,
                                                                          java.io.InputStream input,
                                                                          java.util.Map<java.lang.String,​java.lang.String> meta)
        Update contents of an existing file
        Parameters:
        path - path
        input - data
        meta - meta
        Returns:
        resource
      • createFileResource

        org.rundeck.storage.api.Resource<ResourceMeta> createFileResource​(java.lang.String path,
                                                                          java.io.InputStream input,
                                                                          java.util.Map<java.lang.String,​java.lang.String> meta)
        Create new resource, fails if it exists
        Parameters:
        path - path
        input - stream
        meta - metadata
        Returns:
        resource
      • writeFileResource

        org.rundeck.storage.api.Resource<ResourceMeta> writeFileResource​(java.lang.String path,
                                                                         java.io.InputStream input,
                                                                         java.util.Map<java.lang.String,​java.lang.String> meta)
        Write to a resource, create if it does not exist
        Parameters:
        path - path
        input - stream
        meta - metadata
        Returns:
        resource
      • deleteFileResource

        boolean deleteFileResource​(java.lang.String path)
        delete a resource
        Parameters:
        path - path
        Returns:
        true if file was deleted or does not exist
      • deleteAllFileResources

        boolean deleteAllFileResources​(java.lang.String root)
        Recursively delete all files from the root path
        Parameters:
        root - root path
        Returns:
        true if successful