public interface DomainParticipant extends Entity<DomainParticipantListener,DomainParticipantQos>
Entity
objects.Publisher
, Subscriber
,
Topic
, ContentFilteredTopic
, and MultiTopic
objects.ignoreParticipant(InstanceHandle)
),
publication (ignorePublication(InstanceHandle)
),
subscription (ignoreSubscription(InstanceHandle)
), or topic
(ignoreTopic(InstanceHandle)
).Modifier and Type | Method and Description |
---|---|
void |
assertLiveliness()
This operation manually asserts the liveliness of the
DomainParticipant.
|
void |
closeContainedEntities()
This operation deletes all the entities that were created by means of
the "create" operations on the DomainParticipant.
|
boolean |
containsEntity(InstanceHandle handle)
This operation checks whether or not the given handle represents an
Entity that was created from the DomainParticipant. |
<TYPE> ContentFilteredTopic<TYPE> |
createContentFilteredTopic(String name,
Topic<? extends TYPE> relatedTopic,
String filterExpression,
List<String> expressionParameters)
This operation creates a ContentFilteredTopic.
|
<TYPE> MultiTopic<TYPE> |
createMultiTopic(String name,
Class<TYPE> type,
String subscriptionExpression,
List<String> expressionParameters)
This operation creates a MultiTopic.
|
<TYPE> MultiTopic<TYPE> |
createMultiTopic(String name,
TypeSupport<TYPE> type,
String subscriptionExpression,
List<String> expressionParameters)
This operation creates a MultiTopic.
|
Publisher |
createPublisher()
This operation creates a Publisher with default QoS policies and
no PublisherListener.
|
Publisher |
createPublisher(PublisherQos qos)
This operation creates a Publisher.
|
Publisher |
createPublisher(PublisherQos qos,
PublisherListener listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Publisher.
|
Subscriber |
createSubscriber()
This operation creates a Subscriber with default QoS policies and
no SubscriberListener.
|
Subscriber |
createSubscriber(SubscriberQos qos)
This operation creates a Subscriber.
|
Subscriber |
createSubscriber(SubscriberQos qos,
SubscriberListener listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Subscriber.
|
<TYPE> Topic<TYPE> |
createTopic(String topicName,
Class<TYPE> type)
This operation creates a Topic with default QoS policies and no
TopicListener.
|
<TYPE> Topic<TYPE> |
createTopic(String topicName,
Class<TYPE> type,
TopicQos qos,
TopicListener<TYPE> listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Topic with the desired QoS policies and
attaches to it the specified TopicListener.
|
Topic<DynamicType> |
createTopic(String topicName,
DynamicType type)
This operation creates a Topic with default QoS policies and no
TopicListener.
|
Topic<DynamicType> |
createTopic(String topicName,
DynamicType type,
TopicQos qos,
TopicListener<DynamicType> listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Topic with the desired QoS policies and
attaches to it the specified TopicListener.
|
Topic<DynamicType> |
createTopic(String topicName,
DynamicType type,
TypeSupport<DynamicType> typeSupport)
This operation creates a Topic with default QoS policies and no
TopicListener.
|
Topic<DynamicType> |
createTopic(String topicName,
DynamicType type,
TypeSupport<DynamicType> typeSupport,
TopicQos qos,
TopicListener<DynamicType> listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Topic with the desired QoS policies and
attaches to it the specified TopicListener.
|
<TYPE> Topic<TYPE> |
createTopic(String topicName,
TypeSupport<TYPE> type)
This operation creates a Topic with default QoS policies and no
TopicListener.
|
<TYPE> Topic<TYPE> |
createTopic(String topicName,
TypeSupport<TYPE> type,
TopicQos qos,
TopicListener<TYPE> listener,
Collection<Class<? extends Status>> statuses)
This operation creates a Topic with the desired QoS policies and
attaches to it the specified TopicListener.
|
<TYPE> Topic<TYPE> |
findTopic(String topicName,
Duration timeout)
This operation gives access to an existing (or ready to exist) enabled
Topic, based on its name.
|
<TYPE> Topic<TYPE> |
findTopic(String topicName,
long timeout,
TimeUnit unit)
This operation gives access to an existing (or ready to exist) enabled
Topic, based on its name.
|
Subscriber |
getBuiltinSubscriber()
This operation allows access to the built-in Subscriber.
|
Time |
getCurrentTime()
This operation returns the current value of the time that the service
uses to time stamp data writes and to set the reception time stamp for
the data updates it receives.
|
ModifiableTime |
getCurrentTime(ModifiableTime currentTime)
This operation returns the current value of the time that the service
uses to time stamp data writes and to set the reception time stamp for
the data updates it receives.
|
PublisherQos |
getDefaultPublisherQos()
This operation retrieves the default value of the Publisher QoS, that
is, the QoS policies which will be used for newly created
Publisher entities in the case where the QoS policies are
defaulted in the createPublisher() operation. |
SubscriberQos |
getDefaultSubscriberQos()
This operation retrieves the default value of the Subscriber QoS, that
is, the QoS policies which will be used for newly created
Subscriber entities in the case where the QoS policies are
defaulted in the createSubscriber() operation. |
TopicQos |
getDefaultTopicQos()
This operation retrieves the default value of the Topic QoS, that is,
the QoS policies which will be used for newly created
Topic
entities in the case where the QoS policies are defaulted in the
createTopic(String, Class) operation. |
ParticipantBuiltinTopicData |
getDiscoveredParticipantData(InstanceHandle participantHandle)
This operation retrieves information on a DomainParticipant that has
been discovered on the network.
|
Set<InstanceHandle> |
getDiscoveredParticipants()
This operation retrieves the list of DomainParticipants that have been
discovered in the domain and that the application has not indicated
should be "ignored" by means of the
ignoreParticipant(InstanceHandle) operation. |
TopicBuiltinTopicData |
getDiscoveredTopicData(InstanceHandle topicHandle)
This operation retrieves information on a
Topic that has
been discovered on the network. |
Set<InstanceHandle> |
getDiscoveredTopics()
This operation retrieves the list of
Topic s that have been
discovered in the domain and that the application has not indicated
should be "ignored" by means of the
ignoreTopic(InstanceHandle) operation. |
int |
getDomainId()
This operation retrieves the domain ID used to create the
DomainParticipant.
|
StatusCondition<DomainParticipant> |
getStatusCondition()
This operation allows access to the
StatusCondition associated
with the Entity. |
void |
ignoreParticipant(InstanceHandle handle)
This operation allows an application to instruct the Service to
locally ignore a remote domain participant.
|
void |
ignorePublication(InstanceHandle handle)
This operation allows an application to instruct the Service to
locally ignore a remote publication; a publication is defined by the
association of a topic name, and user data and partition set on the
Publisher . |
void |
ignoreSubscription(InstanceHandle handle)
This operation allows an application to instruct the Service to
locally ignore a remote subscription; a subscription is defined by the
association of a topic name, and user data and partition set on the
Subscriber . |
void |
ignoreTopic(InstanceHandle handle)
This operation allows an application to instruct the Service to
locally ignore a
Topic . |
<TYPE> TopicDescription<TYPE> |
lookupTopicDescription(String name)
This operation gives access to an existing locally-created
TopicDescription based on its name.
|
void |
setDefaultPublisherQos(PublisherQos qos)
This operation sets a default value of the Publisher QoS policies,
which will be used for newly created
Publisher entities in the
case where the QoS policies are defaulted in the
createPublisher() operation. |
void |
setDefaultSubscriberQos(SubscriberQos qos)
This operation sets a default value of the Subscriber QoS policies
that will be used for newly created
Subscriber entities in the
case where the QoS policies are defaulted in the
createSubscriber() operation. |
void |
setDefaultTopicQos(TopicQos qos)
This operation sets a default value of the Topic QoS policies, which
will be used for newly created
Topic entities in the case
where the QoS policies are defaulted in the
createTopic(String, Class) operation. |
close, enable, getInstanceHandle, getListener, getQos, getStatusChanges, retain, setListener, setListener, setQos, setQos
getEnvironment
Publisher createPublisher()
Publisher createPublisher(PublisherQos qos)
qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.createPublisher()
Publisher createPublisher(PublisherQos qos, PublisherListener listener, Collection<Class<? extends Status>> statuses)
qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.createPublisher()
Subscriber createSubscriber()
Subscriber createSubscriber(SubscriberQos qos)
qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Subscriber will be created.createSubscriber()
Subscriber createSubscriber(SubscriberQos qos, SubscriberListener listener, Collection<Class<? extends Status>> statuses)
qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Subscriber will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.createSubscriber()
Subscriber getBuiltinSubscriber()
Topic
objects as
well as corresponding DataReader
objects to access them. All
these DataReader objects belong to a single built-in Subscriber.
The built-in Topics are used to communicate information about other
DomainParticipant, Topic, DataReader
, and DataWriter
objects.<TYPE> Topic<TYPE> createTopic(String topicName, Class<TYPE> type)
topicName
- The name of the new Topic.type
- The type of all samples to be published and
subscribed over the new Topic. The Service will
attempt to locate an appropriate
TypeSupport
instance based on this type.<TYPE> Topic<TYPE> createTopic(String topicName, Class<TYPE> type, TopicQos qos, TopicListener<TYPE> listener, Collection<Class<? extends Status>> statuses)
topicName
- The name of the new Topic.type
- The type of all samples to be published and
subscribed over the new Topic. The Service will
attempt to locate an appropriate
TypeSupport
instance based on this type.qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.<TYPE> Topic<TYPE> createTopic(String topicName, TypeSupport<TYPE> type)
topicName
- The name of the new Topic.type
- A TypeSupport
representing the type of
all samples to be published and subscribed over
the new Topic.<TYPE> Topic<TYPE> createTopic(String topicName, TypeSupport<TYPE> type, TopicQos qos, TopicListener<TYPE> listener, Collection<Class<? extends Status>> statuses)
topicName
- The name of the new Topic.type
- A TypeSupport
representing the type of
all samples to be published and subscribed over
the new Topic.qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.Topic<DynamicType> createTopic(String topicName, DynamicType type)
topicName
- The name of the new Topic.type
- A DynamicType
of all samples to be published and
subscribed over the new Topic. The Service will
attempt to locate an appropriate
TypeSupport
instance based on this type.Topic<DynamicType> createTopic(String topicName, DynamicType type, TopicQos qos, TopicListener<DynamicType> listener, Collection<Class<? extends Status>> statuses)
topicName
- The name of the new Topic.type
- A DynamicType
of all samples to be published and
subscribed over the new Topic. The Service will
attempt to locate an appropriate
TypeSupport
instance based on this type.qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.Topic<DynamicType> createTopic(String topicName, DynamicType type, TypeSupport<DynamicType> typeSupport)
topicName
- The name of the new Topic.type
- A DynamicType
representing the type of
all samples to be published and subscribed over
the new Topic.typeSupport
- A TypeSupport
for DynamicType
.Topic<DynamicType> createTopic(String topicName, DynamicType type, TypeSupport<DynamicType> typeSupport, TopicQos qos, TopicListener<DynamicType> listener, Collection<Class<? extends Status>> statuses)
topicName
- The name of the new Topic.type
- A DynamicType
typeSupport
- A TypeSupport
for DynamicType
qos
- The desired QoS policies. If the specified QoS
policies are not consistent, the operation will
fail and no Publisher will be created.listener
- The listener to be attached.statuses
- Of which status changes the listener should be
notified. A null collection signifies all status
changes.<TYPE> Topic<TYPE> findTopic(String topicName, Duration timeout) throws TimeoutException
TopicDescription.close()
so that the local resources can be released. If
a Topic is obtained multiple times by means of findTopic or
createTopic(String, Class)
, it must also be closed that same
number of times.
Regardless of whether the middleware chooses to propagate topics, the
TopicDescription.close()
operation disposes of only the local proxy.TimeoutException
- if the specified timeout elapses and no
suitable Topic could be found.findTopic(String, long, TimeUnit)
<TYPE> Topic<TYPE> findTopic(String topicName, long timeout, TimeUnit unit) throws TimeoutException
TopicDescription.close()
so that the local resources can be released. If
a Topic is obtained multiple times by means of findTopic or
createTopic(String, Class)
, it must also be closed that same
number of times.
Regardless of whether the middleware chooses to propagate topics, the
TopicDescription.close()
operation disposes of only the local proxy.TimeoutException
- if the specified timeout elapses and no
suitable Topic could be found.findTopic(String, Duration)
<TYPE> TopicDescription<TYPE> lookupTopicDescription(String name)
Topic
,
ContentFilteredTopic
, or MultiTopic
object.
Unlike findTopic(String, Duration)
, the operation searches
only among the locally created topics. Therefore, it should never
create a new TopicDescription. The TopicDescription returned does not
require an extra TopicDescription.close()
. It is still
possible to close the TopicDescription returned by this method,
provided it has no readers or writers, but then it is really closed
and subsequent lookups will fail.
If the operation fails to locate a TopicDescription, it returns null.TYPE
- The type of all samples subscribed to with the
TopicDescription.name
- The name of the TopicDescription to look up.<TYPE> ContentFilteredTopic<TYPE> createContentFilteredTopic(String name, Topic<? extends TYPE> relatedTopic, String filterExpression, List<String> expressionParameters)
TYPE
- The type of all samples subscribed to
with the new ContentFilteredTopic. It may
be the same as the type of the
relatedTopic or any supertype of that
type.name
- The name of the new ContentFilteredTopic.relatedTopic
- The related Topic being subscribed to.
The ContentFilteredTopic only relates to
samples published under this Topic,
filtered according to their content.filterExpression
- A logical expression that involves the
values of some of the data fields in the
sample.expressionParameters
- Parameters to the filterExpression.<TYPE> MultiTopic<TYPE> createMultiTopic(String name, Class<TYPE> type, String subscriptionExpression, List<String> expressionParameters)
TYPE
- The type of all samples subscribed to with the new
MultiTopic.name
- The name of the new MultiTopic.type
- The resulting type. The Service will attempt to
locate an appropriate TypeSupport
instance
based on this type.subscriptionExpression
- The list of topics and the logic used
to combine filter and re-arrange the information from each
Topic.expressionParameters
- Parameters to the filterExpression.<TYPE> MultiTopic<TYPE> createMultiTopic(String name, TypeSupport<TYPE> type, String subscriptionExpression, List<String> expressionParameters)
TYPE
- The type of all samples subscribed to with the new
MultiTopic.name
- The name of the new MultiTopic.type
- A TypeSupport
representing the resulting
type.subscriptionExpression
- The list of topics and the logic used
to combine filter and re-arrange the information from each
Topic.expressionParameters
- Parameters to the filterExpression.void closeContainedEntities()
Publisher
, Subscriber
, Topic
,
ContentFilteredTopic
, and MultiTopic
objects.
Prior to deleting each contained entity, this operation will
recursively call the corresponding closeContainedEntities operation on
each contained entity (if applicable). This pattern is applied
recursively. In this manner the operation closeContainedEntities on
the DomainParticipant will end up deleting all the entities
recursively contained in the DomainParticipant, that is also the
DataWriter
, DataReader
, as well as the
QueryCondition
and ReadCondition
objects belonging to
the contained DataReaders.
Once closeContainedEntities returns successfully, the application may
delete the DomainParticipant knowing that it has no contained
entities.PreconditionNotMetException
- if any of the contained
entities is in a state where it cannot be closed.void ignoreParticipant(InstanceHandle handle)
Topic
, publication, or
subscription that originates on that domain participant.
This operation can be used, in conjunction with the discovery of
remote participants offered by means of the "DCPSParticipant" built-in
Topic, to provide, for example, access control. Application data can
be associated with a DomainParticipant by means of the
UserData
. This application data is propagated as a
field in the built-in topic and can be used by an application to
implement its own access control policy.
The domain participant to ignore is identified by the handle argument.
This handle is the one that appears in the Sample
retrieved
when reading the data samples available for the built-in DataReader to
the "DCPSParticipant" topic. The built-in DataReader
is read
with the same read/take operations used for any DataReader.
This operation is not required to be reversible. The Service offers no
means to reverse it.OutOfResourcesException
- if the Service is unable to ignore
the indicated participant because an internal resource has
been exhausted.void ignoreTopic(InstanceHandle handle)
Topic
. This means it will locally ignore any
publication or subscription to the Topic.
This operation can be used to save local resources when the
application knows that it will never publish or subscribe to data
under certain topics.
The Topic to ignore is identified by the handle argument. This handle
is the one that appears in the Sample
retrieved when reading
the data samples from the built-in DataReader
to the
"DCPSTopic" topic.
This operation is not required to be reversible. The Service offers no
means to reverse it.OutOfResourcesException
- if the Service is unable to ignore
the indicated topic because an internal resource has been
exhausted.void ignorePublication(InstanceHandle handle)
Publisher
. After this call, any data written related to that
publication will be ignored.
The DataWriter
to ignore is identified by the handle argument.
This handle is the one that appears in the Sample
retrieved
when reading the data samples from the built-in DataReader
to
the "DCPSPublication" topic.
This operation is not required to be reversible. The Service offers no
means to reverse it.OutOfResourcesException
- if the Service is unable to ignore
the indicated publication because an internal resource has
been exhausted.void ignoreSubscription(InstanceHandle handle)
Subscriber
. After this call, any data received related to that
subscription will be ignored.
The DataReader
to ignore is identified by the handle argument.
This handle is the one that appears in the Sample
retrieved
when reading the data samples from the built-in DataReader to the
"DCPSSubscription" topic.
This operation is not required to be reversible. The Service offers no
means to reverse it.OutOfResourcesException
- if the Service is unable to ignore
the indicated subscription because an internal resource has
been exhausted.int getDomainId()
void assertLiveliness()
Liveliness
to indicate to the
Service that the entity remains active.
This operation needs to only be used if the DomainParticipant contains
DataWriter
entities with the
Liveliness.getKind()
set to
Liveliness.Kind.MANUAL_BY_PARTICIPANT
and it only
affects the liveliness of those DataWriter entities. Otherwise, it has
no effect.
Note - Writing data via the DataWriter.write(Object)
operation on a DataWriter asserts liveliness on the DataWriter itself
and its DomainParticipant. Consequently the use of assertLiveliness is
only needed if the application is not writing data regularly.PublisherQos getDefaultPublisherQos()
Publisher
entities in the case where the QoS policies are
defaulted in the createPublisher()
operation.
The values retrieved will match the set of values specified on the
last successful call to setDefaultPublisherQos(PublisherQos)
,
or else, if the call was never made, the default values identified by
the DDS specification.setDefaultPublisherQos(PublisherQos)
void setDefaultPublisherQos(PublisherQos qos)
Publisher
entities in the
case where the QoS policies are defaulted in the
createPublisher()
operation.InconsistentPolicyException
- if the resulting policies are
not self consistent; in that case, the operation will have no
effect.getDefaultPublisherQos()
SubscriberQos getDefaultSubscriberQos()
Subscriber
entities in the case where the QoS policies are
defaulted in the createSubscriber()
operation.
The values retrieved will match the set of values specified on the
last successful call to
setDefaultSubscriberQos(SubscriberQos)
, or else, if the call
was never made, the default values identified by the DDS
specification.void setDefaultSubscriberQos(SubscriberQos qos)
Subscriber
entities in the
case where the QoS policies are defaulted in the
createSubscriber()
operation.InconsistentPolicyException
- if the resulting policies are
not self consistent; in that case, the operation will have no
effect.getDefaultSubscriberQos()
TopicQos getDefaultTopicQos()
Topic
entities in the case where the QoS policies are defaulted in the
createTopic(String, Class)
operation.
The values retrieved will match the set of values specified on the
last successful call to setDefaultTopicQos(TopicQos)
, or
else, if the call was never made, the default values identified by the
DDS specification.setDefaultTopicQos(TopicQos)
void setDefaultTopicQos(TopicQos qos)
Topic
entities in the case
where the QoS policies are defaulted in the
createTopic(String, Class)
operation.InconsistentPolicyException
- if the resulting policies are
not self consistent; in that case, the operation will have no
effect.getDefaultTopicQos()
Set<InstanceHandle> getDiscoveredParticipants()
ignoreParticipant(InstanceHandle)
operation.UnsupportedOperationException
- If the infrastructure does
not locally maintain the connectivity information.getDiscoveredParticipantData(InstanceHandle)
,
getDiscoveredTopics()
ParticipantBuiltinTopicData getDiscoveredParticipantData(InstanceHandle participantHandle)
ignoreParticipant(InstanceHandle)
operation.
Use the operation getDiscoveredParticipants()
to
find the DomainParticipants that are currently discovered.participantHandle
- a handle to the participant, the data
of which is to be retrieved.PreconditionNotMetException
- if the participantHandle
does not correspond to a DomainParticipant such as is
described above.UnsupportedOperationException
- If the infrastructure does
not locally maintain the connectivity information.getDiscoveredParticipants()
,
getDiscoveredTopicData(InstanceHandle)
Set<InstanceHandle> getDiscoveredTopics()
Topic
s that have been
discovered in the domain and that the application has not indicated
should be "ignored" by means of the
ignoreTopic(InstanceHandle)
operation.UnsupportedOperationException
- If the infrastructure does
not locally maintain the connectivity information.getDiscoveredTopicData(InstanceHandle)
,
getDiscoveredParticipants()
TopicBuiltinTopicData getDiscoveredTopicData(InstanceHandle topicHandle)
Topic
that has
been discovered on the network. The topic must be in the same
domain as the participant on which this operation is invoked and must
not have been "ignored" by means of the
ignoreTopic(InstanceHandle)
operation.
Use the operation getDiscoveredTopics()
to
find the Topics that are currently discovered.topicHandle
- a handle to the topic, the data
of which is to be retrieved.PreconditionNotMetException
- if the topicHandle
does not correspond to a Topic such as is described above.UnsupportedOperationException
- If the infrastructure does
not locally maintain the connectivity information or if the
infrastructure does not hold the information necessary to
fill in the topicData.getDiscoveredTopics()
,
getDiscoveredParticipantData(InstanceHandle)
boolean containsEntity(InstanceHandle handle)
Entity
that was created from the DomainParticipant. The
containment applies recursively. That is, it applies both to entities
(TopicDescription
, Publisher
, or Subscriber
)
created directly using the DomainParticipant as well as entities
created using a contained Publisher or Subscriber as the factory, and
so forth.
The instance handle for an Entity may be obtained from built-in topic
data, from various statuses, or from the Entity operation
Entity.getInstanceHandle()
.ModifiableTime getCurrentTime(ModifiableTime currentTime)
currentTime
- a container for the current time, which the
Service will overwrite with the result of this operation, or
null, if the Service should store the current time in a new
object.getCurrentTime()
Time getCurrentTime()
getCurrentTime(ModifiableTime)
StatusCondition<DomainParticipant> getStatusCondition()
Entity
StatusCondition
associated
with the Entity. The returned condition can then be added to a
WaitSet
so that the application can wait for specific status
changes that affect the Entity.getStatusCondition
in interface Entity<DomainParticipantListener,DomainParticipantQos>
Copyright © 2014. All rights reserved.