Class AbstractSpaceQuotaService<T extends AbstractSpaceQuotaKey>

    • Constructor Detail

      • AbstractSpaceQuotaService

        public AbstractSpaceQuotaService()
    • Method Detail

      • createKeyFrom

        protected abstract T createKeyFrom​(SpaceInst space)
        Creates a quota key for the specified space.
        Parameters:
        space - a space instance.
        Returns:
        the key
      • getQuotaReachedFromSpacePath

        @NonNull
        public Quota getQuotaReachedFromSpacePath​(T key)
        Description copied from interface: SpaceQuotaService
        Gets the quota reached by a resource from a given quota key and this in a recursively way.
        Specified by:
        getQuotaReachedFromSpacePath in interface SpaceQuotaService<T extends AbstractSpaceQuotaKey>
        Parameters:
        key - the key of the quota.
        Returns:
        a quota. If no such quota is associated with the given key, then an empty quota is returned. In this case the identifier, the type and the related source of the quota are null (undefined).
      • verify

        public Quota verify​(T key,
                            Quota quota,
                            AbstractQuotaCountingOffset countingOffset)
                     throws QuotaException
        Description copied from interface: QuotaService
        Verifies if the given loaded and computed quota by adding a counting offset.

        Be aware of that the quota count is not again computed by this service. When this signature is called, it means that the Quota instance has been already loaded and there is no need to perform again the counting.

        If full then a quota full exception is thrown. If not enough then a quota not enough exception is thrown.
        Specified by:
        verify in interface QuotaService<T extends AbstractSpaceQuotaKey>
        Overrides:
        verify in class AbstractQuotaService<T extends AbstractSpaceQuotaKey>
        Parameters:
        key - the key
        quota - a loaded quota
        countingOffset - a counting offset
        Returns:
        a copied quota from the given one containing the count with the offset used by the verify treatment
        Throws:
        QuotaException - on error