Class BaseStorageItem

  • Direct Known Subclasses:
    StorageBucket, StorageObject

    public abstract class BaseStorageItem
    extends Object
    Base class to represent storage items that can contain metadata: both objects and buckets.
    Author:
    James Murty
    • Method Detail

      • getName

        public String getName()
        Returns:
        the name of the bucket.
      • setName

        public void setName​(String name)
        Set the name of the bucket.
        Parameters:
        name - the name for the bucket
      • getMetadataMap

        public Map<String,​Object> getMetadataMap()
        Returns:
        an immutable map containing all the metadata associated with this object.
      • getMetadata

        public Object getMetadata​(String name)
        Parameters:
        name - the metadata item name.
        Returns:
        the value of the metadata with the given name, or null if no such metadata item exists.
      • containsMetadata

        public boolean containsMetadata​(String name)
        Parameters:
        name - the metadata item name.
        Returns:
        true if this object contains a metadata item with the given name, false otherwise.
      • addMetadata

        public void addMetadata​(String name,
                                String value)
        Adds a metadata item to the object.
        Parameters:
        name - the metadata item name.
        value - the metadata item value.
      • addMetadata

        public void addMetadata​(String name,
                                Date value)
        Adds a Date metadata item to the object.
        Parameters:
        name - the metadata item name.
        value - the metadata item's date value.
      • addMetadata

        public void addMetadata​(String name,
                                StorageOwner value)
        Adds an owner metadata item to the object.
        Parameters:
        name - the metadata item name.
        value - the metadata item's owner value.
      • addAllMetadata

        public void addAllMetadata​(Map<String,​Object> metadata)
        Adds all the items in the provided map to this object's metadata.
        Parameters:
        metadata - metadata items to add.
      • removeMetadata

        public void removeMetadata​(String name)
        Removes a metadata item from the object.
        Parameters:
        name - the name of the metadata item to remove.
      • replaceAllMetadata

        public void replaceAllMetadata​(Map<String,​Object> metadata)
        Removes all the metadata items associated with this object, then adds all the items in the provided map. After performing this operation, the metadata list will contain only those items in the provided map.
        Parameters:
        metadata - metadata items to add.
      • getOwner

        public StorageOwner getOwner()
        Returns:
        this object's owner, or null if the owner is not available.
      • setOwner

        public void setOwner​(StorageOwner owner)
        Set this object's owner object based on information returned from the service. This method should only by used by code that reads service responses.
        Parameters:
        owner -