OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
PublicationBuiltinTopicDataImpl.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;
33 import org.omg.dds.core.policy.Lifespan;
42 import org.omg.dds.core.policy.UserData;
53 
54 public class PublicationBuiltinTopicDataImpl implements
56  private static final long serialVersionUID = -6604763092552114237L;
57  private final transient OsplServiceEnvironment environment;
58  private DDS.PublicationBuiltinTopicData old;
59  private BuiltinTopicKey key;
60  private BuiltinTopicKey participantKey;
61  private final TypeConsistencyEnforcement typeConsistency;
62  private final DataRepresentation dataRepresentation;
63 
65  DDS.PublicationBuiltinTopicData old) {
66  this.environment = environment;
67  this.old = old;
68  this.key = new BuiltinTopicKeyImpl(this.environment, old.key);
69  this.participantKey = new BuiltinTopicKeyImpl(this.environment,
70  old.participant_key);
71  this.dataRepresentation = new DataRepresentationImpl(this.environment,
73  this.typeConsistency = new TypeConsistencyEnforcementImpl(
74  this.environment, Kind.EXACT_TYPE_TYPE_CONSISTENCY);
75 
76  }
77 
78  @Override
80  return this.environment;
81  }
82 
83  @Override
85  return this.key;
86  }
87 
88  @Override
90  return this.participantKey;
91  }
92 
93  @Override
94  public String getTopicName() {
95  return old.topic_name;
96  }
97 
98  @Override
99  public String getTypeName() {
100  return old.type_name;
101  }
102 
103  @Override
104  public List<String> getEquivalentTypeName() {
105  throw new UnsupportedOperationExceptionImpl(this.environment,
106  "PublicationBuiltinTopicData.getEquivalentTypeName() not supported.");
107  }
108 
109  @Override
110  public List<String> getBaseTypeName() {
111  throw new UnsupportedOperationExceptionImpl(this.environment,
112  "PublicationBuiltinTopicData.getBaseTypeName() not supported.");
113  }
114 
115  @Override
116  public TypeObject getType() {
117  throw new UnsupportedOperationExceptionImpl(this.environment,
118  "PublicationBuiltinTopicData.getType() not supported.");
119  }
120 
121  @Override
123  return PolicyConverter.convert(this.environment, old.durability);
124  }
125 
126  @Override
128  // TODO: Fix Java 5 PSM specification; DurabilityServiceQos is NOT part
129  // of DataWriterQos
131  this.environment,
132  "Java 5 PSM specification issue; DurabilityServiceQos is only part of the TopicQos not of DataWriterQos.");
133  }
134 
135  @Override
137  return PolicyConverter.convert(this.environment, old.deadline);
138  }
139 
140  @Override
142  return PolicyConverter.convert(this.environment, old.latency_budget);
143  }
144 
145  @Override
147  return PolicyConverter.convert(this.environment, old.liveliness);
148  }
149 
150  @Override
152  return PolicyConverter.convert(this.environment, old.reliability);
153  }
154 
155  @Override
157  return PolicyConverter.convert(this.environment, old.lifespan);
158  }
159 
160  @Override
162  return PolicyConverter.convert(this.environment, old.user_data);
163  }
164 
165  @Override
167  return PolicyConverter.convert(this.environment, old.ownership);
168  }
169 
170  @Override
172  return PolicyConverter
173  .convert(this.environment, old.ownership_strength);
174  }
175 
176  @Override
178  return PolicyConverter.convert(this.environment, old.destination_order);
179  }
180 
181  @Override
183  return PolicyConverter.convert(this.environment, old.presentation);
184  }
185 
186  @Override
188  return PolicyConverter.convert(this.environment, old.partition);
189  }
190 
191  @Override
193  return PolicyConverter.convert(this.environment, old.topic_data);
194  }
195 
196  @Override
198  return PolicyConverter.convert(this.environment, old.group_data);
199  }
200 
201  @Override
203  return this.dataRepresentation;
204  }
205 
206  @Override
208  return this.typeConsistency;
209  }
210 
211  @Override
213  if (src == null) {
214  throw new IllegalArgumentExceptionImpl(this.environment,
215  "Invalid PublicationBuiltinTopicData (null) provided.");
216  }
217  try {
219  this.old = impl.old;
220  this.key = new BuiltinTopicKeyImpl(this.environment, this.old.key);
221  this.participantKey = new BuiltinTopicKeyImpl(this.environment,
222  this.old.participant_key);
223  } catch (ClassCastException e) {
225  this.environment,
226  "PublicationBuiltinTopicData.copyFrom() on non-OpenSplice PublicationBuiltinTopicData implementation is not supported.");
227  }
228  }
229 
230  @Override
232  return new PublicationBuiltinTopicDataImpl(this.environment, this.old);
233  }
234 
235 }
Specifies the configuration of the durability service.
[optional] Specifies the value of the "strength" used to arbitrate among multiple org...
void copyFrom(PublicationBuiltinTopicData src)
Overwrite the state of this object with that of the given object.
Specifies the maximum acceptable delay from the time the data is written until the data is inserted i...
PublicationBuiltinTopicDataImpl(OsplServiceEnvironment environment, DDS.PublicationBuiltinTopicData old)
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
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).
The DCPSPublication topic communicates the existence of datawriters by means of the PublicationBuilti...
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
This QosPolicy specifies whether a DataWriter exclusively may own an instance.
Definition: Ownership.java:63
Specifies the maximum duration of validity of the data written by the org.omg.dds.pub.DataWriter.
Definition: Lifespan.java:57
User data not known by the middleware, but distributed by means of built-in topics.
Definition: TopicData.java:42