OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
Subscriber.java
Go to the documentation of this file.
1 /* Copyright 2010, Object Management Group, Inc.
2  * Copyright 2010, PrismTech, Inc.
3  * Copyright 2010, Real-Time Innovations, Inc.
4  * All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 package org.omg.dds.sub;
20 
21 import java.util.Collection;
22 import java.util.Set;
23 
24 import org.omg.dds.core.DDSObject;
25 import org.omg.dds.core.DomainEntity;
27 import org.omg.dds.core.status.Status;
30 import org.omg.dds.topic.TopicQos;
31 
69 public interface Subscriber
70 extends DomainEntity<SubscriberListener, SubscriberQos>
71 {
72  // --- Create (any) DataReader: ------------------------------------------
73 
105  public <TYPE> DataReader<TYPE> createDataReader(
106  TopicDescription<TYPE> topic);
107 
173  public <TYPE> DataReader<TYPE> createDataReader(
175  DataReaderQos qos,
176  DataReaderListener<TYPE> listener,
177  Collection<Class<? extends Status>> statuses);
178 
244  public <TYPE> DataReader<TYPE> createDataReader(
246  DataReaderQos qos,
247  DataReaderListener<TYPE> listener,
248  Class<? extends Status>... statuses);
249 
282  public <TYPE> DataReader<TYPE> createDataReader(
284  DataReaderQos qos);
285 
286  // --- Lookup operations: ------------------------------------------------
287 
308  public <TYPE> DataReader<TYPE> lookupDataReader(String topicName);
309 
329  public <TYPE> DataReader<TYPE> lookupDataReader(
330  TopicDescription<TYPE> topicName);
331 
332 
333  // --- Other operations: -------------------------------------------------
334 
354  public void closeContainedEntities();
355 
384  public Collection<DataReader<?>> getDataReaders();
385 
450  public Collection<DataReader<?>> getDataReaders(DataState dataState);
451 
464  public void notifyDataReaders();
465 
508  public void beginAccess();
509 
533  public void endAccess();
534 
558 
578  public void setDefaultDataReaderQos(DataReaderQos qos);
579 
613 
614 
615  // --- From Entity: ------------------------------------------------------
616  @Override
618 
619  @Override
620  public DomainParticipant getParent();
621 
622 
623  // --- DataState: ------------------------------------------------------
624 
634  public DataState createDataState();
635 
636 
645  public static interface DataState extends DDSObject, Cloneable {
646  // --- Accessors: ----------------------------------------------------
647 
654  public Set<SampleState> getSampleStates();
655 
662  public Set<ViewState> getViewStates();
663 
670  public Set<InstanceState> getInstanceStates();
671 
672 
673  // --- Mutators: -----------------------------------------------------
674 
686  public DataState with(SampleState state);
687 
699  public DataState with(ViewState state);
700 
713  public DataState with(InstanceState state);
714 
723  public DataState withAnySampleState();
724 
733  public DataState withAnyViewState();
734 
745 
757 
758 
759  // --- From Object: --------------------------------------------------
760 
761  public DataState clone();
762 
763  public boolean equals(Object other);
764 
765  public int hashCode();
766  }
767 }
Since a org.omg.dds.sub.DataReader is a kind of org.omg.dds.core.Entity, it has the ability to have a...
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.
DataReaderQos getDefaultDataReaderQos()
This operation retrieves the default value of the DataReader QoS, that is, the QoS policies which wil...
A Subscriber is the object responsible for the actual reception of the data resulting from its subscr...
Definition: Subscriber.java:69
The DomainParticipant object plays several roles:
public< TYPE > DataReader< TYPE > createDataReader(TopicDescription< TYPE > topic)
This operation creates a org.omg.dds.sub.DataReader.
A StatusCondition object is an immutable object that specifies Condition that is associated with each...
For each instance the Data Distribution Service internally maintains an InstanceState.
DataState withNotAliveInstanceStates()
Add org.omg.dds.sub.InstanceState#NOT_ALIVE_DISPOSED and org.omg.dds.sub.InstanceState#NOT_ALIVE_NO_W...
DomainParticipant getParent()
For each sample, the Data Distribution Service internally maintains a SampleState specific to each Da...
public< TYPE > DataReader< TYPE > lookupDataReader(String topicName)
This operation retrieves a previously-created DataReader belonging to the Subscriber that is attached...
A DataState encapsulates sets of sample states, view states, and instance states as a convenience...
DomainEntity is the abstract base class for all DCPS entities, except for the org.omg.dds.domain.DomainParticipant.
Collection< DataReader<?> > getDataReaders()
This operation is equivalent to calling getDataReaders(DataState) with any sample state ( Subscriber...
Set< SampleState > getSampleStates()
Get the current set of sample states.
StatusCondition< Subscriber > getStatusCondition()
void setDefaultDataReaderQos(DataReaderQos qos)
This operation sets a default value of the DataReader QoS policies, which will be used for newly crea...
DataState withAnySampleState()
Add all org.omg.dds.sub.SampleState values to this DataState.
void beginAccess()
This operation indicates that the application is about to access the data samples in any of the org...
void endAccess()
Indicates that the application has finished accessing the data samples in org.omg.dds.sub.DataReader objects managed by the Subscriber.
DataReaderQos copyFromTopicQos(DataReaderQos drQos, TopicQos tQos)
This operation copies the policies in the org.omg.dds.topic.TopicQos to the corresponding policies in...
DataState withAnyInstanceState()
Add all org.omg.dds.sub.InstanceState values to this DataState.
A supertype of all DDS classes and interfaces.
Definition: DDSObject.java:25
For each instance (identified by the key), the Data Distribution Service internally maintains a ViewS...
Definition: ViewState.java:26
Set< ViewState > getViewStates()
Get the current set of view states.
DataState createDataState()
Create and return a new modifiable DataState object.
void notifyDataReaders()
This operation invokes the operation org.omg.dds.sub.DataReaderListener#onDataAvailable(org.omg.dds.core.event.DataAvailableEvent) on the DataReaderListener objects attached to contained DataReader entities with a org.omg.dds.core.event.DataAvailableEvent that is considered changed.
This interface is the base for org.omg.dds.topic.Topic, org.omg.dds.topic.ContentFilteredTopic, and org.omg.dds.topic.MultiTopic.
DataState withAnyViewState()
Add all org.omg.dds.sub.ViewState values to this DataState.
Set< InstanceState > getInstanceStates()
Get the current set of instance states.
DataState with(SampleState state)
Add the given org.omg.dds.sub.SampleState to this DataState.
void closeContainedEntities()
This operation closes all the entities that were created by means of the "create" operations on the S...
Status is the abstract root class for all communication status objects.
Definition: Status.java:41