Class MaxDownloadsServiceDescriptor

  • All Implemented Interfaces:
    com.jscape.util.db.IntVersioned, java.io.Serializable

    public class MaxDownloadsServiceDescriptor
    extends ServiceDescriptor
    Domain download service descriptor. The service described by this descriptor takes responsibility for limiting downloads count.
    Author:
    Alex Usun
    See Also:
    Serialized Form
    • Constructor Detail

      • MaxDownloadsServiceDescriptor

        public MaxDownloadsServiceDescriptor​(long value,
                                             long resetPeriod,
                                             long transferredBytes,
                                             long nextResetTime)
        Creates a new service descriptor.
        Parameters:
        value - max downloads in bytes
        resetPeriod - reset period in ms
        transferredBytes - transferred bytes count
        nextResetTime - next reset time
      • MaxDownloadsServiceDescriptor

        public MaxDownloadsServiceDescriptor​(long value,
                                             long resetPeriod)
        Creates a new descriptor instance.
        Parameters:
        value - max downloads in bytes
        resetPeriod - reset period in ms
      • MaxDownloadsServiceDescriptor

        public MaxDownloadsServiceDescriptor()
        This constructor is used by serialization sub-system and is not intended to use directly in client code.
    • Method Detail

      • getValue

        public long getValue()
        Returns max downloads.
        Returns:
        max downloads bytes
      • setValue

        public void setValue​(long value)
        Sets max downloads.
        Parameters:
        value - max downloads bytes
      • getResetPeriod

        public long getResetPeriod()
        Returns counter reset period.
        Returns:
        counter reset period in ms
      • setResetPeriod

        public void setResetPeriod​(long value)
        Sets counter reset period.
        Parameters:
        value - counter reset period in ms
      • getTransferredBytes

        public long getTransferredBytes()
        Returns transferred bytes count.
        Returns:
        transferred bytes count
      • setTransferredBytes

        public void setTransferredBytes​(long value)
        Sets transferred bytes count.
        Parameters:
        value - transferred bytes count
      • getNextResetTime

        public long getNextResetTime()
        Retuns next reset time.
        Returns:
        next reset time
      • setNextResetTime

        public void setNextResetTime​(long value)
        Sets next reset time.
        Parameters:
        value - next reset time
      • transferQuota

        public Quota transferQuota()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object