![]() |
OpenSplice Java 5 DCPS
v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
Public Member Functions | |
DataReaderProtobuf (OsplServiceEnvironment environment, SubscriberImpl parent, TopicDescriptionExt< PROTOBUF_TYPE > topicDescription, DataReaderQos qos, DataReaderListener< PROTOBUF_TYPE > listener, Collection< Class<? extends Status >> statuses) | |
void | closeContainedEntities () |
This operation closes all the entities that were created by means of the "create" operations on the DataReader. More... | |
Iterator< PROTOBUF_TYPE > | createIterator (Object sampleSeqHolder, Field sampleSeqHolderValueField, SampleInfoSeqHolder info) |
abstract Sample.Iterator<?> | createIterator (Object sampleSeqHolder, Field sampleSeqHolderValueField, DDS.SampleInfoSeqHolder info) |
QueryCondition< TYPE > | createQueryCondition (String queryExpression, List< String > queryParameters) |
This operation creates a QueryCondition. More... | |
QueryCondition< TYPE > | createQueryCondition (DataState states, 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 (DataState states, String queryExpression, String... queryParameters) |
This operation creates a QueryCondition. More... | |
ReadCondition< TYPE > | createReadCondition (DataState states) |
This operation creates a ReadCondition. More... | |
void | deregisterIterator (AbstractIterator< TYPE > iterator) |
void | destroyReadCondition (ReadConditionImpl< TYPE > condition) |
PROTOBUF_TYPE | getKeyValue (PROTOBUF_TYPE keyHolder, InstanceHandle handle) |
PROTOBUF_TYPE | getKeyValue (InstanceHandle handle) |
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< InstanceHandle > | getMatchedPublications () |
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... | |
SubscriberImpl | getParent () |
PreAllocator< PROTOBUF_TYPE > | getPreAllocator (List< Sample< PROTOBUF_TYPE >> samples, Class<?> sampleSeqHolderClz, Field sampleSeqHolderValueField) |
abstract PreAllocator< TYPE > | getPreAllocator (List< Sample< TYPE >> samples, Class<?> sampleSeqHolderClz, Field sampleSeqHolderValueField) |
String | getProperty (String key) |
DataReaderQos | getQos () |
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... | |
StatusCondition< DataReader< TYPE > > | getStatusCondition () |
SubscriptionMatchedStatus | getSubscriptionMatchedStatus () |
This operation obtains the SubscriptionMatchedStatus object of the DataReader. More... | |
TopicDescription< TYPE > | getTopicDescription () |
InstanceHandle | lookupInstance (PROTOBUF_TYPE keyHolder) |
Iterator< TYPE > | read () |
This operation accesses a collection of samples from this DataReader. More... | |
Iterator< TYPE > | read (org.omg.dds.sub.DataReader.Selector< TYPE > query) |
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, org.omg.dds.sub.DataReader.Selector< TYPE > selector) |
boolean | readNextSample (Sample< PROTOBUF_TYPE > sample) |
void | registerIterator (AbstractIterator< TYPE > iterator) |
void | returnLoan (Object sampleSeqHolder, DDS.SampleInfoSeqHolder infoSeqHolder) |
org.omg.dds.sub.DataReader.Selector< TYPE > | select () |
Provides a Selector that can be used to refine what read or take methods return. More... | |
void | setListener (DataReaderListener< TYPE > listener) |
void | setListener (DataReaderListener< TYPE > listener, Collection< Class<? extends Status >> statuses) |
void | setListener (DataReaderListener< TYPE > listener, Class<? extends Status >... statuses) |
void | setProperty (String key, String value) |
void | setQos (DataReaderQos qos) |
Iterator< TYPE > | take () |
This operation accesses a collection of samples from this DataReader. More... | |
Iterator< TYPE > | take (int maxSamples) |
This operation accesses a collection of samples from this DataReader. More... | |
Iterator< TYPE > | take (org.omg.dds.sub.DataReader.Selector< TYPE > query) |
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, org.omg.dds.sub.DataReader.Selector< TYPE > selector) |
boolean | takeNextSample (Sample< PROTOBUF_TYPE > sample) |
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 (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 (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (ResourceLimits resourceLimits, Duration maxWait) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (String filterExpression, List< String > filterParameters, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (Time minSourceTimestamp, Time maxSourceTimestamp, long maxWait, TimeUnit unit) throws TimeoutException |
void | waitForHistoricalData (ResourceLimits resourceLimits, long maxWait, TimeUnit unit) throws TimeoutException |
Protected Member Functions | |
void | destroy () |
ReflectionDataReader<?, PROTOBUF_TYPE > | getReflectionReader () |
Protected Attributes | |
final HashMap< DDS.Condition, ReadConditionImpl< TYPE > > | conditions |
final HashSet< AbstractIterator< TYPE > > | iterators |
final Selector< TYPE > | selector |
final TopicDescriptionExt< TYPE > | topicDescription |
Definition at line 43 of file DataReaderProtobuf.java.
org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.DataReaderProtobuf | ( | OsplServiceEnvironment | environment, |
SubscriberImpl | parent, | ||
TopicDescriptionExt< PROTOBUF_TYPE > | topicDescription, | ||
DataReaderQos | qos, | ||
DataReaderListener< PROTOBUF_TYPE > | listener, | ||
Collection< Class<? extends Status >> | statuses | ||
) |
Definition at line 50 of file DataReaderProtobuf.java.
|
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.
org.omg.dds.core.PreconditionNotMetException | if the any of the contained entities is in a state where it cannot be closed. |
Definition at line 183 of file AbstractDataReader.java.
Iterator<PROTOBUF_TYPE> org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.createIterator | ( | Object | sampleSeqHolder, |
Field | sampleSeqHolderValueField, | ||
SampleInfoSeqHolder | info | ||
) |
Definition at line 214 of file DataReaderProtobuf.java.
|
abstractinherited |
|
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.
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 > %0 AND name = %1");
List<String> params = new ArrayList<String>();
params.add("0");
params.add("BILL");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(expr,params);
queryExpression | The returned condition will only trigger on samples that pass this content-based filter expression. |
queryParameters | A set of parameter values for the queryExpression. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 120 of file AbstractDataReader.java.
|
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.
State Masks
The result of the QueryCondition also depends on the selection of samples determined by three org.omg.dds.sub.Subscriber.DataState masks:
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 > %0 AND name = %1");
List<String> params = new ArrayList<String>();
params.add("0");
params.add("BILL");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(ds,expr,params);
states | The returned condition will only trigger on samples with one of these sample states, view states, and instance states. |
queryExpression | The returned condition will only trigger on samples that pass this content-based filter expression. |
queryParameters | A set of parameter values for the queryExpression. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 128 of file AbstractDataReader.java.
|
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.
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 > %0 AND name = %1");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(expr,"0","BILL");
queryExpression | The returned condition will only trigger on samples that pass this content-based filter expression. |
queryParameters | A set of parameter values for the queryExpression. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 149 of file AbstractDataReader.java.
|
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.
State Masks
The result of the QueryCondition also depends on the selection of samples determined by three org.omg.dds.sub.Subscriber.DataState masks:
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 > %0 AND name = %1");
QueryCondition<Foo> queryCond = fooDr.createQueryCondition(ds,expr,"0","BILL");
states | The returned condition will only trigger on samples with one of these sample states, view states, and instance states. |
queryExpression | The returned condition will only trigger on samples that pass this content-based filter expression. |
queryParameters | A set of parameter values for the queryExpression. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 156 of file AbstractDataReader.java.
|
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:
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);
states | The returned condition will only trigger on samples with one of these sample states, view states, and instance states. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 103 of file AbstractDataReader.java.
|
inherited |
Definition at line 94 of file AbstractDataReader.java.
|
protected |
Definition at line 101 of file DataReaderProtobuf.java.
|
inherited |
Definition at line 170 of file AbstractDataReader.java.
PROTOBUF_TYPE org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.getKeyValue | ( | PROTOBUF_TYPE | keyHolder, |
InstanceHandle | handle | ||
) |
Definition at line 136 of file DataReaderProtobuf.java.
PROTOBUF_TYPE org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.getKeyValue | ( | InstanceHandle | handle | ) |
Definition at line 142 of file DataReaderProtobuf.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 306 of file AbstractDataReader.java.
|
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.
publicationHandle | a handle to the publication, the data of which is to be retrieved. |
IllegalArgumentException | if the publicationHandle does not correspond to a publication currently associated with the DataReader. |
UnsupportedOperationException | if the infrastructure does not hold the information necessary to fill in the publicationData. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
UnsupportedOperationException | if the infrastructure does not hold the information necessary to fill in the publicationnData. |
Definition at line 480 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
UnsupportedOperationException | if the infrastructure does not hold the information necessary to fill in the publicationnData. |
Definition at line 475 of file AbstractDataReader.java.
|
inherited |
Definition at line 215 of file AbstractDataReader.java.
PreAllocator<PROTOBUF_TYPE> org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.getPreAllocator | ( | List< Sample< PROTOBUF_TYPE >> | samples, |
Class<?> | sampleSeqHolderClz, | ||
Field | sampleSeqHolderValueField | ||
) |
Definition at line 107 of file DataReaderProtobuf.java.
|
abstractinherited |
|
inherited |
Definition at line 268 of file AbstractDataReader.java.
|
inherited |
Definition at line 291 of file AbstractDataReader.java.
|
protected |
Definition at line 131 of file DataReaderProtobuf.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 311 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 316 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 326 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 301 of file AbstractDataReader.java.
|
inherited |
Definition at line 549 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 321 of file AbstractDataReader.java.
|
inherited |
Definition at line 256 of file AbstractDataReader.java.
InstanceHandle org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.lookupInstance | ( | PROTOBUF_TYPE | keyHolder | ) |
Definition at line 152 of file DataReaderProtobuf.java.
|
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));
}
}
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 497 of file AbstractDataReader.java.
|
inherited |
Definition at line 502 of file AbstractDataReader.java.
|
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.
maxSamples | The maximum number of samples to read |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 507 of file AbstractDataReader.java.
|
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));
}
}
samples | A pre allocated collection to store the samples in |
samples
, for convenience. org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 512 of file AbstractDataReader.java.
|
inherited |
Definition at line 517 of file AbstractDataReader.java.
boolean org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.readNextSample | ( | Sample< PROTOBUF_TYPE > | sample | ) |
Definition at line 158 of file DataReaderProtobuf.java.
|
inherited |
Definition at line 88 of file AbstractDataReader.java.
|
inherited |
Definition at line 491 of file AbstractDataReader.java.
|
inherited |
Provides a Selector that can be used to refine what read or take methods return.
Definition at line 487 of file AbstractDataReader.java.
|
inherited |
Definition at line 237 of file AbstractDataReader.java.
|
inherited |
Definition at line 242 of file AbstractDataReader.java.
|
inherited |
Definition at line 249 of file AbstractDataReader.java.
|
inherited |
Definition at line 261 of file AbstractDataReader.java.
|
inherited |
Definition at line 296 of file AbstractDataReader.java.
|
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));
}
}
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 523 of file AbstractDataReader.java.
|
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.
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 528 of file AbstractDataReader.java.
|
inherited |
Definition at line 533 of file AbstractDataReader.java.
|
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));
}
}
samples | A pre allocated collection to store the samples in |
samples
, for convenience. org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
Definition at line 538 of file AbstractDataReader.java.
|
inherited |
Definition at line 543 of file AbstractDataReader.java.
boolean org.opensplice.dds.sub.DataReaderProtobuf< PROTOBUF_TYPE, DDS_TYPE >.takeNextSample | ( | Sample< PROTOBUF_TYPE > | sample | ) |
Definition at line 186 of file DataReaderProtobuf.java.
|
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.
maxWait | the maximum duration to block for the waitForHistoricalData, after which the application thread is unblocked. |
TimeoutException | if maxWait elapsed before all the data was received. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
org.omg.dds.core.PreconditionNotMetException | Can happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete. |
Definition at line 331 of file AbstractDataReader.java.
|
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.
maxWait | The maximum duration to block for the waitForHistoricalData, after which the application thread is unblocked. |
unit | The TimeUnit which the sourceTimestamp describes (i.e. TimeUnit.SECONDS or TimeUnit.MILLISECONDS) |
TimeoutException | if maxWait elapsed before all the data was received. |
org.omg.dds.core.DDSException | An internal error has occurred. |
org.omg.dds.core.AlreadyClosedException | The corresponding DataReader has been closed. |
org.omg.dds.core.OutOfResourcesException | The Data Distribution Service ran out of resources to complete this operation. |
org.omg.dds.core.PreconditionNotMetException | Can happen when requesting conditional alignment on non-volatile readers or Historical data request already in progress or complete. |
Definition at line 336 of file AbstractDataReader.java.
|
inherited |
Definition at line 342 of file AbstractDataReader.java.
|
inherited |
Definition at line 352 of file AbstractDataReader.java.
|
inherited |
Definition at line 361 of file AbstractDataReader.java.
|
inherited |
Definition at line 370 of file AbstractDataReader.java.
|
inherited |
Definition at line 380 of file AbstractDataReader.java.
|
inherited |
Definition at line 390 of file AbstractDataReader.java.
|
inherited |
Definition at line 399 of file AbstractDataReader.java.
|
inherited |
Definition at line 408 of file AbstractDataReader.java.
|
inherited |
Definition at line 418 of file AbstractDataReader.java.
|
inherited |
Definition at line 428 of file AbstractDataReader.java.
|
inherited |
Definition at line 438 of file AbstractDataReader.java.
|
inherited |
Definition at line 448 of file AbstractDataReader.java.
|
inherited |
Definition at line 457 of file AbstractDataReader.java.
|
inherited |
Definition at line 466 of file AbstractDataReader.java.
|
protectedinherited |
Definition at line 73 of file AbstractDataReader.java.
|
protectedinherited |
Definition at line 74 of file AbstractDataReader.java.
|
protectedinherited |
Definition at line 75 of file AbstractDataReader.java.
|
protectedinherited |
Definition at line 72 of file AbstractDataReader.java.