Class SharesServiceImpl

    • Constructor Detail

      • SharesServiceImpl

        public SharesServiceImpl()
    • Method Detail

      • create

        public Share create​(ShareCreate shareCreate)
        Creates a share.
        Specified by:
        create in interface SharesService
        Parameters:
        shareCreate - the share to create
        Returns:
        the created share
      • list

        public List<? extends Share> list()
        Lists all shares.
        Specified by:
        list in interface SharesService
        Returns:
        list of all shares
      • listDetails

        public List<? extends Share> listDetails()
        Lists all shares, with details.
        Specified by:
        listDetails in interface SharesService
        Returns:
        list of all shares with details
      • get

        public Share get​(String shareId)
        Shows details for a share.
        Specified by:
        get in interface SharesService
        Parameters:
        shareId - the share ID
        Returns:
        the share or null if not found
      • update

        public Share update​(String shareId,
                            ShareUpdateOptions shareUpdateOptions)
        Updates a share.
        Specified by:
        update in interface SharesService
        Parameters:
        shareId - the share ID
        shareUpdateOptions - the options to update on the share
        Returns:
        the updated share
      • delete

        public ActionResponse delete​(String shareId,
                                     String consistencyGroupId)
        Description copied from interface: SharesService
        Deletes a share.
        Specified by:
        delete in interface SharesService
        Parameters:
        shareId - the share ID
        consistencyGroupId - the UUID of the consistency group where the share was created
        Returns:
        the action response
      • getMetadata

        public Metadata getMetadata​(String shareId)
        Shows the metadata for a share.
        Specified by:
        getMetadata in interface SharesService
        Parameters:
        shareId - the share ID
        Returns:
        the shares metadata
      • updateMetadata

        public Metadata updateMetadata​(String shareId,
                                       Metadata metadata)
        Updates the metadata for a share.
        Specified by:
        updateMetadata in interface SharesService
        Parameters:
        shareId - the share ID
        metadata - the metadata to update
        Returns:
        the updated metadata
      • setMetadata

        public Metadata setMetadata​(String shareId,
                                    Metadata metadata)
        Sets the metadata on a share.
        Specified by:
        setMetadata in interface SharesService
        Parameters:
        shareId - the share ID
        metadata - the metadata to set
        Returns:
        the updated metadata
      • unsetMetadata

        public ActionResponse unsetMetadata​(String shareId,
                                            String metadataKey)
        Unsets the metadata on a share.
        Specified by:
        unsetMetadata in interface SharesService
        Parameters:
        shareId - the share ID
        metadataKey - the metadata key to unset
        Returns:
        the action response
      • grantAccess

        public Access grantAccess​(String shareId,
                                  AccessOptions options)
        Grants access to a share.
        Specified by:
        grantAccess in interface SharesService
        Parameters:
        shareId - the share ID
        options - the options of the granted access
        Returns:
        the granted access
      • revokeAccess

        public ActionResponse revokeAccess​(String shareId,
                                           String accessId)
        Revokes access from a share.
        Specified by:
        revokeAccess in interface SharesService
        Parameters:
        shareId - the share ID
        accessId - the access ID to revoke
        Returns:
        the action response
      • listAccess

        public List<? extends Access> listAccess​(String shareId)
        List access rules for a share.
        Specified by:
        listAccess in interface SharesService
        Parameters:
        shareId - the share ID
        Returns:
        a list fo all access rules for the given share
      • resetState

        public ActionResponse resetState​(String shareId,
                                         Share.Status status)
        Administrators only. Explicitly updates the state of a share.
        Specified by:
        resetState in interface SharesService
        Parameters:
        shareId - the share ID
        status - the status to set
        Returns:
        the action response
      • forceDelete

        public ActionResponse forceDelete​(String shareId)
        Administrators only. Force-deletes a share in any state.
        Specified by:
        forceDelete in interface SharesService
        Parameters:
        shareId - the share ID
        Returns:
        the action response
      • extend

        public ActionResponse extend​(String shareId,
                                     int newSize)
        Increases the size of a share.
        Specified by:
        extend in interface SharesService
        Parameters:
        shareId - the share ID
        newSize - new size of the share, in GBs
        Returns:
        the action response
      • shrink

        public ActionResponse shrink​(String shareId,
                                     int newSize)
        Shrinks the size of a share.
        Specified by:
        shrink in interface SharesService
        Parameters:
        shareId - the share ID
        newSize - the new size of the share, in GBs
        Returns:
        the action response