21 package org.opensplice.dds.sub;
23 import java.lang.reflect.Field;
24 import java.util.ArrayList;
25 import java.util.Arrays;
26 import java.util.Collection;
27 import java.util.HashMap;
28 import java.util.HashSet;
29 import java.util.List;
31 import java.util.concurrent.TimeUnit;
32 import java.util.concurrent.TimeoutException;
69 DomainEntityImpl<DDS.DataReader, SubscriberImpl, DDS.Subscriber, DataReaderQos, DataReaderListener<TYPE>, DataReaderListenerImpl<TYPE>>
74 protected final HashSet<AbstractIterator<TYPE>>
iterators;
80 super(environment, parent, parent.
getOld());
84 this.iterators =
new HashSet<AbstractIterator<TYPE>>();
90 this.iterators.add(iterator);
96 this.iterators.remove(iterator);
110 }
catch (ClassCastException e) {
112 "Non-OpenSplice DataState not supported.");
114 this.conditions.put(condition.
getOld(), condition);
121 List<String> queryParameters) {
124 queryExpression, queryParameters);
129 String queryExpression, List<String> queryParameters) {
138 this.conditions.put(query.
getOld(), query);
140 }
catch (ClassCastException e) {
142 "Non-OpenSplice DataState not supported.");
150 String... queryParameters) {
152 Arrays.asList(queryParameters));
157 String queryExpression, String... queryParameters) {
160 if (queryParameters == null) {
162 new ArrayList<String>());
165 Arrays.asList(queryParameters));
172 DDS.ReadCondition old = condition.
getOld();
173 int rc = this.
getOld().delete_readcondition(old);
174 this.conditions.remove(old);
176 "Condition already closed.");
181 @SuppressWarnings(
"unchecked")
191 this.
getOld().delete_readcondition(condition.getOld());
194 HashSet<AbstractIterator<TYPE>> clones;
197 clones = (HashSet<AbstractIterator<TYPE>>) this.iterators.clone();
211 this.
parent.destroyDataReader(
this);
223 if (listener != null) {
227 wrapperListener = null;
229 rc = this.
getOld().set_listener(wrapperListener, mask);
231 "DataReader.setListener() failed.");
233 this.listener = wrapperListener;
243 Collection<Class<? extends Status>> statuses) {
244 this.setListener(listener,
250 Class<? extends Status>... statuses) {
251 this.setListener(listener,
262 int rc = this.
getOld().set_property(
new DDS.Property(key, value));
264 "DataReader.setProperty() failed.");
269 DDS.PropertyHolder holder =
new DDS.PropertyHolder();
270 int rc = this.
getOld().get_property(holder);
272 "DataReader.getProperty() failed.");
274 return holder.value.value;
277 @SuppressWarnings(
"unchecked")
283 }
catch (ClassCastException cce) {
285 "Unable to perform requested cast.");
337 throws TimeoutException {
343 List<String> filterParameters,
Time minSourceTimestamp,
345 Duration maxWait)
throws TimeoutException {
347 filterParameters, minSourceTimestamp, maxSourceTimestamp,
348 resourceLimits, maxWait);
353 List<String> filterParameters,
Time minSourceTimestamp,
354 Time maxSourceTimestamp,
Duration maxWait)
throws TimeoutException {
356 filterParameters, minSourceTimestamp, maxSourceTimestamp,
363 Duration maxWait)
throws TimeoutException {
371 List<String> filterParameters,
Duration maxWait)
372 throws TimeoutException {
382 Duration maxWait)
throws TimeoutException {
384 .waitForHistoricalData(null, null, minSourceTimestamp,
385 maxSourceTimestamp, resourceLimits, maxWait);
391 Time maxSourceTimestamp,
Duration maxWait)
throws TimeoutException {
393 minSourceTimestamp, maxSourceTimestamp,
400 Duration maxWait)
throws TimeoutException {
409 List<String> filterParameters,
Time minSourceTimestamp,
411 long maxWait, TimeUnit unit)
throws TimeoutException {
413 filterParameters, minSourceTimestamp, maxSourceTimestamp,
414 resourceLimits, maxWait, unit);
419 List<String> filterParameters,
Time minSourceTimestamp,
420 Time maxSourceTimestamp,
long maxWait, TimeUnit unit)
421 throws TimeoutException {
423 filterParameters, minSourceTimestamp, maxSourceTimestamp,
430 long maxWait, TimeUnit unit)
throws TimeoutException {
439 List<String> filterParameters,
long maxWait, TimeUnit unit)
440 throws TimeoutException {
450 long maxWait, TimeUnit unit)
throws TimeoutException {
452 minSourceTimestamp, maxSourceTimestamp, resourceLimits,
458 Time maxSourceTimestamp,
long maxWait, TimeUnit unit)
459 throws TimeoutException {
461 minSourceTimestamp, maxSourceTimestamp,
467 long maxWait, TimeUnit unit)
throws TimeoutException {
483 .getMatchedPublicationData(publicationHandle);
492 DDS.SampleInfoSeqHolder infoSeqHolder) {
550 DDS.StatusCondition oldCondition = this.
getOld().get_statuscondition();
552 if (oldCondition == null) {
560 List<
Sample<TYPE>> samples, Class<?> sampleSeqHolderClz,
561 Field sampleSeqHolderValueField);
564 Object sampleSeqHolder,
565 Field sampleSeqHolderValueField, DDS.SampleInfoSeqHolder info);
void setListener(DataReaderListener< TYPE > listener)
Since a org.omg.dds.sub.DataReader is a kind of org.omg.dds.core.Entity, it has the ability to have a...
A sample has been lost (never received).
void setProperty(String key, String value)
A DataReader allows the application (1) to declare the data it wishes to receive (i.e., make a subscription) and (2) to access the data received by the attached org.omg.dds.sub.Subscriber.
Iterator< TYPE > take(int maxSamples)
This operation accesses a collection of samples from this DataReader.
void waitForHistoricalData(String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit)
void waitForHistoricalData(long maxWait, TimeUnit unit)
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.
A Subscriber is the object responsible for the actual reception of the data resulting from its subscr...
void waitForHistoricalData(String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, long maxWait, TimeUnit unit)
RequestedDeadlineMissedStatus getRequestedDeadlineMissedStatus()
This operation obtains the RequestedDeadlineMissedStatus object of the DataReader.
A Sample represents an atom of data information (i.e., one value for one instance) as returned by a o...
A StatusCondition object is an immutable object that specifies Condition that is associated with each...
void waitForHistoricalData(String filterExpression, List< String > filterParameters, Duration maxWait)
void waitForHistoricalData(String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait)
SubscriptionMatchedStatus getSubscriptionMatchedStatus()
This operation obtains the SubscriptionMatchedStatus object of the DataReader.
String getProperty(String key)
Iterator< TYPE > read(int maxSamples)
This operation accesses a collection of samples from this DataReader.
void waitForHistoricalData(String filterExpression, List< String > filterParameters, long maxWait, TimeUnit unit)
void waitForHistoricalData(String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, Duration maxWait)
void waitForHistoricalData(ResourceLimits resourceLimits, long maxWait, TimeUnit unit)
List< Sample< TYPE > > read(List< Sample< TYPE >> samples, org.omg.dds.sub.DataReader.Selector< TYPE > selector)
void deregisterIterator(AbstractIterator< TYPE > iterator)
void waitForHistoricalData(Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait)
void waitForHistoricalData(Duration maxWait)
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.
final HashSet< AbstractIterator< TYPE > > iterators
A DataState encapsulates sets of sample states, view states, and instance states as a convenience...
SubscriberImpl getParent()
List< Sample< TYPE > > take(List< Sample< TYPE >> samples, org.omg.dds.sub.DataReader.Selector< TYPE > selector)
void waitForHistoricalData(String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait)
void setListener(DataReaderListener< TYPE > listener, Class<? extends Status >... statuses)
AbstractDataReader(OsplServiceEnvironment environment, SubscriberImpl parent, TopicDescriptionExt< TYPE > topicDescription)
QueryCondition< TYPE > createQueryCondition(DataState states, String queryExpression, String... queryParameters)
This operation creates a QueryCondition.
static Set< Class<? extends Status > > convertMask(OsplServiceEnvironment environment, int state)
List< Sample< TYPE > > read(List< Sample< TYPE >> samples)
This operation accesses a collection of samples from this DataReader.
void waitForHistoricalData(Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit)
void waitForHistoricalData(Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait)
void waitForHistoricalData(String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit)
SampleRejectedStatus getSampleRejectedStatus()
This operation obtains the SampleRejectedStatus object of the DataReader.
RequestedIncompatibleQosStatus getRequestedIncompatibleQosStatus()
This operation obtains the RequestedIncompatibleQosStatus object of the DataReader.
QueryCondition< TYPE > createQueryCondition(String queryExpression, List< String > queryParameters)
This operation creates a QueryCondition.
PublicationBuiltinTopicData getMatchedPublicationData(InstanceHandle publicationHandle)
This operation retrieves information on a publication that is currently "associated" with the DataRea...
abstract Sample.Iterator<?> createIterator(Object sampleSeqHolder, Field sampleSeqHolderValueField, DDS.SampleInfoSeqHolder info)
abstract ReflectionDataReader<?, TYPE > getReflectionReader()
void returnLoan(Object sampleSeqHolder, DDS.SampleInfoSeqHolder infoSeqHolder)
void registerIterator(AbstractIterator< TYPE > iterator)
An opaque handle that can be used to refer to a local or remote entity.
static void checkReturnCode(int retCode, OsplServiceEnvironment environment, String message)
A org.omg.dds.core.policy.QosPolicy value was incompatible with what is offered.
Iterator< TYPE > read(org.omg.dds.sub.DataReader.Selector< TYPE > query)
final TopicDescriptionExt< TYPE > topicDescription
ReadCondition< TYPE > createReadCondition(DataState states)
This operation creates a ReadCondition.
ReadCondition objects are conditions specifically dedicated to read operations and attached to one or...
This class contains the statistics about the discovered number of org.omg.dds.pub.DataWriters that are compatible with the org.omg.dds.sub.DataReader to which the Status is attached.
Iterator< TYPE > take()
This operation accesses a collection of samples from this DataReader.
void waitForHistoricalData(ResourceLimits resourceLimits, Duration maxWait)
The target object was previously closed and therefore cannot process the operation.
final Selector< TYPE > selector
void setListener(DataReaderListener< TYPE > listener, Collection< Class<? extends Status >> statuses)
TopicDescription< TYPE > getTopicDescription()
QueryCondition< TYPE > createQueryCondition(DataState states, String queryExpression, List< String > queryParameters)
This operation creates a QueryCondition.
void destroyReadCondition(ReadConditionImpl< TYPE > condition)
final HashMap< DDS.Condition, ReadConditionImpl< TYPE > > conditions
List< Sample< TYPE > > take(List< Sample< TYPE >> samples)
This operation accesses a collection of samples from this DataReader.
static Time invalidTime(ServiceEnvironment env)
static DataStateImpl getAnyStateDataState(OsplServiceEnvironment env)
The DCPSPublication topic communicates the existence of datawriters by means of the PublicationBuilti...
The liveliness of one or more org.omg.dds.pub.DataWriters that were writing instances read through th...
StatusCondition< DataReader< TYPE > > getStatusCondition()
A span of elapsed time expressed with nanosecond precision.
void closeContainedEntities()
This operation closes all the entities that were created by means of the "create" operations on the D...
final transient OsplServiceEnvironment environment
LivelinessChangedStatus getLivelinessChangedStatus()
This operation obtains the LivelinessChangedStatus object of the DataReader.
A (received) sample has been rejected.
org.omg.dds.sub.DataReader.Selector< TYPE > select()
Provides a Selector that can be used to refine what read or take methods return.
Specifies the resources that the Service can consume in order to meet the requested QoS...
void setQos(DataReaderQos qos)
static void throwLastErrorException(OsplServiceEnvironment environment)
This interface is the base for org.omg.dds.topic.Topic, org.omg.dds.topic.ContentFilteredTopic, and org.omg.dds.topic.MultiTopic.
Selector class encapsulates different ways of selecting samples from a org.omg.dds.sub.DataReader.
The deadline that the org.omg.dds.sub.DataReader was expecting through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.
Set< InstanceHandle > getMatchedPublications()
This operation retrieves the list of publications currently "associated" with the DataReader; that is...
DDS.ReadCondition getOld()
QueryCondition< TYPE > createQueryCondition(String queryExpression, String... queryParameters)
This operation creates a QueryCondition.
SampleLostStatus getSampleLostStatus()
This operation obtains the SampleLostStatus object of the DataReader.
Iterator< TYPE > read()
This operation accesses a collection of samples from this DataReader.
void waitForHistoricalData(Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit)
A moment in time expressed with nanosecond precision (though not necessarily nanosecond accuracy)...
QueryCondition objects are specialized org.omg.dds.sub.ReadCondition objects that allow the applicati...
Status is the abstract root class for all communication status objects.
Iterator< TYPE > take(org.omg.dds.sub.DataReader.Selector< TYPE > query)
abstract PreAllocator< TYPE > getPreAllocator(List< Sample< TYPE >> samples, Class<?> sampleSeqHolderClz, Field sampleSeqHolderValueField)