Class StorageProviderBase

java.lang.Object
org.duracloud.storage.provider.StorageProviderBase
All Implemented Interfaces:
StorageProvider

public abstract class StorageProviderBase extends Object implements StorageProvider
  • Field Details

  • Constructor Details

    • StorageProviderBase

      public StorageProviderBase()
  • Method Details

    • spaceExists

      protected abstract boolean spaceExists(String spaceId)
    • removeSpace

      protected abstract void removeSpace(String spaceId)
    • getAllSpaceProperties

      protected abstract Map<String,String> getAllSpaceProperties(String spaceId)
    • doSetSpaceProperties

      protected abstract void doSetSpaceProperties(String spaceId, Map<String,String> spaceProps)
    • getSpaceProperties

      public Map<String,String> getSpaceProperties(String spaceId)
      This method returns all of the space properties EXCEPT the ACLs
      Specified by:
      getSpaceProperties in interface StorageProvider
      Parameters:
      spaceId - - ID of the space
      Returns:
      map of space properties
    • setNewSpaceProperties

      public void setNewSpaceProperties(String spaceId, Map<String,String> spaceProperties)
      Sets the properties on this space. Maintains the current ACL settings.
      Parameters:
      spaceId -
      spaceProperties -
    • setNewSpaceProperties

      public void setNewSpaceProperties(String spaceId, Map<String,String> spaceProperties, Map<String,AclType> spaceACLs)
      Sets the properties of this space. Note that this method is intentionally not exposed to users, as it is not meant to be used for user properties, but only for system-level properties. The names and values need to be kept short, and the overall number of properties needs to be tightly limited, or there will be issues due to provider-specific limitation. This method allows for Space Access control details to be updated at the same time as space properties.
      Parameters:
      spaceId -
      spaceProperties -
      spaceACLs -
    • getSpaceACLs

      public Map<String,AclType> getSpaceACLs(String spaceId)
      Description copied from interface: StorageProvider
      Retrieves the ACLs associated with a space.
      Specified by:
      getSpaceACLs in interface StorageProvider
      Parameters:
      spaceId - - ID of the space
      Returns:
      Map of space ACLs or empty map if none exists
    • unpackACLs

      protected Map<String,AclType> unpackACLs(Map<String,String> spaceProps)
    • setSpaceACLs

      public void setSpaceACLs(String spaceId, Map<String,AclType> spaceACLs)
      Description copied from interface: StorageProvider
      Sets the ACLs associated with a space.
      Specified by:
      setSpaceACLs in interface StorageProvider
      Parameters:
      spaceId - - ID of the space
      spaceACLs - - Updated space ACL. Note, null or empty arg spaceACLs will 'clear' the space ACLs.
    • packACLs

      protected Map<String,String> packACLs(Map<String,AclType> spaceACLs)
    • throwIfSpaceNotExist

      protected void throwIfSpaceNotExist(String spaceId)
    • throwIfSpaceNotExist

      protected void throwIfSpaceNotExist(String spaceId, boolean wait)
    • deleteSpace

      public void deleteSpace(String spaceId)
      Deletes a space.
      Specified by:
      deleteSpace in interface StorageProvider
      Parameters:
      spaceId - - ID of the space
    • deleteSpaceSync

      public void deleteSpaceSync(String spaceId)
      This method is only intended to be used by tests!
      Parameters:
      spaceId -
    • getSpaceDeleteWorker

      public StorageProviderBase.SpaceDeleteWorker getSpaceDeleteWorker(String spaceId)
    • removeCalculatedProperties

      protected Map<String,String> removeCalculatedProperties(Map<String,String> properties)
    • setWrappedStorageProvider

      public void setWrappedStorageProvider(StorageProvider wrappedStorageProvider)
      Sets an alternate storage provider that can be used for select operations. The motivation for adding this method came from a need to have the deleteSpace operation generate audit events for content items as they were deleted before the space itself was deleted.
      Parameters:
      wrappedStorageProvider -