Package joynr
Class OnChangeSubscriptionQos
- java.lang.Object
-
- io.joynr.pubsub.SubscriptionQos
-
- joynr.UnicastSubscriptionQos
-
- joynr.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
-
-
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 OnChangeSubscriptionQos()Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Check for equalitylonggetMinIntervalMs()Get the minimum interval in milliseconds.inthashCode()Calculate code for hashing based on member contents and superclassOnChangeSubscriptionQossetExpiryDateMs(long expiryDateMs)Set the end date of the subscription, in milliseconds (since 1970-01-01T00:00:00.000 ).OnChangeSubscriptionQossetMinIntervalMs(long minIntervalMs)Set the minimum interval in milliseconds.OnChangeSubscriptionQossetPublicationTtlMs(long publicationTtlMs)Set the time-to-live for notification messages.OnChangeSubscriptionQossetValidityMs(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
-
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: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 OnChangeSubscriptionQos 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 OnChangeSubscriptionQos 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 and superclass- 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
-
-