Class DefaultBand

  • All Implemented Interfaces:
    Band, BandEntry

    public final class DefaultBand
    extends java.lang.Object
    implements Band, BandEntry
    A default implementation for a Band.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DefaultBand.Builder  
      • Nested classes/interfaces inherited from interface org.onosproject.net.meter.Band

        Band.Type
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultBand​(Band.Type type, long rate, java.lang.Long burstSize, java.lang.Short prec)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DefaultBand.Builder builder()  
      java.lang.Long burst()
      The burst size at which the meter applies.
      long bytes()
      Return the bytes seen by this band.
      java.lang.Short dropPrecedence()
      Only meaningful in the case of a REMARK band type.
      long packets()
      Returns the packets seen by this band.
      long rate()
      The rate at which this meter applies.
      void setBytes​(long bytes)
      Sets the number of bytes seen by this band.
      void setPackets​(long packets)
      Sets the number of packets seen by this band.
      java.lang.String toString()  
      Band.Type type()
      Signals the type of band to create.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultBand

        public DefaultBand​(Band.Type type,
                           long rate,
                           java.lang.Long burstSize,
                           java.lang.Short prec)
    • Method Detail

      • rate

        public long rate()
        Description copied from interface: Band
        The rate at which this meter applies.
        Specified by:
        rate in interface Band
        Returns:
        the long value of the rate
      • burst

        public java.lang.Long burst()
        Description copied from interface: Band
        The burst size at which the meter applies.
        Specified by:
        burst in interface Band
        Returns:
        the long value of the size
      • dropPrecedence

        public java.lang.Short dropPrecedence()
        Description copied from interface: Band
        Only meaningful in the case of a REMARK band type. indicates by which amount the drop precedence of the packet should be increase if the band is exceeded.
        Specified by:
        dropPrecedence in interface Band
        Returns:
        a short value
      • type

        public Band.Type type()
        Description copied from interface: Band
        Signals the type of band to create.
        Specified by:
        type in interface Band
        Returns:
        a band type
      • packets

        public long packets()
        Description copied from interface: Band
        Returns the packets seen by this band.
        Specified by:
        packets in interface Band
        Returns:
        a long value
      • bytes

        public long bytes()
        Description copied from interface: Band
        Return the bytes seen by this band.
        Specified by:
        bytes in interface Band
        Returns:
        a byte counter
      • setPackets

        public void setPackets​(long packets)
        Description copied from interface: BandEntry
        Sets the number of packets seen by this band.
        Specified by:
        setPackets in interface BandEntry
        Parameters:
        packets - a packet count
      • setBytes

        public void setBytes​(long bytes)
        Description copied from interface: BandEntry
        Sets the number of bytes seen by this band.
        Specified by:
        setBytes in interface BandEntry
        Parameters:
        bytes - a byte counter
      • toString

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