OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
SubscriptionBuiltinTopicDataImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2024 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 package org.opensplice.dds.topic;
22 
23 import java.util.List;
24 
27 import org.omg.dds.core.policy.Deadline;
40 import org.omg.dds.core.policy.UserData;
51 
52 public class SubscriptionBuiltinTopicDataImpl implements
54  private static final long serialVersionUID = -6604763092552114237L;
55  private final transient OsplServiceEnvironment environment;
56  private DDS.SubscriptionBuiltinTopicData old;
57  private BuiltinTopicKey key;
58  private BuiltinTopicKey participantKey;
59  private final TypeConsistencyEnforcement typeConsistency;
60  private final DataRepresentation dataRepresentation;
61 
63  DDS.SubscriptionBuiltinTopicData old) {
64  this.environment = environment;
65  this.old = old;
66  this.key = new BuiltinTopicKeyImpl(this.environment, old.key);
67  this.participantKey = new BuiltinTopicKeyImpl(this.environment,
68  old.participant_key);
69  this.dataRepresentation = new DataRepresentationImpl(this.environment,
71  this.typeConsistency = new TypeConsistencyEnforcementImpl(
72  this.environment, Kind.EXACT_TYPE_TYPE_CONSISTENCY);
73  }
74 
75  @Override
77  return this.environment;
78  }
79 
80  @Override
82  return this.key;
83  }
84 
85  @Override
87  return this.participantKey;
88  }
89 
90  @Override
91  public String getTopicName() {
92  return this.old.topic_name;
93  }
94 
95  @Override
96  public String getTypeName() {
97  return this.old.type_name;
98  }
99 
100  @Override
101  public List<String> getEquivalentTypeName() {
102  throw new UnsupportedOperationExceptionImpl(this.environment,
103  "SubscriptionBuiltinTopicData.getEquivalentTypeName() not supported.");
104  }
105 
106  @Override
107  public List<String> getBaseTypeName() {
108  throw new UnsupportedOperationExceptionImpl(this.environment,
109  "SubscriptionBuiltinTopicData.getBaseTypeName() not supported.");
110  }
111 
112  @Override
113  public TypeObject getType() {
114  throw new UnsupportedOperationExceptionImpl(this.environment,
115  "SubscriptionBuiltinTopicData.getType() not supported.");
116  }
117 
118  @Override
120  return PolicyConverter.convert(this.environment, old.durability);
121  }
122 
123  @Override
125  return PolicyConverter.convert(this.environment, old.deadline);
126  }
127 
128  @Override
130  return PolicyConverter.convert(this.environment, old.latency_budget);
131  }
132 
133  @Override
135  return PolicyConverter.convert(this.environment, old.liveliness);
136  }
137 
138  @Override
140  return PolicyConverter.convert(this.environment, old.reliability);
141  }
142 
143  @Override
145  return PolicyConverter.convert(this.environment, old.ownership);
146  }
147 
148  @Override
150  return PolicyConverter.convert(this.environment, old.destination_order);
151  }
152 
153  @Override
155  return PolicyConverter.convert(this.environment, old.user_data);
156  }
157 
158  @Override
160  return PolicyConverter.convert(this.environment, old.time_based_filter);
161  }
162 
163  @Override
165  return PolicyConverter.convert(this.environment, old.presentation);
166  }
167 
168  @Override
170  return PolicyConverter.convert(this.environment, old.partition);
171  }
172 
173  @Override
175  return PolicyConverter.convert(this.environment, old.topic_data);
176  }
177 
178  @Override
180  return PolicyConverter.convert(this.environment, old.group_data);
181  }
182 
183  @Override
185  return this.dataRepresentation;
186  }
187 
188  @Override
190  return this.typeConsistency;
191  }
192 
193  @Override
195  if (src == null) {
196  throw new IllegalArgumentExceptionImpl(this.environment,
197  "Invalid SubscriptionBuiltinTopicData (null) provided.");
198  }
199  try {
201  this.old = impl.old;
202  this.key = new BuiltinTopicKeyImpl(this.environment, this.old.key);
203  this.participantKey = new BuiltinTopicKeyImpl(this.environment,
204  this.old.participant_key);
205  } catch (ClassCastException e) {
207  this.environment,
208  "SubscriptionBuiltinTopicData.copyFrom() on non-OpenSplice SubscriptionBuiltinTopicData implementation is not supported.");
209  }
210  }
211 
212  @Override
214  return new SubscriptionBuiltinTopicDataImpl(this.environment, this.old);
215  }
216 }
Specifies the maximum acceptable delay from the time the data is written until the data is inserted i...
Filter that allows a org.omg.dds.sub.DataReader to specify that it is interested only in (potentially...
User data not known by the middleware, but distributed by means of built-in topics.
Definition: UserData.java:48
This policy allows the introduction of a logical partition concept inside the "physical" partition in...
Definition: Partition.java:86
void copyFrom(SubscriptionBuiltinTopicData src)
Overwrite the state of this object with that of the given object.
The DCPSSubscription topic communicates the existence of datareaders by means of the SubscriptionBuil...
Specifies how the samples representing changes to data instances are presented to the subscribing app...
User data not known by the middleware, but distributed by means of built-in topics.
Definition: GroupData.java:44
static DDS.UserDataQosPolicy convert(OsplServiceEnvironment env, UserData p)
Determines the mechanism and parameters used by the application to determine whether an org...
Controls the criteria used to determine the logical order among changes made by org.omg.dds.pub.Publisher entities to the same instance of data (i.e., matching Topic and key).
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
Objects of this type are immutable.
Definition: TypeObject.java:33
This policy indicates the level of reliability requested by a org.omg.dds.sub.DataReader or offered b...
This policy expresses if the data should "outlive" their writing time.
org.omg.dds.sub.DataReader expects a new sample updating the value of each instance at least once eve...
Definition: Deadline.java:92
SubscriptionBuiltinTopicDataImpl(OsplServiceEnvironment environment, DDS.SubscriptionBuiltinTopicData old)
This QosPolicy specifies whether a DataWriter exclusively may own an instance.
Definition: Ownership.java:63
User data not known by the middleware, but distributed by means of built-in topics.
Definition: TopicData.java:42