Package joynr

Class PeriodicSubscriptionQos

  • All Implemented Interfaces:
    HeartbeatSubscriptionInformation, JoynrType, Serializable

    public class PeriodicSubscriptionQos
    extends UnicastSubscriptionQos
    implements HeartbeatSubscriptionInformation
    Class representing the quality of service settings for subscriptions based on time periods.
    This class stores quality of service settings used for subscriptions to attributes in generated proxy objects. Notifications will only be sent if the period has expired. The subscription will automatically expire after the expiry date is reached. If no publications were received for alertAfter interval, publicationMissed will be called.
    See Also:
    Serialized Form
    • Constructor Detail

      • PeriodicSubscriptionQos

        public PeriodicSubscriptionQos()
        Default Constructor
    • Method Detail

      • getAlertAfterIntervalMs

        public long getAlertAfterIntervalMs()
        Get the alertAfterInterval in milliseconds.
        If no notification was received within the last alert interval, a missed publication notification will be raised.
        Specified by:
        getAlertAfterIntervalMs in interface HeartbeatSubscriptionInformation
        Returns:
        The alertAfterInterval in milliseconds. If more than alertAfterInterval milliseconds pass without receiving a message, the subscriptionManager will issue a publicationMissed. If set to 0, never alert.
      • setAlertAfterIntervalMs

        public PeriodicSubscriptionQos setAlertAfterIntervalMs​(long alertAfterIntervalMs)
        Set the alertAfterInterval in milliseconds.
        If no notification was received within the last alert interval, a missed publication notification will be raised.

        Minimum, Maximum, and Default Values:
        • The absolute minimum setting is the period value.
          Any value less than period will be replaced by the period setting.
        • The absolute maximum setting is 2.592.000.000 milliseconds (30 days).
          Any value bigger than this maximum will be treated at the absolute maximum setting of 2.592.000.000 milliseconds.
        • Default setting: 0 milliseconds (no alert). (no alert).

        Use clearAlertAfterInterval() to remove missed publication notifications.

        Parameters:
        alertAfterIntervalMs - If more than alertInterval_ms pass without receiving a message, subscriptionManager will issue a publication missed.
        Returns:
        this (fluent interface).
        See Also:
        clearAlertAfterInterval()
      • clearAlertAfterInterval

        public void clearAlertAfterInterval()
        Resets the alert interval to 0 milliseconds (no alert), which disables alerts. No missed publication notifications will be raised.
      • getPeriodMs

        public long getPeriodMs()
        Get the period in milliseconds.
        The provider will periodically send notifications every period milliseconds. The period can thus be seen as a sort of heart beat.
        Specified by:
        getPeriodMs in interface HeartbeatSubscriptionInformation
        Returns:
        The period value of the subscription in milliseconds.
      • setPeriodMs

        public PeriodicSubscriptionQos setPeriodMs​(long periodMs)
        Set the period in milliseconds.
        The provider will periodically send notifications every period milliseconds. The period can thus be seen as a sort of heart beat.

        Minimum, Maximum, and Default Values:
        • The absolute minimum setting is 50 milliseconds.
          Any value less than this minimum will be treated at the absolute minimum setting of 50 milliseconds.
        • The absolute maximum setting is 2.592.000.000 milliseconds (30 days).
          Any value bigger than this maximum will be treated at the absolute maximum setting of 2.592.000.000 milliseconds (30 days).
        • The default setting is 50 milliseconds (MIN_PERIOD).
        Parameters:
        periodMs - The publisher will send a notification at least every period_ms.
        Returns:
        this (fluent interface).
      • setExpiryDateMs

        public PeriodicSubscriptionQos 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 PeriodicSubscriptionQos 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 PeriodicSubscriptionQos 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
        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