Enum QualityOfService

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<QualityOfService>

    public enum QualityOfService
    extends java.lang.Enum<QualityOfService>
    Quality of Service associated with a publish action or subscription [MQTT-4.3].
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AT_LEAST_ONCE
      Message will be delivered at least once.
      AT_MOST_ONCE
      Message will be delivered at most once, or may not be delivered at all.
      EXACTLY_ONCE
      The message is always delivered exactly once.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static QualityOfService getEnumValueFromInteger​(int value)
      Creates a Java QualityOfService enum value from a native integer value
      int getValue()  
      static QualityOfService valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static QualityOfService[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • AT_MOST_ONCE

        public static final QualityOfService AT_MOST_ONCE
        Message will be delivered at most once, or may not be delivered at all. There will be no ACK, and the message will not be stored.
      • AT_LEAST_ONCE

        public static final QualityOfService AT_LEAST_ONCE
        Message will be delivered at least once. It may be resent multiple times if errors occur before an ACK is returned to the sender. The message will be stored in case it has to be re-sent. This is the most common QualityOfService.
      • EXACTLY_ONCE

        public static final QualityOfService EXACTLY_ONCE
        The message is always delivered exactly once. This is the safest, but slowest QualityOfService, because multiple levels of handshake must happen to guarantee no duplication of messages.
    • Method Detail

      • values

        public static QualityOfService[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (QualityOfService c : QualityOfService.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static QualityOfService valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Returns:
        the native enum integer value associated with this Java enum value
      • getEnumValueFromInteger

        public static QualityOfService getEnumValueFromInteger​(int value)
        Creates a Java QualityOfService enum value from a native integer value
        Parameters:
        value - native integer value for quality of service
        Returns:
        a new QualityOfService value