Package joynr
Class PeriodicSubscriptionQos
- java.lang.Object
-
- io.joynr.pubsub.SubscriptionQos
-
- joynr.UnicastSubscriptionQos
-
- joynr.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
-
-
Field Summary
-
Fields inherited from class joynr.UnicastSubscriptionQos
DEFAULT_PUBLICATION_TTL_MS, MAX_PUBLICATION_TTL_MS, MIN_PUBLICATION_TTL_MS
-
Fields inherited from class io.joynr.pubsub.SubscriptionQos
IGNORE_VALUE, INFINITE_SUBSCRIPTION, NO_EXPIRY_DATE
-
-
Constructor Summary
Constructors Constructor Description PeriodicSubscriptionQos()Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAlertAfterInterval()Resets the alert interval to 0 milliseconds (no alert), which disables alerts.booleanequals(Object obj)Check for equalitylonggetAlertAfterIntervalMs()Get the alertAfterInterval in milliseconds.longgetPeriodMs()Get the period in milliseconds.inthashCode()Calculate code for hashing based on member contentsPeriodicSubscriptionQossetAlertAfterIntervalMs(long alertAfterIntervalMs)Set the alertAfterInterval in milliseconds.PeriodicSubscriptionQossetExpiryDateMs(long expiryDateMs)Set the end date of the subscription, in milliseconds (since 1970-01-01T00:00:00.000 ).PeriodicSubscriptionQossetPeriodMs(long periodMs)Set the period in milliseconds.PeriodicSubscriptionQossetPublicationTtlMs(long publicationTtlMs)Set the time-to-live for notification messages.PeriodicSubscriptionQossetValidityMs(long validityMs)Set how long the subscription should run for, in milliseconds.-
Methods inherited from class joynr.UnicastSubscriptionQos
getPublicationTtlMs
-
Methods inherited from class io.joynr.pubsub.SubscriptionQos
clearExpiryDate, getExpiryDateMs
-
-
-
-
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:
getAlertAfterIntervalMsin interfaceHeartbeatSubscriptionInformation- 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()
- The absolute minimum setting is the period value.
-
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:
getPeriodMsin interfaceHeartbeatSubscriptionInformation- 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).
- The absolute minimum setting is 50 milliseconds.
-
setExpiryDateMs
public PeriodicSubscriptionQos setExpiryDateMs(long expiryDateMs)
Description copied from class:SubscriptionQosSet 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:
setExpiryDateMsin classUnicastSubscriptionQos- 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:UnicastSubscriptionQosSet 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:
setPublicationTtlMsin classUnicastSubscriptionQos- 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:SubscriptionQosSet how long the subscription should run for, in milliseconds. This is a helper method that allows setting the expiryDate using a relative time.- Overrides:
setValidityMsin classUnicastSubscriptionQos- 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:
hashCodein classUnicastSubscriptionQos- Returns:
- The calculated hash code
-
equals
public boolean equals(Object obj)
Check for equality- Overrides:
equalsin classUnicastSubscriptionQos- Parameters:
obj- Reference to the object to compare to- Returns:
- true, if objects are equal, false otherwise
-
-