OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.core.policy.Lifespan Interface Reference

Specifies the maximum duration of validity of the data written by the org.omg.dds.pub.DataWriter. More...

Inheritance diagram for org.omg.dds.core.policy.Lifespan:
Inheritance graph
Collaboration diagram for org.omg.dds.core.policy.Lifespan:
Collaboration graph

Public Member Functions

Duration getDuration ()
 
ServiceEnvironment getEnvironment ()
 
Lifespan withDuration (Duration duration)
 Copy this policy and override the value of the property. More...
 
Lifespan withDuration (long duration, TimeUnit unit)
 Copy this policy and override the value of the property. More...
 

Detailed Description

Specifies the maximum duration of validity of the data written by the org.omg.dds.pub.DataWriter.

The default value of the lifespan duration is infinite.

Concerns: org.omg.dds.topic.Topic, org.omg.dds.pub.DataWriter

RxO: N/A

Changeable: Yes

The purpose of this QoS is to avoid delivering "stale" data to the application.

Each data sample written by the DataWriter has an associated "expiration time" beyond which the data should not be delivered to any application. Once the sample expires, the data will be removed from the DataReader caches as well as from the transient and persistent information caches.

The "expiration time" of each sample is computed by adding the duration specified by the LIFESPAN QoS to the source time stamp. As described in org.omg.dds.pub.DataWriter#write(Object) and org.omg.dds.pub.DataWriter#write(Object, org.omg.dds.core.Time), the source time stamp is either automatically computed by the Service each time the write operation is called, or else supplied by the application.

This QoS relies on the sender and receiving applications having their clocks sufficiently synchronized. If this is not the case and the Service can detect it, the DataReader is allowed to use the reception time stamp instead of the source time stamp in its computation of the "expiration time."

Definition at line 57 of file Lifespan.java.

Member Function Documentation

◆ getDuration()

Duration org.omg.dds.core.policy.Lifespan.getDuration ( )

◆ getEnvironment()

ServiceEnvironment org.omg.dds.core.DDSObject.getEnvironment ( )
inherited
Returns
the org.omg.dds.core.ServiceEnvironment object that directly or indirectly was used to create this object.

Implemented in org.omg.dds.core.ServiceEnvironment, org.opensplice.dds.sub.ReflectionDataReader< TYPE, OUT_TYPE >, org.opensplice.dds.core.ModifiableTimeImpl, org.opensplice.dds.pub.ReflectionDataWriter< TYPE >, org.opensplice.dds.core.DurationImpl, org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >, org.opensplice.dds.sub.ReadConditionImpl< TYPE >, org.opensplice.dds.core.EntityQosImpl< T extends QosPolicy >, org.opensplice.dds.type.TypeSupportImpl< TYPE >, org.opensplice.dds.topic.PublicationBuiltinTopicDataImpl, org.opensplice.dds.topic.SubscriptionBuiltinTopicDataImpl, org.opensplice.dds.topic.TopicBuiltinTopicDataImpl, org.opensplice.dds.domain.DomainParticipantFactoryImpl, org.opensplice.dds.core.QosProviderImpl, org.opensplice.dds.core.status.OfferedIncompatibleQosStatusImpl, org.opensplice.dds.core.status.RequestedIncompatibleQosStatusImpl, org.opensplice.dds.core.InstanceHandleImpl, org.opensplice.dds.core.StatusConditionImpl< T extends Entity<?, ?>, org.opensplice.dds.core.status.LivelinessChangedStatusImpl, org.opensplice.dds.core.status.PublicationMatchedStatusImpl, org.opensplice.dds.core.status.SubscriptionMatchedStatusImpl, org.opensplice.dds.sub.SampleImpl< TYPE >, org.opensplice.dds.core.policy.ShareImpl, org.opensplice.dds.core.status.OfferedDeadlineMissedStatusImpl, org.opensplice.dds.core.status.SampleRejectedStatusImpl, org.opensplice.dds.core.WaitSetImpl, org.opensplice.dds.topic.ParticipantBuiltinTopicDataImpl, org.opensplice.dds.core.status.RequestedDeadlineMissedStatusImpl, org.opensplice.dds.topic.BuiltinTopicKeyImpl, org.opensplice.dds.core.GuardConditionImpl, org.opensplice.dds.core.event.AllDataDisposedEventImpl< TYPE >, org.opensplice.dds.core.policy.QosPolicyCountImpl, org.opensplice.dds.core.status.InconsistentTopicStatusImpl, org.opensplice.dds.core.status.LivelinessLostStatusImpl, org.opensplice.dds.core.status.SampleLostStatusImpl, org.opensplice.dds.core.policy.QosPolicyImpl, org.opensplice.dds.core.status.AllDataDisposedStatusImpl, org.opensplice.dds.core.IllegalArgumentExceptionImpl, org.opensplice.dds.core.InconsistentPolicyExceptionImpl, org.opensplice.dds.core.policy.PolicyFactoryImpl, org.opensplice.dds.core.policy.TypeConsistencyEnforcementImpl, org.opensplice.dds.core.PreconditionNotMetExceptionImpl, org.opensplice.dds.core.AlreadyClosedExceptionImpl, org.opensplice.dds.core.IllegalOperationExceptionImpl, org.opensplice.dds.core.ImmutablePolicyExceptionImpl, org.opensplice.dds.core.NotEnabledExceptionImpl, org.opensplice.dds.core.OutOfResourcesExceptionImpl, org.opensplice.dds.core.DDSExceptionImpl, org.opensplice.dds.core.status.DataAvailableStatusImpl, and org.opensplice.dds.core.status.DataOnReadersStatusImpl.

◆ withDuration() [1/2]

Lifespan org.omg.dds.core.policy.Lifespan.withDuration ( Duration  duration)

Copy this policy and override the value of the property.

Parameters
durationSpecifies a duration for the length in time of the validity of the data.
Returns
a new Lifespan policy

Implemented in org.opensplice.dds.core.policy.LifespanImpl.

◆ withDuration() [2/2]

Lifespan org.omg.dds.core.policy.Lifespan.withDuration ( long  duration,
TimeUnit  unit 
)

Copy this policy and override the value of the property.

Parameters
durationSpecifies a long duration for the length in time of the validity of the data.
unitThe TimeUnit which the duration describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Returns
a new Lifespan policy

Implemented in org.opensplice.dds.core.policy.LifespanImpl.


The documentation for this interface was generated from the following file: