21 package org.opensplice.dds.pub;
23 import java.util.Collection;
25 import java.util.concurrent.TimeUnit;
26 import java.util.concurrent.TimeoutException;
59 @SuppressWarnings(
"unchecked")
63 Collection<Class<? extends
Status>> statuses) {
64 super(environment, parent);
68 "Supplied DataWriterQos is null.");
72 "Supplied Topic is null.");
74 DDS.DataWriterQos oldQos;
82 }
catch (ClassCastException e) {
84 "Cannot create DataWriter with non-OpenSplice qos");
87 if (listener != null) {
89 this.environment,
this, listener,
true);
93 DDS.DataWriter old = this.parent.getOld().create_datawriter(
94 topic.getOld(), oldQos, this.listener,
102 this.environment, this.getOld(), this.typeSupport
106 if (this.listener != null) {
107 this.listener.setInitialised();
113 this.reflectionWriter.dispose(instanceHandle);
121 @SuppressWarnings(
"unchecked")
127 }
catch (ClassCastException cce) {
129 "Unable to perform requested cast.");
137 PROTOBUF_TYPE instanceData)
throws TimeoutException {
138 this.reflectionWriter.dispose(instanceHandle,
144 PROTOBUF_TYPE instanceData,
Time sourceTimestamp)
145 throws TimeoutException {
146 this.reflectionWriter.dispose(instanceHandle,
147 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp);
153 PROTOBUF_TYPE instanceData,
long sourceTimeStamp, TimeUnit unit)
154 throws TimeoutException {
155 this.reflectionWriter.dispose(instanceHandle,
156 this.typeSupport.
protobufToDds(instanceData), sourceTimeStamp,
162 DDS_TYPE keyValue = this.reflectionWriter.getKeyValue(instanceHandle);
164 if (keyValue != null) {
173 DDS_TYPE keyValue = this.reflectionWriter.getKeyValue(
174 this.typeSupport.
protobufToDds(instanceData), instanceHandle);
176 if (keyValue != null) {
215 DDS.StatusCondition oldCondition = this.getOld().get_statuscondition();
217 if (oldCondition == null) {
221 this.environment, oldCondition,
this);
231 return this.reflectionWriter.lookupInstance(this.typeSupport
232 .protobufToDds(instanceData));
237 throws TimeoutException {
238 return this.reflectionWriter.registerInstance(this.typeSupport
239 .protobufToDds(instanceData));
244 Time sourceTimestamp)
throws TimeoutException {
245 return this.reflectionWriter.registerInstance(
246 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp);
251 long sourceTimestamp, TimeUnit unit)
throws TimeoutException {
252 return this.reflectionWriter.registerInstance(
253 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp,
259 throws TimeoutException {
260 this.reflectionWriter.unregisterInstance(handle);
266 PROTOBUF_TYPE instanceData)
throws TimeoutException {
267 this.reflectionWriter.unregisterInstance(handle,
273 PROTOBUF_TYPE instanceData,
Time sourceTimestamp)
274 throws TimeoutException {
275 this.reflectionWriter.unregisterInstance(handle,
276 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp);
282 PROTOBUF_TYPE instanceData,
long sourceTimestamp, TimeUnit unit)
283 throws TimeoutException {
284 this.reflectionWriter.unregisterInstance(handle,
285 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp,
292 throws TimeoutException {
298 throws TimeoutException {
303 public void write(PROTOBUF_TYPE instanceData)
throws TimeoutException {
304 this.reflectionWriter.write(this.typeSupport
305 .protobufToDds(instanceData));
309 public void write(PROTOBUF_TYPE instanceData,
Time sourceTimestamp)
310 throws TimeoutException {
311 this.reflectionWriter.write(
312 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp);
317 throws TimeoutException {
318 this.reflectionWriter.write(
324 public void write(PROTOBUF_TYPE instanceData,
long sourceTimestamp,
325 TimeUnit unit)
throws TimeoutException {
326 this.reflectionWriter.write(
327 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp,
333 Time sourceTimestamp)
throws TimeoutException {
334 this.reflectionWriter.write(
341 long sourceTimestamp, TimeUnit unit)
throws TimeoutException {
342 this.reflectionWriter.write(
344 sourceTimestamp, unit);
349 return this.reflectionWriter.
getQos();
357 if (listener != null) {
359 this.environment,
this, listener);
361 wrapperListener = null;
363 rc = this.getOld().set_listener(wrapperListener, mask);
365 "DataWriter.setListener() failed.");
367 this.listener = wrapperListener;
377 Collection<Class<? extends Status>> statuses) {
378 this.setListener(listener,
384 Class<? extends Status>... statuses) {
385 this.setListener(listener,
391 this.reflectionWriter.
setQos(qos);
396 return this.environment;
401 throws TimeoutException {
402 this.reflectionWriter.writeDispose(this.typeSupport
403 .protobufToDds(instanceData));
408 throws TimeoutException {
409 this.reflectionWriter.writeDispose(
410 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp);
415 throws TimeoutException {
416 this.reflectionWriter.writeDispose(
421 public void writeDispose(PROTOBUF_TYPE instanceData,
long sourceTimestamp,
422 TimeUnit unit)
throws TimeoutException {
423 this.reflectionWriter.writeDispose(
424 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp,
430 Time sourceTimestamp)
throws TimeoutException {
431 this.reflectionWriter.writeDispose(
439 InstanceHandle instanceHandle,
long sourceTimestamp, TimeUnit unit)
440 throws TimeoutException {
441 this.reflectionWriter.writeDispose(
442 this.typeSupport.
protobufToDds(instanceData), sourceTimestamp,
OfferedDeadlineMissedStatus getOfferedDeadlineMissedStatus()
void unregisterInstance(InstanceHandle handle)
PROTOBUF_TYPE getKeyValue(PROTOBUF_TYPE instanceData, InstanceHandle instanceHandle)
This class contains the statistics about the discovered number of org.omg.dds.sub.DataReaders that are compatible with the org.omg.dds.pub.DataWriter to which the Status is attached.
void writeDispose(PROTOBUF_TYPE instanceData)
Set< InstanceHandle > getMatchedSubscriptions()
PublicationMatchedStatus getPublicationMatchedStatus()
void writeDispose(PROTOBUF_TYPE instanceData, InstanceHandle handle)
A StatusCondition object is an immutable object that specifies Condition that is associated with each...
OfferedIncompatibleQosStatus getOfferedIncompatibleQosStatus()
void unregisterInstance(InstanceHandle handle, PROTOBUF_TYPE instanceData, long sourceTimestamp, TimeUnit unit)
void waitForAcknowledgments(Duration maxWait)
Set< InstanceHandle > getMatchedSubscriptions()
void writeDispose(PROTOBUF_TYPE instanceData, long sourceTimestamp, TimeUnit unit)
void writeDispose(PROTOBUF_TYPE instanceData, Time sourceTimestamp)
final TypeSupportProtobuf< PROTOBUF_TYPE, DDS_TYPE > typeSupport
InstanceHandle registerInstance(PROTOBUF_TYPE instanceData)
void writeDispose(PROTOBUF_TYPE instanceData, InstanceHandle instanceHandle, long sourceTimestamp, TimeUnit unit)
void write(PROTOBUF_TYPE instanceData, InstanceHandle handle)
void write(PROTOBUF_TYPE instanceData, InstanceHandle handle, Time sourceTimestamp)
InstanceHandle lookupInstance(PROTOBUF_TYPE instanceData)
void setListener(DataWriterListener< PROTOBUF_TYPE > listener, Collection< Class<? extends Status >> statuses)
OfferedIncompatibleQosStatus getOfferedIncompatibleQosStatus()
void waitForAcknowledgments(long maxWait, TimeUnit unit)
LivelinessLostStatus getLivelinessLostStatus()
InstanceHandle registerInstance(PROTOBUF_TYPE instanceData, Time sourceTimestamp)
TypeSupportImpl< DDS_TYPE > getTypeSupportStandard()
DataWriter allows the application to set the value of the data to be published under a given org...
void setQos(DataWriterQos qos)
LivelinessLostStatus getLivelinessLostStatus()
PublicationMatchedStatus getPublicationMatchedStatus()
The DCPSSubscription topic communicates the existence of datareaders by means of the SubscriptionBuil...
static Set< Class<? extends Status > > convertMask(OsplServiceEnvironment environment, int state)
The liveliness that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Liveliness was not respected; thus org.omg.dds.sub.DataReader entities will consider the DataWriter as no longer "active.".
ServiceEnvironment getEnvironment()
void waitForAcknowledgments(Duration maxWait)
void dispose(InstanceHandle instanceHandle, PROTOBUF_TYPE instanceData, long sourceTimeStamp, TimeUnit unit)
An opaque handle that can be used to refer to a local or remote entity.
SubscriptionBuiltinTopicData getMatchedSubscriptionData(InstanceHandle instanceHandle)
static void checkReturnCode(int retCode, OsplServiceEnvironment environment, String message)
StatusCondition< org.omg.dds.pub.DataWriter< PROTOBUF_TYPE > > getStatusCondition()
void writeDispose(PROTOBUF_TYPE instanceData, InstanceHandle handle, Time sourceTimestamp)
Topic< PROTOBUF_TYPE > getTopic()
Since a org.omg.dds.pub.DataWriter is a kind of org.omg.dds.core.Entity, it has the ability to have a...
abstract PROTOBUF_TYPE ddsKeyToProtobuf(DDS_TYPE ddsData)
abstract DDS_TYPE protobufToDds(PROTOBUF_TYPE protobufData)
void setQos(DataWriterQos qos)
void write(PROTOBUF_TYPE instanceData)
void unregisterInstance(InstanceHandle handle, PROTOBUF_TYPE instanceData)
A org.omg.dds.core.policy.QosPolicy value was incompatible with what was requested.
SubscriptionBuiltinTopicData getMatchedSubscriptionData(InstanceHandle subscriptionHandle)
PROTOBUF_TYPE getKeyValue(InstanceHandle instanceHandle)
A span of elapsed time expressed with nanosecond precision.
InstanceHandle registerInstance(PROTOBUF_TYPE instanceData, long sourceTimestamp, TimeUnit unit)
void write(PROTOBUF_TYPE instanceData, InstanceHandle handle, long sourceTimestamp, TimeUnit unit)
OfferedDeadlineMissedStatus getOfferedDeadlineMissedStatus()
void dispose(InstanceHandle instanceHandle)
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
void write(PROTOBUF_TYPE instanceData, long sourceTimestamp, TimeUnit unit)
void dispose(InstanceHandle instanceHandle, PROTOBUF_TYPE instanceData)
static void throwLastErrorException(OsplServiceEnvironment environment)
Topic is the most basic description of the data to be published and subscribed.
void unregisterInstance(InstanceHandle handle, PROTOBUF_TYPE instanceData, Time sourceTimestamp)
The deadline that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.
void write(PROTOBUF_TYPE instanceData, Time sourceTimestamp)
void setListener(DataWriterListener< PROTOBUF_TYPE > listener)
A moment in time expressed with nanosecond precision (though not necessarily nanosecond accuracy)...
void dispose(InstanceHandle instanceHandle, PROTOBUF_TYPE instanceData, Time sourceTimestamp)
Status is the abstract root class for all communication status objects.
void setListener(DataWriterListener< PROTOBUF_TYPE > listener, Class<? extends Status >... statuses)