OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
TopicBuiltinTopicDataImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 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;
31 import org.omg.dds.core.policy.History;
33 import org.omg.dds.core.policy.Lifespan;
51 
53  private static final long serialVersionUID = 4997312302065915561L;
54  private final transient OsplServiceEnvironment environment;
55  private DDS.TopicBuiltinTopicData old;
56  private BuiltinTopicKey key;
57  private final TypeConsistencyEnforcement typeConsistency;
58  private final DataRepresentation dataRepresentation;
59 
61  DDS.TopicBuiltinTopicData old) {
62  this.environment = environment;
63  this.old = old;
64  this.key = new BuiltinTopicKeyImpl(this.environment, old.key);
65  this.dataRepresentation = new DataRepresentationImpl(this.environment,
67  this.typeConsistency = new TypeConsistencyEnforcementImpl(
68  this.environment, Kind.EXACT_TYPE_TYPE_CONSISTENCY);
69  }
70 
71  @Override
73  return this.environment;
74  }
75 
76  @Override
78  return this.key;
79  }
80 
81  @Override
82  public String getName() {
83  return this.old.name;
84  }
85 
86  @Override
87  public String getTypeName() {
88  return this.old.type_name;
89  }
90 
91  @Override
92  public List<String> getEquivalentTypeName() {
93  throw new UnsupportedOperationExceptionImpl(this.environment,
94  "TopicBuiltinTopicData.getEquivalentTypeName() not supported.");
95  }
96 
97  @Override
98  public List<String> getBaseTypeName() {
99  throw new UnsupportedOperationExceptionImpl(this.environment,
100  "TopicBuiltinTopicData.getBaseTypeName() not supported.");
101  }
102 
103  @Override
104  public TypeObject getType() {
105  throw new UnsupportedOperationExceptionImpl(this.environment,
106  "TopicBuiltinTopicData.getType() not supported.");
107  }
108 
109  @Override
111  return PolicyConverter.convert(this.environment, old.durability);
112  }
113 
114  @Override
116  return PolicyConverter
117  .convert(this.environment, old.durability_service);
118  }
119 
120  @Override
122  return PolicyConverter.convert(this.environment, old.deadline);
123  }
124 
125  @Override
127  return PolicyConverter.convert(this.environment, old.latency_budget);
128  }
129 
130  @Override
132  return PolicyConverter.convert(this.environment, old.liveliness);
133  }
134 
135  @Override
137  return PolicyConverter.convert(this.environment, old.reliability);
138  }
139 
140  @Override
142  return PolicyConverter
143  .convert(this.environment, old.transport_priority);
144  }
145 
146  @Override
148  return PolicyConverter.convert(this.environment, old.lifespan);
149  }
150 
151  @Override
153  return PolicyConverter.convert(this.environment, old.destination_order);
154  }
155 
156  @Override
157  public History getHistory() {
158  return PolicyConverter.convert(this.environment, old.history);
159  }
160 
161  @Override
163  return PolicyConverter.convert(this.environment, old.resource_limits);
164  }
165 
166  @Override
168  return PolicyConverter.convert(this.environment, old.ownership);
169  }
170 
171  @Override
173  return PolicyConverter.convert(this.environment, old.topic_data);
174  }
175 
176  @Override
178  return this.dataRepresentation;
179  }
180 
181  @Override
183  return this.typeConsistency;
184  }
185 
186  @Override
187  public void copyFrom(TopicBuiltinTopicData src) {
188  if (src == null) {
189  throw new IllegalArgumentExceptionImpl(this.environment,
190  "Invalid TopicBuiltinTopicData (null) provided.");
191  }
192  try {
194  this.old = impl.old;
195  this.key = new BuiltinTopicKeyImpl(this.environment, this.old.key);
196  } catch (ClassCastException e) {
198  this.environment,
199  "TopicBuiltinTopicData.copyFrom() on non-OpenSplice TopicBuiltinTopicData implementation is not supported.");
200  }
201  }
202 
203  @Override
205  return new TopicBuiltinTopicDataImpl(this.environment, this.old);
206  }
207 }
Specifies the configuration of the durability service.
The DCPSTopic topic communicates the existence of topics by means of the TopicBuiltinTopicData dataty...
Specifies the maximum acceptable delay from the time the data is written until the data is inserted i...
void copyFrom(TopicBuiltinTopicData src)
Overwrite the state of this object with that of the given object.
static DDS.UserDataQosPolicy convert(OsplServiceEnvironment env, UserData p)
TopicBuiltinTopicDataImpl(OsplServiceEnvironment environment, DDS.TopicBuiltinTopicData old)
Determines the mechanism and parameters used by the application to determine whether an org...
This policy is a hint to the infrastructure as to how to set the priority of the underlying transport...
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
Specifies the resources that the Service can consume in order to meet the requested QoS...
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
Specifies the behavior of the Service in the case where the value of a sample changes (one or more ti...
Definition: History.java:76