Package joynr

Class OnChangeSubscriptionQos

  • All Implemented Interfaces:
    JoynrType, Serializable
    Direct Known Subclasses:
    OnChangeWithKeepAliveSubscriptionQos

    public class OnChangeSubscriptionQos
    extends UnicastSubscriptionQos
    Class representing the quality of service settings for subscriptions based on changes.
    This class stores quality of service settings used for subscriptions to broadcasts and attributes in generated proxy objects. Notifications will only be sent if the subscribed value has changed. The subscription will automatically expire after the expiry date is reached. If no publications were received for alertAfterInterval, publicationMissed will be called.
    minInterval can be used to prevent too many messages being sent.
    See Also:
    Serialized Form
    • Constructor Detail

      • OnChangeSubscriptionQos

        public OnChangeSubscriptionQos()
        Default Constructor
    • Method Detail

      • getMinIntervalMs

        public long getMinIntervalMs()
        Get the minimum interval in milliseconds.
        Publications will be sent maintaining this minimum interval provided, even if the value changes more often. This prevents the consumer from being flooded by updated values. The filtering happens on the provider's side, thus also preventing excessive network traffic. This value is provided in milliseconds.
        Returns:
        The minInterval in milliseconds. The publisher will keep a minimum idle time of minInterval milliseconds between two successive notifications.
      • setMinIntervalMs

        public OnChangeSubscriptionQos setMinIntervalMs​(long minIntervalMs)
        Set the minimum interval in milliseconds.
        Publications will be sent maintaining this minimum interval provided, even if the value changes more often. This prevents the consumer from being flooded by updated values. The filtering happens on the provider's side, thus also preventing excessive network traffic. This value is provided in milliseconds.

        Minimum and Maximum Values
        • Minimum minInterval: 0L. Smaller values will be rounded up.
        • Maximum minInterval: 2592000000L. Larger values will be rounded down.
        Parameters:
        minIntervalMs - The publisher will keep a minimum idle time of minIntervalMs between two successive notifications.
        Returns:
        this (fluent interface).
      • setExpiryDateMs

        public OnChangeSubscriptionQos setExpiryDateMs​(long expiryDateMs)
        Description copied from class: SubscriptionQos
        Set the end date of the subscription, in milliseconds (since 1970-01-01T00:00:00.000 ). The publications will automatically expire at that date.
        The provider will send notifications until the expiry date is reached. You will not receive any notifications (neither value notifications nor missed publication notifications) after this date.
        Overrides:
        setExpiryDateMs in class UnicastSubscriptionQos
        Parameters:
        expiryDateMs - is the end date of the subscription.
        This value is provided in milliseconds (since 1970-01-01T00:00:00.000). 0L means NO_EXPIRY_DATE.
        Returns:
        the subscriptionQos (fluent interface)
      • setPublicationTtlMs

        public OnChangeSubscriptionQos setPublicationTtlMs​(long publicationTtlMs)
        Description copied from class: UnicastSubscriptionQos
        Set the time-to-live for notification messages.
        Notification messages will be sent with this time-to-live. If a notification message can not be delivered within its time to live, it will be deleted from the system. This value is provided in milliseconds.
        Overrides:
        setPublicationTtlMs in class UnicastSubscriptionQos
        Parameters:
        publicationTtlMs - publicationTtlMs time-to-live in milliseconds.

        Minimum, Maximum and Default Values:
        • Minimum publicationTtlMs = 100L. Smaller values will be rounded up.
        • Maximum publicationTtlMs = 2592000000L. Larger values will be rounded down.
        • Default publicationTtlMs = 10000L.
        Returns:
        the subscriptionQos (fluent interface)
      • setValidityMs

        public OnChangeSubscriptionQos setValidityMs​(long validityMs)
        Description copied from class: SubscriptionQos
        Set how long the subscription should run for, in milliseconds. This is a helper method that allows setting the expiryDate using a relative time.
        Overrides:
        setValidityMs in class UnicastSubscriptionQos
        Parameters:
        validityMs - is the number of milliseconds until the subscription will expire
        Returns:
        the subscriptionQos (fluent interface)
      • hashCode

        public int hashCode()
        Calculate code for hashing based on member contents and superclass
        Overrides:
        hashCode in class UnicastSubscriptionQos
        Returns:
        The calculated hash code
      • equals

        public boolean equals​(Object obj)
        Check for equality
        Overrides:
        equals in class UnicastSubscriptionQos
        Parameters:
        obj - Reference to the object to compare to
        Returns:
        true, if objects are equal, false otherwise