OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.opensplice.dds.sub.DataReader< TYPE > Interface Template Reference
Inheritance diagram for org.opensplice.dds.sub.DataReader< TYPE >:
Inheritance graph
Collaboration diagram for org.opensplice.dds.sub.DataReader< TYPE >:
Collaboration graph

Public Member Functions

public< OTHER > DataReader< OTHER > cast ()
 Cast this data reader to the given type, or throw an exception if the cast fails. More...
 
abstract void close ()
 Halt communication and dispose the resources held by this Entity. More...
 
void closeContainedEntities ()
 This operation closes all the entities that were created by means of the "create" operations on the DataReader. More...
 
QueryCondition< TYPE > createQueryCondition (String queryExpression, List< String > queryParameters)
 This operation creates a QueryCondition. More...
 
QueryCondition< TYPE > createQueryCondition (String queryExpression, String... queryParameters)
 This operation creates a QueryCondition. More...
 
QueryCondition< TYPE > createQueryCondition (Subscriber.DataState states, String queryExpression, List< String > queryParameters)
 This operation creates a QueryCondition. More...
 
QueryCondition< TYPE > createQueryCondition (Subscriber.DataState states, String queryExpression, String... queryParameters)
 This operation creates a QueryCondition. More...
 
ReadCondition< TYPE > createReadCondition (Subscriber.DataState states)
 This operation creates a ReadCondition. More...
 
void enable ()
 This operation enables the Entity. More...
 
InstanceHandle getInstanceHandle ()
 
TYPE getKeyValue (TYPE keyHolder, InstanceHandle handle)
 This operation can be used to retrieve the instance key that corresponds to an instance handle. More...
 
TYPE getKeyValue (InstanceHandle handle)
 This operation can be used to retrieve the instance key that corresponds to an instance handle. More...
 
LISTENER getListener ()
 This operation allows access to the existing Listener attached to the Entity. More...
 
LivelinessChangedStatus getLivelinessChangedStatus ()
 This operation obtains the LivelinessChangedStatus object of the DataReader. More...
 
PublicationBuiltinTopicData getMatchedPublicationData (InstanceHandle publicationHandle)
 This operation retrieves information on a publication that is currently "associated" with the DataReader; that is, a publication with a matching org.omg.dds.topic.Topic and compatible QoS that the application has not indicated should be "ignored" by means of org.omg.dds.domain.DomainParticipant#ignorePublication(InstanceHandle). More...
 
Set< InstanceHandlegetMatchedPublications ()
 This operation retrieves the list of publications currently "associated" with the DataReader; that is, publications that have a matching org.omg.dds.topic.Topic and compatible QoS that the application has not indicated should be "ignored" by means of org.omg.dds.domain.DomainParticipant#ignorePublication(InstanceHandle). More...
 
Subscriber getParent ()
 
QOS getQos ()
 This operation allows access to the existing set of QoS policies for the Entity. More...
 
RequestedDeadlineMissedStatus getRequestedDeadlineMissedStatus ()
 This operation obtains the RequestedDeadlineMissedStatus object of the DataReader. More...
 
RequestedIncompatibleQosStatus getRequestedIncompatibleQosStatus ()
 This operation obtains the RequestedIncompatibleQosStatus object of the DataReader. More...
 
SampleLostStatus getSampleLostStatus ()
 This operation obtains the SampleLostStatus object of the DataReader. More...
 
SampleRejectedStatus getSampleRejectedStatus ()
 This operation obtains the SampleRejectedStatus object of the DataReader. More...
 
Set< Class<? extends Status > > getStatusChanges ()
 This operation retrieves the list of communication statuses in the Entity that are 'triggered. More...
 
StatusCondition< DataReader< TYPE > > getStatusCondition ()
 
SubscriptionMatchedStatus getSubscriptionMatchedStatus ()
 This operation obtains the SubscriptionMatchedStatus object of the DataReader. More...
 
TopicDescription< TYPE > getTopicDescription ()
 
InstanceHandle lookupInstance (TYPE keyHolder)
 This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument. More...
 
Sample.Iterator< TYPE > read ()
 This operation accesses a collection of samples from this DataReader. More...
 
Sample.Iterator< TYPE > read (Selector< TYPE > query)
 This operation accesses a collection of samples from this DataReader. More...
 
Sample.Iterator< TYPE > read (int maxSamples)
 This operation accesses a collection of samples from this DataReader. More...
 
List< Sample< TYPE > > read (List< Sample< TYPE >> samples)
 This operation accesses a collection of samples from this DataReader. More...
 
List< Sample< TYPE > > read (List< Sample< TYPE >> samples, Selector< TYPE > selector)
 This operation accesses a collection of samples from this DataReader. More...
 
boolean readNextSample (Sample< TYPE > sample)
 This operation copies the next, non-previously accessed sample from this DataReader. More...
 
void retain ()
 Indicates that references to this object may go out of scope but that the application expects to look it up again later. More...
 
Selector< TYPE > select ()
 Provides a Selector that can be used to refine what read or take methods return. More...
 
void setListener (LISTENER listener)
 This operation installs a Listener on the Entity. More...
 
void setListener (LISTENER listener, Collection< Class<? extends Status >> statuses)
 This operation installs a Listener on the Entity. More...
 
void setListener (LISTENER listener, Class<? extends Status >... statuses)
 This operation installs a Listener on the Entity. More...
 
void setQos (QOS qos)
 This operation is used to set the QoS policies of the Entity. More...
 
Sample.Iterator< TYPE > take ()
 This operation accesses a collection of samples from this DataReader. More...
 
Sample.Iterator< TYPE > take (int maxSamples)
 This operation accesses a collection of samples from this DataReader. More...
 
Sample.Iterator< TYPE > take (Selector< TYPE > query)
 This operation accesses a collection of samples from this DataReader. More...
 
List< Sample< TYPE > > take (List< Sample< TYPE >> samples)
 This operation accesses a collection of samples from this DataReader. More...
 
List< Sample< TYPE > > take (List< Sample< TYPE >> samples, Selector< TYPE > query)
 This operation accesses a collection of samples from this DataReader. More...
 
boolean takeNextSample (Sample< TYPE > sample)
 This operation copies the next, non-previously accessed sample from this DataReader and "removes" it from the DataReader so it is no longer accessible. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (Duration maxWait) throws TimeoutException
 This operation is intended only for DataReader entities for which org.omg.dds.core.policy.Durability#getKind() is not org.omg.dds.core.policy.Durability.Kind#VOLATILE. More...
 
void waitForHistoricalData (String filterExpression, List< String > filterParameters, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (long maxWait, TimeUnit unit) throws TimeoutException
 This operation is intended only for DataReader entities for which org.omg.dds.core.policy.Durability#getKind() is not org.omg.dds.core.policy.Durability.Kind#VOLATILE. More...
 
void waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 
void waitForHistoricalData (ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException
 This operation will block the application thread until all historical data that matches the supplied conditions is received. More...
 

Detailed Description

Definition at line 30 of file DataReader.java.

Member Function Documentation

◆ cast()

public<OTHER> DataReader<OTHER> org.omg.dds.sub.DataReader< TYPE >.cast ( )
inherited

Cast this data reader to the given type, or throw an exception if the cast fails.

Parameters
<OTHER>The type of the data subscribed to by this reader, according to the caller.
Returns
this data reader
Exceptions
ClassCastExceptionif the cast fails

◆ close()

abstract void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.close ( )
abstractinherited

Halt communication and dispose the resources held by this Entity.

Closing an Entity implicitly closes all of its contained objects, if any. For example, closing a Publisher also closes all of its contained DataWriters.

An Entity cannot be closed if it has any unclosed dependent objects, not including contained objects. These include the following:

The deletion of a org.omg.dds.pub.DataWriter will automatically unregister all instances. Depending on the settings of the org.omg.dds.core.policy.WriterDataLifecycle, the deletion of the DataWriter may also dispose all instances.

Exceptions
PreconditionNotMetExceptionif close is called on an Entity with unclosed dependent object(s), not including contained objects.
See also
org.omg.dds.topic.TopicDescription::close()

◆ closeContainedEntities()

void org.omg.dds.sub.DataReader< TYPE >.closeContainedEntities ( )
inherited

This operation closes all the entities that were created by means of the "create" operations on the DataReader.

That is, it closes all contained ReadCondition and QueryCondition objects.

Exceptions
org.omg.dds.core.PreconditionNotMetExceptionif the any of the contained entities is in a state where it cannot be closed.

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ createQueryCondition() [1/4]

QueryCondition<TYPE> org.omg.dds.sub.DataReader< TYPE >.createQueryCondition ( String  queryExpression,
List< String >  queryParameters 
)
inherited

This operation creates a QueryCondition.

The returned QueryCondition will be attached and belong to the DataReader. It will trigger on any sample state, view state, or instance state.

The selection of the content is done using the queryExpression with parameters queryParameters.

  • The queryExpression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The queryParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).
Example:

This example assumes a Subscriber called "subscriber" and DataReader named "fooDr" has been created
and a datatype called Foo is present: class Foo { int age; String name; };
// Create a QueryCondition
// And apply a condition that only samples with age > 0 and name equals BILL are shown.
String expr = "age &gt; %0 AND name = %1");
List<String> params = new ArrayList<String>();
params.add("0");
params.add("BILL");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(expr,params);

Returns
a new QueryCondition
Parameters
queryExpressionThe returned condition will only trigger on samples that pass this content-based filter expression.
queryParametersA set of parameter values for the queryExpression.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
createQueryCondition(org.omg.dds.sub.Subscriber.DataState, String, List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ createQueryCondition() [2/4]

QueryCondition<TYPE> org.omg.dds.sub.DataReader< TYPE >.createQueryCondition ( String  queryExpression,
String...  queryParameters 
)
inherited

This operation creates a QueryCondition.

The returned QueryCondition will be attached and belong to the DataReader. It will trigger on any sample state, view state, or instance state.

The selection of the content is done using the queryExpression with parameters queryParameters.

  • The queryExpression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The queryParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).
Example:

This example assumes a Subscriber called "subscriber" and DataReader named "fooDr" has been created
and a datatype called Foo is present: class Foo { int age; String name; };
// Create a QueryCondition
// And apply a condition that only samples with age > 0 and name equals BILL are shown.
String expr = "age &gt; %0 AND name = %1");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(expr,"0","BILL");

Returns
a new QueryCondition
Parameters
queryExpressionThe returned condition will only trigger on samples that pass this content-based filter expression.
queryParametersA set of parameter values for the queryExpression.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
createQueryCondition(org.omg.dds.sub.Subscriber.DataState, String, List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ createQueryCondition() [3/4]

QueryCondition<TYPE> org.omg.dds.sub.DataReader< TYPE >.createQueryCondition ( Subscriber.DataState  states,
String  queryExpression,
List< String >  queryParameters 
)
inherited

This operation creates a QueryCondition.

The returned QueryCondition will be attached and belong to the DataReader.

The selection of the content is done using the queryExpression with parameters queryParameters.

  • The queryExpression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The queryParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).

State Masks

The result of the QueryCondition also depends on the selection of samples determined by three org.omg.dds.sub.Subscriber.DataState masks:

  • org.omg.dds.sub.SampleState is the mask, which selects only those samples with the desired sample states READ, NOT_READ or both.
  • org.omg.dds.sub.ViewState is the mask, which selects only those samples with the desired view states NEW, NOT_NEW or both
  • org.omg.dds.sub.InstanceState is the mask, which selects only those samples with the desired instance states ALIVE_INSTANCE, NOT_ALIVE_DISPOSED, NOT_ALIVE_NO_WRITERS or a combination of these.
Example:

This example assumes a Subscriber called "subscriber" and DataReader named "fooDr" has been created
and a datatype called Foo is present: class Foo { int age; String name; };
// Create a QueryCondition with a DataState with a sample state of not read, new view state and alive instance state.
// And apply a condition that only samples with age > 0 and name equals BILL are shown.
DataState ds = subscriber.createDataState();
ds = ds.with(SampleState.NOT_READ)
       .with(ViewState.NEW)
       .with(InstanceState.ALIVE);
String expr = "age &gt; %0 AND name = %1");
List<String> params = new ArrayList<String>();
params.add("0");
params.add("BILL");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(ds,expr,params);

Returns
a new QueryCondition
Parameters
statesThe returned condition will only trigger on samples with one of these sample states, view states, and instance states.
queryExpressionThe returned condition will only trigger on samples that pass this content-based filter expression.
queryParametersA set of parameter values for the queryExpression.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
#createQueryCondition(String, List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ createQueryCondition() [4/4]

QueryCondition<TYPE> org.omg.dds.sub.DataReader< TYPE >.createQueryCondition ( Subscriber.DataState  states,
String  queryExpression,
String...  queryParameters 
)
inherited

This operation creates a QueryCondition.

The returned QueryCondition will be attached and belong to the DataReader.

The selection of the content is done using the queryExpression with parameters queryParameters.

  • The queryExpression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The queryParameters attribute is a sequence of strings that give values to the "parameters" (i.e., "%n" tokens) in the queryExpression. The number of supplied parameters must fit with the requested values in the queryExpression (i.e., the number of "%n" tokens).

State Masks

The result of the QueryCondition also depends on the selection of samples determined by three org.omg.dds.sub.Subscriber.DataState masks:

  • org.omg.dds.sub.SampleState is the mask, which selects only those samples with the desired sample states READ, NOT_READ or both.
  • org.omg.dds.sub.ViewState is the mask, which selects only those samples with the desired view states NEW, NOT_NEW or both
  • org.omg.dds.sub.InstanceState is the mask, which selects only those samples with the desired instance states ALIVE_INSTANCE, NOT_ALIVE_DISPOSED, NOT_ALIVE_NO_WRITERS or a combination of these.
Example:

This example assumes a Subscriber called "subscriber" and DataReader named "fooDr" has been created
and a datatype called Foo is present: class Foo { int age; String name; };
// Create a QueryCondition with a DataState with a sample state of not read, new view state and alive instance state.
// And apply a condition that only samples with age > 0 and name equals BILL are shown.
DataState ds = subscriber.createDataState();
ds = ds.with(SampleState.NOT_READ)
       .with(ViewState.NEW)
       .with(InstanceState.ALIVE);
String expr = "age &gt; %0 AND name = %1");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(ds,expr,"0","BILL");

Returns
a new QueryCondition
Parameters
statesThe returned condition will only trigger on samples with one of these sample states, view states, and instance states.
queryExpressionThe returned condition will only trigger on samples that pass this content-based filter expression.
queryParametersA set of parameter values for the queryExpression.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
#createQueryCondition(String, List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ createReadCondition()

ReadCondition<TYPE> org.omg.dds.sub.DataReader< TYPE >.createReadCondition ( Subscriber.DataState  states)
inherited

This operation creates a ReadCondition.

The returned ReadCondition will be attached and belong to the DataReader.

State Masks

The result of the ReadCondition depends on the selection of samples determined by three org.omg.dds.sub.Subscriber.DataState masks:

  • org.omg.dds.sub.SampleState is the mask, which selects only those samples with the desired sample states READ, NOT_READ or both.
  • org.omg.dds.sub.ViewState is the mask, which selects only those samples with the desired view states NEW, NOT_NEW or both
  • org.omg.dds.sub.InstanceState is the mask, which selects only those samples with the desired instance states ALIVE_INSTANCE, NOT_ALIVE_DISPOSED, NOT_ALIVE_NO_WRITERS or a combination of these.
Example:

This example assumes a Subscriber called "subscriber" and DataReader named "fooDr" has been created
and a datatype called Foo is present: class Foo { int age; String name; };
// Create a ReadCondition with a DataState with a sample state of not read, new view state and alive instance state.
DataState ds = subscriber.createDataState();
ds = ds.with(SampleState.NOT_READ)
       .with(ViewState.NEW)
       .with(InstanceState.ALIVE);
ReadCondition<Foo> readCond = fooDr.createReadCondition(ds);

Returns
a new ReadCondition
Parameters
statesThe returned condition will only trigger on samples with one of these sample states, view states, and instance states.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ enable()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.enable ( )
inherited

This operation enables the Entity.

Entity objects can be created either enabled or disabled. This is controlled by the value of the org.omg.dds.core.policy.EntityFactory on the corresponding factory for the Entity.

The default setting of org.omg.dds.core.policy.EntityFactory is such that, by default, it is not necessary to explicitly call enable on newly created entities.

The enable operation is idempotent. Calling enable on an already enabled Entity has no effect.

If an Entity has not yet been enabled, the following kinds of operations may be invoked on it:

  • Operations to set or get an Entity's QoS policies (including default QoS policies) and listener
  • getStatusCondition()
  • 'factory' operations and close()
  • getStatusChanges() and other get status operations (although the status of a disabled entity never changes)
  • 'lookup' operations

Other operations may explicitly state that they may be called on disabled entities; those that do not will fail with org.omg.dds.core.NotEnabledException.

It is legal to delete an Entity that has not been enabled by calling close(). Entities created from a factory that is disabled are created disabled regardless of the setting of org.omg.dds.core.policy.EntityFactory.

Calling enable on an Entity whose factory is not enabled will fail with org.omg.dds.core.PreconditionNotMetException.

If org.omg.dds.core.policy.EntityFactory#isAutoEnableCreatedEntities() is true, the enable operation on the factory will automatically enable all entities created from the factory.

The Listeners associated with an entity are not called until the entity is enabled. org.omg.dds.core.Conditions associated with an entity that is not enabled are "inactive," that is, have a triggerValue == false.

In addition to the general description, the enable operation on a org.omg.dds.sub.Subscriber has special meaning in specific usecases. This applies only to Subscribers with PresentationQoS coherent-access set to true with access-scope set to group.

In this case the subscriber is always created in a disabled state, regardless of the factory's auto-enable created entities setting. While the subscriber remains disabled, DataReaders can be created that will participate in coherent transactions of the subscriber.

See org.omg.dds.sub.Subscriber#beginAccess() and org.omg.dds.sub.Subscriber#endAccess() for more information.

All DataReaders will also be created in a disabled state. Coherency with group access-scope requires data to be delivered as a transaction, atomically, to all eligible readers. Therefore data should not be delivered to any single DataReader immediately after it's created, as usual, but only after the application has finished creating all DataReaders for a given Subscriber. At this point, the application should enable the Subscriber which in turn enables all its DataReaders.

Note that for a DataWriter which has a corresponding Publisher with a PresentationQoS with coherent-access set to true and access-scope set to topic or group that the HistoryQoS of the DataWriter should be set to KEEP_ALL otherwise the enable operation will fail. See org.omg.dds.pub.Publisher#createDataWriter(Topic, DataWriterQos, DataWriterListener, Collection)

◆ getInstanceHandle()

InstanceHandle org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getInstanceHandle ( )
inherited
Returns
the org.omg.dds.core.InstanceHandle that represents the Entity.

◆ getKeyValue() [1/2]

TYPE org.omg.dds.sub.DataReader< TYPE >.getKeyValue ( TYPE  keyHolder,
InstanceHandle  handle 
)
inherited

This operation can be used to retrieve the instance key that corresponds to an instance handle.

The operation will only fill the fields that form the key inside the keyHolder instance.

Parameters
keyHoldera container, into which this method shall place its result.
handlea handle indicating the instance whose value this method should get.
Returns
keyHolder, as a convenience to facilitate chaining.
Exceptions
IllegalArgumentExceptionif the org.omg.dds.core.InstanceHandle does not correspond to an existing data object known to the DataReader. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.

Implemented in org.opensplice.dds.sub.DataReaderImpl< TYPE >.

◆ getKeyValue() [2/2]

TYPE org.omg.dds.sub.DataReader< TYPE >.getKeyValue ( InstanceHandle  handle)
inherited

This operation can be used to retrieve the instance key that corresponds to an instance handle.

The operation will only fill the fields that form the key inside the keyHolder instance.

Parameters
handlea handle indicating the instance whose value this method should get.
Returns
An instance with key fields populated.
Exceptions
IllegalArgumentExceptionif the org.omg.dds.core.InstanceHandle does not correspond to an existing data object known to the DataReader. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.

Implemented in org.opensplice.dds.sub.DataReaderImpl< TYPE >.

◆ getListener()

LISTENER org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getListener ( )
inherited

This operation allows access to the existing Listener attached to the Entity.

Returns
The attached listener if set, or null otherwise.
See also
#setListener(EventListener)
#setListener(EventListener, Collection)

◆ getLivelinessChangedStatus()

LivelinessChangedStatus org.omg.dds.sub.DataReader< TYPE >.getLivelinessChangedStatus ( )
inherited

This operation obtains the LivelinessChangedStatus object of the DataReader.

This object contains the information whether the liveliness of one or more DataWriter objects that were writing instances read by the DataReader has changed. In other words, some DataWriter have become "alive" or "not alive".

The LivelinessChangedStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the LivelinessChangedStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.LivelinessChangedStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getMatchedPublicationData()

PublicationBuiltinTopicData org.omg.dds.sub.DataReader< TYPE >.getMatchedPublicationData ( InstanceHandle  publicationHandle)
inherited

This operation retrieves information on a publication that is currently "associated" with the DataReader; that is, a publication with a matching org.omg.dds.topic.Topic and compatible QoS that the application has not indicated should be "ignored" by means of org.omg.dds.domain.DomainParticipant#ignorePublication(InstanceHandle).

The operation getMatchedPublications() can be used to find the publications that are currently matched with the DataReader.

Parameters
publicationHandlea handle to the publication, the data of which is to be retrieved.
Returns
a new object containing a copy of the information.
Exceptions
IllegalArgumentExceptionif the publicationHandle does not correspond to a publication currently associated with the DataReader.
UnsupportedOperationExceptionif the infrastructure does not hold the information necessary to fill in the publicationData.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
UnsupportedOperationExceptionif the infrastructure does not hold the information necessary to fill in the publicationnData.
See also
getMatchedPublications()

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getMatchedPublications()

Set<InstanceHandle> org.omg.dds.sub.DataReader< TYPE >.getMatchedPublications ( )
inherited

This operation retrieves the list of publications currently "associated" with the DataReader; that is, publications that have a matching org.omg.dds.topic.Topic and compatible QoS that the application has not indicated should be "ignored" by means of org.omg.dds.domain.DomainParticipant#ignorePublication(InstanceHandle).

The handles returned in the 'publicationHandles' list are the ones that are used by the DDS implementation to locally identify the corresponding matched DataWriter entities. These handles match the ones that appear in org.omg.dds.sub.Sample#getInstanceHandle() when reading the "DCPSPublications" built-in topic.

Be aware that since an instance handle is an opaque datatype, it does not necessarily mean that the handles obtained from the getMatchedPublications operation have the same value as the ones that appear in the instanceHandle field of the SampleInfo when retrieving the subscription info through corresponding "DCPSPublications" built-in reader. You can't just compare two handles to determine whether they represent the same publication. If you want to know whether two handles actually do represent the same subscription, use both handles to retrieve their corresponding PublicationBuiltinTopicData samples and then compare the key field of both samples.

The operation may fail with an UnsupportedOperationException if the infrastructure does not locally maintain the connectivity information.

Returns
a new collection containing a copy of the information.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
UnsupportedOperationExceptionif the infrastructure does not hold the information necessary to fill in the publicationnData.
See also
getMatchedPublicationData(InstanceHandle)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getParent()

Subscriber org.omg.dds.sub.DataReader< TYPE >.getParent ( )
inherited

◆ getQos()

QOS org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getQos ( )
inherited

This operation allows access to the existing set of QoS policies for the Entity.

This operation must be provided by each of the derived Entity classes (org.omg.dds.domain.DomainParticipant, org.omg.dds.topic.Topic, org.omg.dds.pub.Publisher, org.omg.dds.pub.DataWriter, org.omg.dds.sub.Subscriber, org.omg.dds.sub.DataReader) so that the policies meaningful to the particular Entity are retrieved.

See also
#setQos(EntityQos)

◆ getRequestedDeadlineMissedStatus()

RequestedDeadlineMissedStatus org.omg.dds.sub.DataReader< TYPE >.getRequestedDeadlineMissedStatus ( )
inherited

This operation obtains the RequestedDeadlineMissedStatus object of the DataReader.

This object contains the information whether the deadline that the DataReader was expecting through its DeadlineQosPolicy was not respected for a specific instance.

The RequestedDeadlineMissedStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the RequestedDeadlineMissedStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.RequestedDeadlineMissedStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getRequestedIncompatibleQosStatus()

RequestedIncompatibleQosStatus org.omg.dds.sub.DataReader< TYPE >.getRequestedIncompatibleQosStatus ( )
inherited

This operation obtains the RequestedIncompatibleQosStatus object of the DataReader.

This object contains the information whether a QosPolicy setting was incompatible with the offered QosPolicy setting. The Request/Offering mechanism is applicable between the DataWriter and the DataReader. If the QosPolicy settings between DataWriter and DataReader are inconsistent, no communication between them is established. In addition the DataWriter will be informed via a RequestedIncompatibleQos status change and the DataReader will be informed via an OfferedIncompatibleQos status change.

The RequestedIncompatibleQosStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the RequestedDeadlineMissedStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.RequestedIncompatibleQosStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getSampleLostStatus()

SampleLostStatus org.omg.dds.sub.DataReader< TYPE >.getSampleLostStatus ( )
inherited

This operation obtains the SampleLostStatus object of the DataReader.

This object contains information whether samples have been lost. This only applies when the ReliabilityQosPolicy is set to RELIABLE. If the ReliabilityQosPolicy is set to BEST_EFFORT the Data Distribution Service will not report the loss of samples.

The SampleLostStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the SampleLostStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.SampleLostStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getSampleRejectedStatus()

SampleRejectedStatus org.omg.dds.sub.DataReader< TYPE >.getSampleRejectedStatus ( )
inherited

This operation obtains the SampleRejectedStatus object of the DataReader.

This object contains the information whether a received sample has been rejected. Samples may be rejected by the DataReader when it runs out of resourceLimits to store incoming samples. Usually this means that old samples need to be 'consumed' (for example by 'taking' them instead of 'reading' them) to make room for newly incoming samples.

The SampleRejectedStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the SampleRejectedStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.SampleRejectedStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getStatusChanges()

Set<Class<? extends Status> > org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getStatusChanges ( )
inherited

This operation retrieves the list of communication statuses in the Entity that are 'triggered.

' That is, the list of statuses whose value has changed since the last time the application read the status.

When the entity is first created or if the entity is not enabled, all communication statuses are in the "untriggered" state so the list returned will be empty.

The list of statuses returned refers to the statuses that are triggered on the Entity itself and does not include statuses that apply to contained entities.

Returns
a new Set containing the triggered statuses.

◆ getStatusCondition()

StatusCondition<DataReader<TYPE> > org.omg.dds.sub.DataReader< TYPE >.getStatusCondition ( )
inherited

◆ getSubscriptionMatchedStatus()

SubscriptionMatchedStatus org.omg.dds.sub.DataReader< TYPE >.getSubscriptionMatchedStatus ( )
inherited

This operation obtains the SubscriptionMatchedStatus object of the DataReader.

This object contains the information whether a new match has been discovered for the current subscription, or whether an existing match has ceased to exist. This means that the status represents that either a DataWriter object has been discovered by the DataReader with the same Topic and a compatible Qos, or that a previously discovered DataWriter has ceased to be matched to the current DataReader. A DataWriter may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DataReader or when either the DataReader or the DataWriter has chosen to put its matching counterpart on its ignore-list using the ignorePublication or ignoreSubcription operations on the DomainParticipant. The operation may fail if the infrastructure does not hold the information necessary to fill in the SubscriptionMatchedStatus. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See the description for the NetworkingService/Discovery/enabled property in the Deployment Manual for more information about this subject.) In this case the operation will return an UnsupportedOperationException.

The SubscriptionMatchedStatus can also be monitored using a DataReaderListener or by using the associated StatusCondition.

Returns
the SubscriptionMatchedStatus object
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
org.omg.dds.core.status.SubscriptionMatchedStatus

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ getTopicDescription()

TopicDescription<TYPE> org.omg.dds.sub.DataReader< TYPE >.getTopicDescription ( )
inherited
Returns
the TopicDescription associated with the DataReader. This is the same TopicDescription that was used to create the DataReader.

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ lookupInstance()

InstanceHandle org.omg.dds.sub.DataReader< TYPE >.lookupInstance ( TYPE  keyHolder)
inherited

This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument.

The instance parameter is only used for the purpose of examining the fields that define the key.

This operation does not register the instance in question. If the instance has not been previously registered, or if for any other reason the Service is unable to provide an instance handle, the Service will return a nil handle.

Parameters
keyHoldera sample of the instance whose handle this method should look up.
Returns
an immutable handle to the instance.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.

Implemented in org.opensplice.dds.sub.DataReaderImpl< TYPE >.

◆ read() [1/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.read ( )
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like read(Selector) except that the collection of returned samples is not constrained by any Selector. These samples contain the actual data and meta information.

Invalid Data
Some elements in the returned sequence may not have valid data: the valid_data field in the SampleInfo indicates whether the corresponding data value contains any meaningful data. If not, the data value is just a 'dummy' sample for which only the keyfields have been assigned. It is used to accompany the SampleInfo that communicates a change in the instanceState of an instance for which there is no 'real' sample available.

For example, when an application always 'takes' all available samples of a particular instance, there is no sample available to report the disposal of that instance. In such a case the DataReader will insert a dummy sample into the data values sequence to accompany the SampleInfo element that communicates the disposal of the instance.

The act of reading a sample sets its sample_state to SampleState.READ. If the sample belongs to the most recent generation of the instance, it also sets the viewState of the instance to ViewState.NOT_NEW. It does not affect the instanceState of the instance.

Example:


// Read samples
Iterator<Sample<Foo>> samples = fooDr.read();
// Process each Sample and print its name and production time.
while (samples.hasNext()) {
    Sample sample = samples.next();
    Foo foo = sample.getData();
    if (foo != null) { //Check if the sample is valid.
         Time t = sample.getSourceTimestamp(); // meta information
         System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
    }
}

Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
#read(Selector)
#read(List)
#read(List, Selector)
#readNextSample(Sample)
take()

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ read() [2/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.read ( Selector< TYPE >  query)
inherited

This operation accesses a collection of samples from this DataReader.

The returned samples will be limited by the given Selector. The setting of the org.omg.dds.core.policy.Presentation may impose further limits on the returned samples.

  1. If org.omg.dds.core.policy.Presentation#getAccessScope() is org.omg.dds.core.policy.Presentation.AccessScopeKind#INSTANCE, then samples belonging to the same data instance are consecutive.
  2. If org.omg.dds.core.policy.Presentation#getAccessScope() is org.omg.dds.core.policy.Presentation.AccessScopeKind#TOPIC and org.omg.dds.core.policy.Presentation#isOrderedAccess() is set to false, then samples belonging to the same data instance are consecutive.
  3. If org.omg.dds.core.policy.Presentation#getAccessScope() is org.omg.dds.core.policy.Presentation.AccessScopeKind#TOPIC and org.omg.dds.core.policy.Presentation#isOrderedAccess() is set to true, then samples belonging to the same instance may or may not be consecutive. This is because to preserve order it may be necessary to mix samples from different instances.
  4. If org.omg.dds.core.policy.Presentation#getAccessScope() is org.omg.dds.core.policy.Presentation.AccessScopeKind#GROUP and org.omg.dds.core.policy.Presentation#isOrderedAccess() is set to false, then samples belonging to the same data instance are consecutive.
  5. If org.omg.dds.core.policy.Presentation#getAccessScope() is org.omg.dds.core.policy.Presentation.AccessScopeKind#GROUP and org.omg.dds.core.policy.Presentation#isOrderedAccess() is set to true, then the returned collection contains at most one sample. The difference in this case is due to the fact that it is required that the application is able to read samples belonging to different DataReader objects in a specific order.

In any case, the relative order between the samples of one instance is consistent with the org.omg.dds.core.policy.DestinationOrder:

In addition to the sample data, the read operation also provides sample meta-information ("sample info"). See org.omg.dds.sub.Sample.

The returned samples are "loaned" by the DataReader. The use of this variant allows for zero-copy (assuming the implementation supports it) access to the data and the application will need to "return the loan" to the DataReader using the Sample.Iterator#close() operation.

Some elements in the returned collection may not have valid data. If the instance state in the Sample is org.omg.dds.sub.InstanceState#NOT_ALIVE_DISPOSED or org.omg.dds.sub.InstanceState#NOT_ALIVE_NO_WRITERS, then the last sample for that instance in the collection, that is, the one with org.omg.dds.sub.Sample#getSampleRank() == 0, does not contain valid data. Samples that contain no data do not count towards the limits imposed by the org.omg.dds.core.policy.ResourceLimits.

The act of reading a sample sets its sample state to org.omg.dds.sub.SampleState#READ. If the sample belongs to the most recent generation of the instance, it will also set the view state of the instance to org.omg.dds.sub.ViewState#NOT_NEW. It will not affect the instance state of the instance.

If the DataReader has no samples that meet the constraints, the return value will be a non-null iterator that provides no samples.

Invalid Data
Some elements in the returned sequence may not have valid data: the valid_data field in the SampleInfo indicates whether the corresponding data value contains any meaningful data. If not, the data value is just a 'dummy' sample for which only the keyfields have been assigned. It is used to accompany the SampleInfo that communicates a change in the instanceState of an instance for which there is no 'real' sample available.

For example, when an application always 'takes' all available samples of a particular instance, there is no sample available to report the disposal of that instance. In such a case the DataReader will insert a dummy sample into the data values sequence to accompany the SampleInfo element that communicates the disposal of the instance.

The act of reading a sample sets its sample_state to SampleState.READ. If the sample belongs to the most recent generation of the instance, it also sets the viewState of the instance to ViewState.NOT_NEW. It does not affect the instanceState of the instance.

Example:

 
 // create a dataState that only reads not read, new and alive samples
 DataState ds = subscriber.createDataState();
 ds = ds.with(SampleState.NOT_READ)
        .with(ViewState.NEW)
        .with(InstanceState.ALIVE);
 // Read samples through an selector with the set dataState
 Selector<Foo> query = fooDr.select();
 query.dataState(ds);
 Iterator<Sample<Foo>> samples = fooDr.read(query);
 // Process each Sample and print its name and production time.
 while (samples.hasNext()) {
     Sample sample = samples.next();
     Foo foo = sample.getData();
     if (foo != null) { //Check if the sample is valid.
          Time t = sample.getSourceTimestamp(); // meta information
          System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
     }
 }
 
 
Parameters
querya selector to be used on the read
Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
read()
#read(List)
#read(List, Selector)
#readNextSample(Sample)
#take(Selector)

◆ read() [3/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.read ( int  maxSamples)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like read() except that the returned samples are no more than #maxSamples.

Parameters
maxSamplesThe maximum number of samples to read
Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
read()
#read(Selector)
#read(List, Selector)
#readNextSample(Sample)
#take(List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ read() [4/5]

List<Sample<TYPE> > org.omg.dds.sub.DataReader< TYPE >.read ( List< Sample< TYPE >>  samples)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like read() except that the returned samples are not "on loan" from the Service; they are deeply copied to the application.

If the number of samples read are fewer than the current length of the list, the list will be trimmed to fit the samples read. If list is null, a new list will be allocated and its size may be zero or unbounded depending upon the number of samples read. If there are no samples, the list reference will be non-null and the list will contain zero samples.

The read operation will copy the data and meta-information into the elements already inside the given collection, overwriting any samples that might already be present. The use of this variant forces a copy but the application can control where the copy is placed and the application will not need to "return the loan."


// Read samples and store them in a pre allocated collection
List<Sample<Foo>> samples = new ArrayList<Sample<Foo>>();
fooDr.read(samples);
// Process each Sample and print its name and production time.
for (Sample<Foo> sample : samples) {
    Foo foo = sample.getData();
    if (foo != null) { //Check if the sample is valid.
         Time t = sample.getSourceTimestamp();
         System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
    }
}

Parameters
samplesA pre allocated collection to store the samples in
Returns
samples, for convenience.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
read()
#read(Selector)
#read(List, Selector)
#readNextSample(Sample)
#take(List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ read() [5/5]

List<Sample<TYPE> > org.omg.dds.sub.DataReader< TYPE >.read ( List< Sample< TYPE >>  samples,
Selector< TYPE >  selector 
)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like read(Selector) except that the returned samples are not "on loan" from the Service; they are deeply copied to the application.

The number of samples are specified as the minimum of Selector#getMaxSamples() and the length of the list. If the number of samples read are fewer than the current length of the list, the list will be trimmed to fit the samples read. If list is null, a new list will be allocated and its size may be zero or unbounded depending upon the number of samples read. If there are no samples, the list reference will be non-null and the list will contain zero samples.

The read operation will copy the data and meta-information into the elements already inside the given collection, overwriting any samples that might already be present. The use of this variant forces a copy but the application can control where the copy is placed and the application will not need to "return the loan."

Parameters
samplesA pre allocated collection to store the samples in
selectorA selector to be used on the read
Returns
samples, for convenience.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
read()
#read(Selector)
#read(List)
#readNextSample(Sample)
#take(List, Selector)

◆ readNextSample()

boolean org.omg.dds.sub.DataReader< TYPE >.readNextSample ( Sample< TYPE >  sample)
inherited

This operation copies the next, non-previously accessed sample from this DataReader.

The implied order among the samples stored in the DataReader is the same as for read(List, Selector).

This operation is semantically equivalent to read(List, Selector) where Selector#getMaxSamples() is 1, Selector#getDataState() followed by Subscriber.DataState#getSampleStates() == org.omg.dds.sub.SampleState#NOT_READ, Selector#getDataState() followed by Subscriber.DataState#getViewStates() contains all view states, and Selector#getDataState() followed by Subscriber.DataState#getInstanceStates() contains all instance states.

This operation provides a simplified API to "read" samples avoiding the need for the application to manage iterators and specify queries.

If there is no unread data in the DataReader, the operation will return false and the provided sample is not modified.

Returns
true if data was read or false if no data was available.
Parameters
sampleA valid sample that will contain the new data.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
read()
#read(Selector)
#read(List)
#read(List, Selector)
#takeNextSample(Sample)

Implemented in org.opensplice.dds.sub.DataReaderImpl< TYPE >.

◆ retain()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.retain ( )
inherited

Indicates that references to this object may go out of scope but that the application expects to look it up again later.

Therefore, the Service must consider this object to be still in use and may not close it automatically.

◆ select()

Selector<TYPE> org.omg.dds.sub.DataReader< TYPE >.select ( )
inherited

Provides a Selector that can be used to refine what read or take methods return.

Returns
The Selector object returned by this method is the default selector. By default it selects org.omg.dds.core.policy.ResourceLimits#LENGTH_UNLIMITED samples. This is equivalent to calling org.omg.dds.sub.DataReader#read without any parameters.

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ setListener() [1/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on all communication statuses pertaining to the concrete type of this entity.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

Parameters
listenerthe listener to attach.
See also
getListener()
#setListener(EventListener, Collection)

◆ setListener() [2/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener,
Collection< Class<? extends Status >>  statuses 
)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on the changes of communication status indicated by the specified mask.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

See also
getListener()
#setListener(EventListener)

◆ setListener() [3/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener,
Class<? extends Status >...  statuses 
)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on the changes of communication status indicated by the specified mask.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

See also
getListener()
#setListener(EventListener)

◆ setQos()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setQos ( QOS  qos)
inherited

This operation is used to set the QoS policies of the Entity.

This operation must be provided by each of the derived Entity classes (org.omg.dds.domain.DomainParticipant, org.omg.dds.topic.Topic, org.omg.dds.pub.Publisher, org.omg.dds.pub.DataWriter, org.omg.dds.sub.Subscriber, org.omg.dds.sub.DataReader) so that the policies that are meaningful to each Entity can be set.

The set of policies specified as the parameter are applied on top of the existing QoS, replacing the values of any policies previously set.

Certain policies are "immutable"; they can only be set at Entity creation time, or before the entity is made enabled. If setQos is invoked after the Entity is enabled and it attempts to change the value of an "immutable" policy, the operation will fail with org.omg.dds.core.ImmutablePolicyException.

Certain values of QoS policies can be incompatible with the settings of the other policies. The setQos operation will also fail if it specifies a set of values that once combined with the existing values would result in an inconsistent set of policies. In this case, it shall fail with org.omg.dds.core.InconsistentPolicyException.

If the application supplies a non-default value for a QoS policy that is not supported by the implementation of the service, the setQos operation will fail with UnsupportedOperationException.

The existing set of policies are only changed if the setQos operation succeeds. In all other cases, none of the policies is modified.

Exceptions
ImmutablePolicyExceptionif an immutable policy changes its value.
InconsistentPolicyExceptionif a combination of policies is inconsistent with one another.
UnsupportedOperationExceptionif an unsupported policy has a non-default value.
See also
getQos()

◆ take() [1/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.take ( )
inherited

This operation accesses a collection of samples from this DataReader.

The behavior is identical to read except for that the samples are removed from the DataReader.

Invalid Data
Some elements in the returned sequence may not have valid data: the valid_data field in the SampleInfo indicates whether the corresponding data value contains any meaningful data. If not, the data value is just a 'dummy' sample for which only the keyfields have been assigned. It is used to accompany the SampleInfo that communicates a change in the instanceState of an instance for which there is no 'real' sample available.

For example, when an application always 'takes' all available samples of a particular instance, there is no sample available to report the disposal of that instance. In such a case the DataReader will insert a dummy sample into the data values sequence to accompany the SampleInfo element that communicates the disposal of the instance.

Example:


// Take samples
Iterator<Sample<Foo>> samples = fooDr.take();
// Process each Sample and print its name and production time.
while (samples.hasNext()) {
    Sample sample = samples.next();
    Foo foo = sample.getData();
    if (foo != null) { //Check if the sample is valid.
         Time t = sample.getSourceTimestamp(); // meta information
         System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
    }
}

Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
#take(Selector)
#take(List)
#take(List, Selector)
#takeNextSample(Sample)
read()

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ take() [2/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.take ( int  maxSamples)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like take(Selector) except that the collection of returned samples is not constrained by any Selector.

The number of samples accessible via the iterator will not be more than #maxSamples.

Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
#take(Selector)
#take(List)
#take(List, Selector)
#takeNextSample(Sample)
read()

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ take() [3/5]

Sample.Iterator<TYPE> org.omg.dds.sub.DataReader< TYPE >.take ( Selector< TYPE >  query)
inherited

This operation accesses a collection of samples from this DataReader.

The number of samples returned is controlled by the org.omg.dds.core.policy.Presentation and other factors using the same logic as for read(Selector).

The act of taking a sample removes it from the DataReader so it cannot be "read" or "taken" again. If the sample belongs to the most recent generation of the instance, it will also set the view state of the instance to org.omg.dds.sub.ViewState#NOT_NEW. It will not affect the instance state of the instance.

The behavior of the take operation follows the same rules than the read operation regarding the preconditions and postconditions for the arguments and return results. Similar to read, the take operation will "loan" elements to the application; this loan must then be returned by means of Sample.Iterator#close(). The only difference with read is that, as stated, the sample returned by take will no longer be accessible to successive calls to read or take.

If the DataReader has no samples that meet the constraints, the return value will be a non-null iterator that provides no samples.

Example:


// create a dataState that only reads not read, new and alive samples
DataState ds = subscriber.createDataState();
ds = ds.with(SampleState.NOT_READ)
       .with(ViewState.NEW)
       .with(InstanceState.ALIVE);
// Take samples through an selector with the set dataState
Selector<Foo> query = fooDr.select();
query.dataState(ds);
Iterator<Sample<Foo>> samples = fooDr.take(query);
// Process each Sample and print its name and production time.
while (samples.hasNext()) {
    Sample sample = samples.next();
    Foo foo = sample.getData();
    if (foo != null) { //Check if the sample is valid.
         Time t = sample.getSourceTimestamp(); // meta information
         System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
    }
}

Parameters
querya selector to be used on the read
Returns
a non-null unmodifiable iterator over loaned samples.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
take()
#take(List)
#take(List, Selector)
#takeNextSample(Sample)
#read(Selector)

◆ take() [4/5]

List<Sample<TYPE> > org.omg.dds.sub.DataReader< TYPE >.take ( List< Sample< TYPE >>  samples)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like take() except that the returned samples are not "on loan" from the Service; they are deeply copied to the application.

The take operation will copy the data and meta-information into the elements already inside the given collection, overwriting any samples that might already be present. The use of this variant forces a copy but the application can control where the copy is placed and the application will not need to "return the loan."


// Take samples and store them in a pre allocated collection
List<Sample<Foo>> samples = new ArrayList<Sample<Foo>>();
fooDr.take(samples);
// Process each Sample and print its name and production time.
for (Sample<Foo> sample : samples) {
    Foo foo = sample.getData();
    if (foo != null) { //Check if the sample is valid.
         Time t = sample.getSourceTimestamp();
         System.out.println("Name: " + foo.myName + " is produced at " + time.getTime(TimeUnit.SECONDS));
    }
}

Parameters
samplesA pre allocated collection to store the samples in
Returns
samples, for convenience.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
take()
#take(Selector)
#take(List, Selector)
#takeNextSample(Sample)
#read(List)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ take() [5/5]

List<Sample<TYPE> > org.omg.dds.sub.DataReader< TYPE >.take ( List< Sample< TYPE >>  samples,
Selector< TYPE >  query 
)
inherited

This operation accesses a collection of samples from this DataReader.

It behaves exactly like take(Selector) except that the returned samples are not "on loan" from the Service; they are deeply copied to the application.

The take operation will copy the data and meta-information into the elements already inside the given collection, overwriting any samples that might already be present. The use of this variant forces a copy but the application can control where the copy is placed and the application will not need to "return the loan."

Parameters
samplesA pre allocated collection to store the samples in
queryA selector to be used on the take
Returns
samples, for convenience.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
take()
#take(Selector)
#take(List)
#takeNextSample(Sample)
#read(List, Selector)

◆ takeNextSample()

boolean org.omg.dds.sub.DataReader< TYPE >.takeNextSample ( Sample< TYPE >  sample)
inherited

This operation copies the next, non-previously accessed sample from this DataReader and "removes" it from the DataReader so it is no longer accessible.

This operation is analogous to readNextSample(Sample) except for the fact that the sample is "removed" from the DataReader.

This operation is semantically equivalent to take(List, Selector) where Selector#getMaxSamples() is 1, Selector#getDataState() followed by Subscriber.DataState#getSampleStates() == org.omg.dds.sub.SampleState#NOT_READ, Selector#getDataState() followed by Subscriber.DataState#getViewStates() contains all view states, and Selector#getDataState() followed by Subscriber.DataState#getInstanceStates() contains all instance states.

This operation provides a simplified API to "take" samples avoiding the need for the application to manage iterators and specify queries.

If there is no unread data in the DataReader, the operation will return false and the provided sample is not modified.

Returns
true if data was taken or false if no data was available.
Parameters
sampleA valid sample that will contain the new data.
Exceptions
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
See also
take()
#take(Selector)
#take(List)
#take(List, Selector)
#readNextSample(Sample)

Implemented in org.opensplice.dds.sub.DataReaderImpl< TYPE >.

◆ waitForHistoricalData() [1/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
Time  minSourceTimestamp,
Time  maxSourceTimestamp,
ResourceLimits  resourceLimits,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [2/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
Time  minSourceTimestamp,
Time  maxSourceTimestamp,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [3/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
ResourceLimits  resourceLimits,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [4/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [5/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( Time  minSourceTimestamp,
Time  maxSourceTimestamp,
ResourceLimits  resourceLimits,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [6/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( Time  minSourceTimestamp,
Time  maxSourceTimestamp,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [7/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( ResourceLimits  resourceLimits,
Duration  maxWait 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [8/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
Time  minSourceTimestamp,
Time  maxSourceTimestamp,
ResourceLimits  resourceLimits,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [9/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
Time  minSourceTimestamp,
Time  maxSourceTimestamp,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [10/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
ResourceLimits  resourceLimits,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [11/16]

void org.omg.dds.sub.DataReader< TYPE >.waitForHistoricalData ( Duration  maxWait) throws TimeoutException
inherited

This operation is intended only for DataReader entities for which org.omg.dds.core.policy.Durability#getKind() is not org.omg.dds.core.policy.Durability.Kind#VOLATILE.

As soon as an application enables a non-VOLATILE DataReader it will start receiving both "historical" data, i.e., the data that was written prior to the time the DataReader joined the domain, as well as any new data written by the DataWriter entities. There are situations where the application logic may require the application to wait until all "historical" data is received. This is the purpose of this operation.

The operation blocks the calling thread until either all "historical" data is received, or else the duration specified by the maxWait parameter elapses, whichever happens first.

Parameters
maxWaitthe maximum duration to block for the waitForHistoricalData, after which the application thread is unblocked.
Exceptions
TimeoutExceptionif maxWait elapsed before all the data was received.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.
See also
waitForHistoricalData(long, TimeUnit)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ waitForHistoricalData() [12/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( String  filterExpression,
List< String >  filterParameters,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
filterExpressionthe SQL expression (subset of SQL), which defines the filtering criteria (null when no SQL filtering is needed).
filterParameterssequence of strings with the parameter values used in the SQL expression (i.e., the number of n tokens in the expression). The number of values in filterParameters must be equal to or greater than the highest referenced n token in the filterExpression (e.g. if %1 and %8 are used as parameters in the filterExpression, the filterParameters should contain at least n + 1 = 9 values).
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [13/16]

void org.omg.dds.sub.DataReader< TYPE >.waitForHistoricalData ( long  maxWait,
TimeUnit  unit 
) throws TimeoutException
inherited

This operation is intended only for DataReader entities for which org.omg.dds.core.policy.Durability#getKind() is not org.omg.dds.core.policy.Durability.Kind#VOLATILE.

As soon as an application enables a non-VOLATILE DataReader it will start receiving both "historical" data, i.e., the data that was written prior to the time the DataReader joined the domain, as well as any new data written by the DataWriter entities. There are situations where the application logic may require the application to wait until all "historical" data is received. This is the purpose of this operation.

The operation blocks the calling thread until either all "historical" data is received, or else the duration specified by the maxWait parameter elapses, whichever happens first.

Parameters
maxWaitThe maximum duration to block for the waitForHistoricalData, after which the application thread is unblocked.
unitThe TimeUnit which the sourceTimestamp describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionif maxWait elapsed before all the data was received.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.
See also
waitForHistoricalData(Duration)

Implemented in org.opensplice.dds.sub.AbstractDataReader< TYPE >.

◆ waitForHistoricalData() [14/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( Time  minSourceTimestamp,
Time  maxSourceTimestamp,
ResourceLimits  resourceLimits,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [15/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( Time  minSourceTimestamp,
Time  maxSourceTimestamp,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
minSourceTimestampFilter out all data published before this time. The special org.omg.dds.core.Time.invalidTime() can be used when no minimum filter is needed.
maxSourceTimestampFilter out all data published after this time. The special org.omg.dds.core.Time.invalidTime() can be used when no maximum filter is needed
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

◆ waitForHistoricalData() [16/16]

void org.opensplice.dds.sub.DataReader< TYPE >.waitForHistoricalData ( ResourceLimits  resourceLimits,
long  maxWait,
TimeUnit  unit 
) throws TimeoutException

This operation will block the application thread until all historical data that matches the supplied conditions is received.

This operation only makes sense when the receiving node has configured its durability service as an On_Request alignee. (See also the description of the //OpenSplice/DurabilityService/NameSpaces/Policy[] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to org.omg.dds.core.policy.Durability.Kind#VOLATILE to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

Parameters
resourceLimitsSpecifies limits on the maximum amount of historical data that may be received.
maxWaitThe maximum duration the application thread is blocked during this operation.
unitThe TimeUnit which the maxWait describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS)
Exceptions
TimeoutExceptionthrown when maxWait has expired before the applicable historical data has successfully been obtained.
org.omg.dds.core.DDSExceptionAn internal error has occurred.
org.omg.dds.core.AlreadyClosedExceptionThe corresponding DataReader has been closed.
org.omg.dds.core.OutOfResourcesExceptionThe Data Distribution Service ran out of resources to complete this operation.
org.omg.dds.core.PreconditionNotMetExceptionCan happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete.

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