CoreDX DDS for Java
from Twin Oaks Computing, Inc.

com.toc.coredx.DDS
Class DataWriter

java.lang.Object
  extended by com.toc.coredx.DDS.Entity
      extended by com.toc.coredx.DDS.DomainEntity
          extended by com.toc.coredx.DDS.DataWriter
Direct Known Subclasses:
FooDataWriter

public class DataWriter
extends DomainEntity

The DataWriter entity provides an interface for the application to publish (write) data. The DataWriter is an abstract class that is extended to support a particular data type required by the application. A DataReader is associated with, and writes on, a single Topic.


Method Summary
 ReturnCode_t assert_liveliness()
          This operation manually asserts the liveliness of the DataWriter dw. This operation is useful if the LIVELINESS QoS setting is MANUAL_BY_PARTICIPANT_LIVELINESS_QOS or MANUAL_BY_TOPIC_LIVELINESS_QOS; otherwise, it has no effect.
 ReturnCode_t enable()
          Enables the DataWriter.
 DataWriterListener get_listener()
          This operation returns the currently installed DataWriterListener.
 ReturnCode_t get_liveliness_lost_status(LivelinessLostStatus status)
          Provides access to the current LivelinessLostStatus of the DataWriter.
 ReturnCode_t get_matched_subscription_data(SubscriptionBuiltinTopicData subscription_data, InstanceHandle_t subscription_handle)
          This operation returns data that describes a particular matched DataReader identified by subscription_handle. An appropriate handle can be obtained through a call to DataWriter.get_matched_subscriptions().
 ReturnCode_t get_matched_subscriptions(java.util.Vector subscription_handles)
          This operation retrieves the list of DataReaders currently matched with the DataWriter dw. This list will include the handles that identify DataReaders which have matching Topic and compatible QoS with DataWriter.
 ReturnCode_t get_offered_deadline_missed_status(OfferedDeadlineMissedStatus status)
          Provides access to the current OfferedDeadlineMissedStatus of the DataWriter.
 ReturnCode_t get_offered_incompatible_qos_status(OfferedIncompatibleQosStatus status)
          Provides access to the current OfferedIncompatibleQosStatus of the DataWriter.
 ReturnCode_t get_publication_matched_status(PublicationMatchedStatus status)
          Provides access to the current PublicationMatchedStatus of the DataWriter.
 Publisher get_publisher()
          Returns the Publisher that contains DataWriter dw.
 ReturnCode_t get_qos(DataWriterQos qos)
          Returns the current DataWriterQos settings held in the DataWriter dw. This routines copies data from the DataWriter QoS properties into qos.
 Topic get_topic()
          Returns the Topic associated with DataWriter dw.
 ReturnCode_t set_listener(DataWriterListener new_listener, long mask)
          Installs a DataWriterListener on DataWriter dw. Only one listener may be attached to a DataWriter at a time.
 ReturnCode_t set_qos(DataWriterQos qos)
          Sets the DataWriterQos values.
 ReturnCode_t wait_for_acknowledgments(Duration_t max_wait)
          This operation is not yet implemented.
 
Methods inherited from class com.toc.coredx.DDS.Entity
get_instance_handle, get_status_changes, get_statuscondition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

enable

public ReturnCode_t enable()
Enables the DataWriter. A DataWriter is created either enabled or not based on the PublisherQos setting entity_factory. When a DataWriter is not enabled, only the following sub-set of all DataWriter operations are legal:

Any other operation may return the RETCODE_NOT_ENABLED error. DataWriter_enable() may be called on an already enabled DataWriter [it will have no effect].

Overrides:
enable in class Entity

set_qos

public ReturnCode_t set_qos(DataWriterQos qos)
Sets the DataWriterQos values. These QoS values affect the behavior of the DataWriter. This routine may fail if the provided qos argument is not internally consistent. In this case, ReturnCode_t.RETCODE_INCONSISTENT_POLICY will be returned, and no changes will be made to the DataWriter QoS.


get_qos

public ReturnCode_t get_qos(DataWriterQos qos)
Returns the current DataWriterQos settings held in the DataWriter dw. This routines copies data from the DataWriter QoS properties into qos.


set_listener

public ReturnCode_t set_listener(DataWriterListener new_listener,
                                 long mask)
Installs a DataWriterListener on DataWriter dw. Only one listener may be attached to a DataWriter at a time. A call to set_listener() will replace any current listener with a_listener.

a_listener can be NULL, which indicates a listener that does nothing.


get_listener

public DataWriterListener get_listener()
This operation returns the currently installed DataWriterListener.


get_topic

public Topic get_topic()
Returns the Topic associated with DataWriter dw.


get_publisher

public Publisher get_publisher()
Returns the Publisher that contains DataWriter dw.


wait_for_acknowledgments

public ReturnCode_t wait_for_acknowledgments(Duration_t max_wait)
This operation is not yet implemented.


assert_liveliness

public ReturnCode_t assert_liveliness()
This operation manually asserts the liveliness of the DataWriter dw. This operation is useful if the LIVELINESS QoS setting is MANUAL_BY_PARTICIPANT_LIVELINESS_QOS or MANUAL_BY_TOPIC_LIVELINESS_QOS; otherwise, it has no effect.

The write operation automatically asserts livelines on the DataWriter and its DomainParticipant. Therefore, assert_liveliness is required only if hte application is not writing data frequently enough to satisfy the LIVELINESS setting.


get_liveliness_lost_status

public ReturnCode_t get_liveliness_lost_status(LivelinessLostStatus status)
Provides access to the current LivelinessLostStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.


get_offered_deadline_missed_status

public ReturnCode_t get_offered_deadline_missed_status(OfferedDeadlineMissedStatus status)
Provides access to the current OfferedDeadlineMissedStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.


get_offered_incompatible_qos_status

public ReturnCode_t get_offered_incompatible_qos_status(OfferedIncompatibleQosStatus status)
Provides access to the current OfferedIncompatibleQosStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.


get_publication_matched_status

public ReturnCode_t get_publication_matched_status(PublicationMatchedStatus status)
Provides access to the current PublicationMatchedStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change and current_count_change status fields to zero.


get_matched_subscriptions

public ReturnCode_t get_matched_subscriptions(java.util.Vector subscription_handles)
This operation retrieves the list of DataReaders currently matched with the DataWriter dw. This list will include the handles that identify DataReaders which have matching Topic and compatible QoS with DataWriter.

If a DataReader has been ignored by a call to DomainParticipant.ignore_subscription(), then it will not appear in the list.

Parameters:
subscription_handles - A vector that will be populated with InstanceHandle_t(s).

This is not currently supported.


get_matched_subscription_data

public ReturnCode_t get_matched_subscription_data(SubscriptionBuiltinTopicData subscription_data,
                                                  InstanceHandle_t subscription_handle)
This operation returns data that describes a particular matched DataReader identified by subscription_handle. An appropriate handle can be obtained through a call to DataWriter.get_matched_subscriptions().

If subscription_handle does not identify a matched DataReader, this routine will return ReturnCode_t.RETCODE_PRECONDITION_NOT_MET.

This is not currently supported.


Copyright © 2010 Twin Oaks Computing, Inc,
All Rights Reserved