21 package org.opensplice.dds.core.status;
23 import java.util.ArrayList;
24 import java.util.Arrays;
25 import java.util.Collection;
26 import java.util.HashSet;
27 import java.util.Iterator;
75 import DDS.SampleRejectedStatusKind;
78 private static boolean stateTest(
int state,
int mask) {
79 return (((state) & (mask)) == mask) ? true :
false;
84 HashSet<Class<? extends Status>> statuses =
new HashSet<Class<? extends Status>>();
86 if (state == DDS.STATUS_MASK_ANY_V1_2.value) {
102 if (stateTest(state, DDS.ALL_DATA_DISPOSED_TOPIC_STATUS.value)) {
105 if (stateTest(state, DDS.DATA_AVAILABLE_STATUS.value)) {
108 if (stateTest(state, DDS.DATA_ON_READERS_STATUS.value)) {
111 if (stateTest(state, DDS.INCONSISTENT_TOPIC_STATUS.value)) {
114 if (stateTest(state, DDS.LIVELINESS_CHANGED_STATUS.value)) {
117 if (stateTest(state, DDS.LIVELINESS_LOST_STATUS.value)) {
120 if (stateTest(state, DDS.OFFERED_DEADLINE_MISSED_STATUS.value)) {
123 if (stateTest(state, DDS.OFFERED_INCOMPATIBLE_QOS_STATUS.value)) {
126 if (stateTest(state, DDS.PUBLICATION_MATCHED_STATUS.value)) {
129 if (stateTest(state, DDS.REQUESTED_DEADLINE_MISSED_STATUS.value)) {
132 if (stateTest(state, DDS.REQUESTED_INCOMPATIBLE_QOS_STATUS.value)) {
135 if (stateTest(state, DDS.SAMPLE_LOST_STATUS.value)) {
138 if (stateTest(state, DDS.SAMPLE_REJECTED_STATUS.value)) {
141 if (stateTest(state, DDS.SUBSCRIPTION_MATCHED_STATUS.value)) {
149 Class<? extends Status>... statuses) {
154 return DDS.STATUS_MASK_ANY_V1_2.value;
158 Collection<Class<? extends Status>> statuses) {
161 if (statuses == null) {
162 return DDS.STATUS_MASK_ANY_V1_2.value;
163 }
else if (statuses.size() == 0) {
164 return DDS.STATUS_MASK_NONE.value;
165 }
else if (statuses.size() == 1 && statuses.iterator().next() == null) {
166 return DDS.STATUS_MASK_ANY_V1_2.value;
168 mask = DDS.STATUS_MASK_NONE.value;
170 for (Class<? extends Status> clz : statuses) {
173 "Passed illegal <null> status.");
175 mask |= DDS.DATA_AVAILABLE_STATUS.value;
177 mask |= DDS.INCONSISTENT_TOPIC_STATUS.value;
179 mask |= DDS.OFFERED_DEADLINE_MISSED_STATUS.value;
181 mask |= DDS.REQUESTED_DEADLINE_MISSED_STATUS.value;
183 mask |= DDS.OFFERED_INCOMPATIBLE_QOS_STATUS.value;
185 mask |= DDS.REQUESTED_INCOMPATIBLE_QOS_STATUS.value;
187 mask |= DDS.SAMPLE_LOST_STATUS.value;
189 mask |= DDS.SAMPLE_REJECTED_STATUS.value;
191 mask |= DDS.DATA_ON_READERS_STATUS.value;
193 mask |= DDS.LIVELINESS_LOST_STATUS.value;
195 mask |= DDS.LIVELINESS_CHANGED_STATUS.value;
197 mask |= DDS.PUBLICATION_MATCHED_STATUS.value;
199 mask |= DDS.SUBSCRIPTION_MATCHED_STATUS.value;
201 mask |= DDS.ALL_DATA_DISPOSED_TOPIC_STATUS.value;
202 }
else if (clz.equals(
Status.class)) {
204 "Provided class does not extend from the org.omg.dds.core.status.Status class.");
207 "Found illegal Class<? extends Status>: " 215 DDS.QosPolicyCount[] old) {
216 Class<? extends QosPolicy> policyClass;
217 ArrayList<QosPolicyCountImpl> policies =
new ArrayList<QosPolicyCountImpl>();
219 for (
int i = 0; i < old.length; i++) {
222 if (policyClass != null) {
223 if (old[i].count != 0) {
233 Class<? extends QosPolicy> policy) {
236 if (policy.equals(
Deadline.class)) {
237 id = DDS.DEADLINE_QOS_POLICY_ID.value;
239 id = DDS.DESTINATIONORDER_QOS_POLICY_ID.value;
241 id = DDS.DURABILITYSERVICE_QOS_POLICY_ID.value;
243 id = DDS.ENTITYFACTORY_QOS_POLICY_ID.value;
244 }
else if (policy.equals(
GroupData.class)) {
245 id = DDS.GROUPDATA_QOS_POLICY_ID.value;
246 }
else if (policy.equals(
History.class)) {
247 id = DDS.HISTORY_QOS_POLICY_ID.value;
249 id = DDS.LATENCYBUDGET_QOS_POLICY_ID.value;
250 }
else if (policy.equals(
Lifespan.class)) {
251 id = DDS.LIFESPAN_QOS_POLICY_ID.value;
253 id = DDS.LIVELINESS_QOS_POLICY_ID.value;
254 }
else if (policy.equals(
Ownership.class)) {
255 id = DDS.OWNERSHIP_QOS_POLICY_ID.value;
256 }
else if (policy.equals(
Partition.class)) {
257 id = DDS.PARTITION_QOS_POLICY_ID.value;
259 id = DDS.PRESENTATION_QOS_POLICY_ID.value;
261 id = DDS.READERDATALIFECYCLE_QOS_POLICY_ID.value;
263 id = DDS.RELIABILITY_QOS_POLICY_ID.value;
265 id = DDS.RESOURCELIMITS_QOS_POLICY_ID.value;
267 id = DDS.SCHEDULING_QOS_POLICY_ID.value;
269 id = DDS.TIMEBASEDFILTER_QOS_POLICY_ID.value;
270 }
else if (policy.equals(
TopicData.class)) {
271 id = DDS.TOPICDATA_QOS_POLICY_ID.value;
273 id = DDS.TRANSPORTPRIORITY_QOS_POLICY_ID.value;
274 }
else if (policy.equals(
UserData.class)) {
275 id = DDS.USERDATA_QOS_POLICY_ID.value;
277 id = DDS.WRITERDATALIFECYCLE_QOS_POLICY_ID.value;
280 "Found illegal QoSPolicy: " + policy.getName());
286 Set<QosPolicyCount> count) {
287 DDS.QosPolicyCount[] old =
new DDS.QosPolicyCount[count.size()];
288 Iterator<QosPolicyCount> iter = count.iterator();
291 for (
int i = 0; i < count.size(); i++) {
292 current = iter.next();
293 old[i] =
new DDS.QosPolicyCount(
convert(env,
300 DDS.InconsistentTopicStatus old) {
302 old.total_count_change);
305 public static DDS.InconsistentTopicStatus
convert(
307 return new DDS.InconsistentTopicStatus(status.
getTotalCount(),
312 DDS.AllDataDisposedTopicStatus old) {
314 old.total_count_change);
317 public static DDS.AllDataDisposedTopicStatus
convert(
319 return new DDS.AllDataDisposedTopicStatus(status.
getTotalCount(),
324 DDS.LivelinessChangedStatus old) {
326 old.alive_count_change, old.not_alive_count,
328 old.last_publication_handle));
331 public static DDS.LivelinessChangedStatus
convert(
333 return new DDS.LivelinessChangedStatus(status.
getAliveCount(),
340 DDS.LivelinessLostStatus old) {
342 old.total_count_change);
355 old.last_instance_handle));
358 public static DDS.OfferedDeadlineMissedStatus
convert(
360 return new DDS.OfferedDeadlineMissedStatus(status.
getTotalCount(),
370 old.last_policy_id),
convert(env, old.policies));
373 public static DDS.OfferedIncompatibleQosStatus
convert(
375 return new DDS.OfferedIncompatibleQosStatus(status.
getTotalCount(),
382 DDS.PublicationMatchedStatus old) {
385 old.total_count_change, old.current_count,
387 old.last_subscription_handle));
390 public static DDS.PublicationMatchedStatus
convert(
392 return new DDS.PublicationMatchedStatus(status.
getTotalCount(),
402 old.last_instance_handle));
405 public static DDS.RequestedDeadlineMissedStatus
convert(
407 return new DDS.RequestedDeadlineMissedStatus(status.
getTotalCount(),
413 DDS.SampleRejectedStatus old) {
416 switch (old.last_reason.value()) {
417 case SampleRejectedStatusKind._NOT_REJECTED:
420 case SampleRejectedStatusKind._REJECTED_BY_INSTANCES_LIMIT:
423 case SampleRejectedStatusKind._REJECTED_BY_SAMPLES_LIMIT:
426 case SampleRejectedStatusKind._REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT:
431 "Found illegal SampleRejectedStatus.Kind " 432 + old.last_reason.value());
436 old.last_instance_handle));
441 DDS.SampleRejectedStatusKind kind;
445 kind = DDS.SampleRejectedStatusKind.NOT_REJECTED;
447 case REJECTED_BY_INSTANCES_LIMIT:
448 kind = DDS.SampleRejectedStatusKind.REJECTED_BY_INSTANCES_LIMIT;
450 case REJECTED_BY_SAMPLES_LIMIT:
451 kind = DDS.SampleRejectedStatusKind.REJECTED_BY_SAMPLES_LIMIT;
453 case REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT:
454 kind = DDS.SampleRejectedStatusKind.REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT;
458 "Found illegal SampleRejectedStatus.Kind");
470 old.last_policy_id),
convert(env, old.policies));
473 public static DDS.RequestedIncompatibleQosStatus
convert(
475 return new DDS.RequestedIncompatibleQosStatus(status.
getTotalCount(),
482 DDS.SubscriptionMatchedStatus old) {
485 old.total_count_change, old.current_count,
487 old.last_publication_handle));
490 public static DDS.SubscriptionMatchedStatus
convert(
492 return new DDS.SubscriptionMatchedStatus(status.
getTotalCount(),
499 DDS.SampleLostStatus old) {
501 old.total_count_change);
A sample has been lost (never received).
abstract int getTotalCount()
Total cumulative count the concerned org.omg.dds.sub.DataReader discovered a "match" with a org...
abstract int getTotalCountChange()
The change in totalCount since the last time the listener was called or the status was read...
This class contains the statistics about the discovered number of org.omg.dds.sub.DataReaders that are compatible with the org.omg.dds.pub.DataWriter to which the Status is attached.
static DDS.InconsistentTopicStatus convert(OsplServiceEnvironment env, InconsistentTopicStatus status)
Specifies the behavior of the org.omg.dds.sub.DataReader with regards to the life cycle of the data i...
abstract int getTotalCountChange()
The incremental number of samples rejected since the last time the listener was called or the status ...
abstract Class<? extends QosPolicy > getLastPolicyClass()
The class of one of the policies that was found to be incompatible the last time an incompatibility w...
abstract int getTotalCount()
Total cumulative number of offered deadline periods elapsed during which a DataWriter failed to provi...
abstract int getTotalCount()
Total cumulative count of samples rejected by the org.omg.dds.sub.DataReader.
abstract InstanceHandle getLastInstanceHandle()
Handle to the last instance in the org.omg.dds.pub.DataWriter for which an offered deadline was misse...
REJECTED_BY_SAMPLES_LIMIT
static DDS.OfferedDeadlineMissedStatus convert(OsplServiceEnvironment env, OfferedDeadlineMissedStatus status)
static DDS.QosPolicyCount [] convert(OsplServiceEnvironment env, Set< QosPolicyCount > count)
Specifies the behavior of the org.omg.dds.pub.DataWriter with regards to the life cycle of the data i...
static RequestedIncompatibleQosStatus convert(OsplServiceEnvironment env, DDS.RequestedIncompatibleQosStatus old)
Specifies the maximum acceptable delay from the time the data is written until the data is inserted i...
static int convertMask(OsplServiceEnvironment env, Collection< Class<? extends Status >> statuses)
Filter that allows a org.omg.dds.sub.DataReader to specify that it is interested only in (potentially...
abstract int getAliveCountChange()
The change in the aliveCount since the last time the listener was called or the status was read...
static InconsistentTopicStatus convert(OsplServiceEnvironment env, DDS.InconsistentTopicStatus old)
abstract int getTotalCount()
Total cumulative number of missed deadlines detected for any instance read by the org...
abstract int getTotalCount()
Total cumulative number of times the concerned org.omg.dds.sub.DataReader discovered a org...
abstract int getTotalCountChange()
The incremental number of deadlines detected since the last time the listener was called or the statu...
abstract Set< QosPolicyCount > getPolicies()
A list containing for each policy the total number of times that the concerned org.omg.dds.pub.DataWriter discovered a org.omg.dds.sub.DataReader for the same org.omg.dds.topic.Topic with a requested QoS that is incompatible with that offered by the DataWriter.
abstract int getTotalCountChange()
The incremental number of samples lost since the last time the listener was called or the status was ...
static DDS.RequestedIncompatibleQosStatus convert(OsplServiceEnvironment env, RequestedIncompatibleQosStatus status)
abstract int getCurrentCount()
The number of org.omg.dds.sub.DataReaders currently matched to the concerned org.omg.dds.pub.DataWriter.
abstract int getTotalCount()
Total cumulative count of the times all instances for the corresponding org.omg.dds.topic.Topic have been disposed.
static LivelinessLostStatus convert(OsplServiceEnvironment env, DDS.LivelinessLostStatus old)
abstract int getNotAliveCount()
The total count of currently org.omg.dds.pub.DataWriters that write the org.omg.dds.topic.Topic read by the org.omg.dds.sub.DataReader that are no longer asserting their liveliness.
static DDS.LivelinessLostStatus convert(OsplServiceEnvironment env, LivelinessLostStatus status)
static DDS.SubscriptionMatchedStatus convert(OsplServiceEnvironment env, SubscriptionMatchedStatus status)
User data not known by the middleware, but distributed by means of built-in topics.
abstract int getCurrentCountChange()
The change in currentCount since the last time the listener was called or the status was read...
static SampleLostStatus convert(OsplServiceEnvironment env, DDS.SampleLostStatus old)
abstract InstanceHandle getLastPublicationHandle()
Handle to the last org.omg.dds.pub.DataWriter whose change in liveliness caused this status to change...
static RequestedDeadlineMissedStatus convert(OsplServiceEnvironment env, DDS.RequestedDeadlineMissedStatus old)
static DDS.Duration_t convert(OsplServiceEnvironment environment, Duration d)
abstract int getTotalCount()
Total cumulative count of the org.omg.dds.topic.Topics discovered whose name matches the Topic to whi...
abstract InstanceHandle getLastPublicationHandle()
Handle to the last org.omg.dds.pub.DataWriter that matched the org.omg.dds.sub.DataReader, causing the status to change.
abstract Kind getLastReason()
Reason for rejecting the last sample rejected.
This policy allows the introduction of a logical partition concept inside the "physical" partition in...
abstract Class<? extends QosPolicy > getLastPolicyClass()
The class of one of the policies that was found to be incompatible the last time an incompatibility w...
Class<? extends QosPolicy > getPolicyClass()
abstract InstanceHandle getLastInstanceHandle()
Handle to the instance being updated by the last sample that was rejected.
static QosPolicyCount [] convert(OsplServiceEnvironment env, DDS.QosPolicyCount[] old)
abstract int getTotalCountChange()
The change in totalCount since the last time the listener was called or the status was read...
static OfferedIncompatibleQosStatus convert(OsplServiceEnvironment env, DDS.OfferedIncompatibleQosStatus old)
static LivelinessChangedStatus convert(OsplServiceEnvironment env, DDS.LivelinessChangedStatus old)
abstract int getTotalCount()
Total cumulative count of all samples lost across all instances of data published under the org...
static SubscriptionMatchedStatus convert(OsplServiceEnvironment env, DDS.SubscriptionMatchedStatus old)
static int convertMask(OsplServiceEnvironment env, Class<? extends Status >... statuses)
static DDS.AllDataDisposedTopicStatus convert(OsplServiceEnvironment env, AllDataDisposedStatus status)
static Set< Class<? extends Status > > convertMask(OsplServiceEnvironment environment, int state)
The liveliness that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Liveliness was not respected; thus org.omg.dds.sub.DataReader entities will consider the DataWriter as no longer "active.".
REJECTED_BY_INSTANCES_LIMIT
static DDS.LivelinessChangedStatus convert(OsplServiceEnvironment env, LivelinessChangedStatus status)
static PublicationMatchedStatus convert(OsplServiceEnvironment env, DDS.PublicationMatchedStatus old)
abstract int getTotalCountChange()
The change in totalCcount since the last time the listener was called or the status was read...
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.
static DDS.UserDataQosPolicy convert(OsplServiceEnvironment env, UserData p)
A org.omg.dds.core.policy.QosPolicy value was incompatible with what is offered.
This QosPolicy specifies the scheduling parameters that will be used for a thread that is spawned by ...
abstract int getTotalCount()
Total cumulative count the concerned org.omg.dds.pub.DataWriter discovered a "match" with a org...
All instances for one or more org.omg.dds.topic.Topics have been disposed through org...
static int convert(OsplServiceEnvironment env, Class<? extends QosPolicy > policy)
static SampleRejectedStatus convert(OsplServiceEnvironment env, DDS.SampleRejectedStatus old)
abstract int getAliveCount()
The total number of currently active org.omg.dds.pub.DataWriters that write the Topic read by the org...
There is new data in one of the DataReaders of the Subscriber.
Determines the mechanism and parameters used by the application to determine whether an org...
This class contains the statistics about the discovered number of org.omg.dds.pub.DataWriters that are compatible with the org.omg.dds.sub.DataReader to which the Status is attached.
This policy is a hint to the infrastructure as to how to set the priority of the underlying transport...
abstract Set< QosPolicyCount > getPolicies()
A list containing for each policy the total number of times that the concerned org.omg.dds.sub.DataReader discovered a org.omg.dds.pub.DataWriter for the same org.omg.dds.topic.Topic with an offered QoS that is incompatible with that requested by the DataReader.
This class is the abstract root for all the QoS policies.
abstract InstanceHandle getLastInstanceHandle()
Handle to the last instance in the org.omg.dds.sub.DataReader for which a deadline was detected...
static DDS.PublicationMatchedStatus convert(OsplServiceEnvironment env, PublicationMatchedStatus status)
abstract int getCurrentCountChange()
The change in currentCount since the last time the listener was called or the status was read...
abstract InstanceHandle getLastSubscriptionHandle()
Handle to the last org.omg.dds.sub.DataReader that matched the org.omg.dds.pub.DataWriter, causing the status to change.
abstract int getNotAliveCountChange()
The change in the notAliveCount since the last time the listener was called or the status was read...
static AllDataDisposedStatus convert(OsplServiceEnvironment env, DDS.AllDataDisposedTopicStatus old)
static DDS.SampleLostStatus convert(SampleLostStatus status)
abstract int getTotalCount()
Total cumulative number of times the concerned org.omg.dds.pub.DataWriter discovered a org...
abstract int getTotalCountChange()
The incremental number of inconsistent topics discovered since the last time the listener was called ...
abstract int getTotalCountChange()
The incremental number of times all instances have been disposed for the corresponding org...
A org.omg.dds.core.policy.QosPolicy value was incompatible with what was requested.
Objects of this type are immutable.
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 liveliness of one or more org.omg.dds.pub.DataWriters that were writing instances read through th...
static DDS.SampleRejectedStatus convert(OsplServiceEnvironment env, SampleRejectedStatus status)
There is new data in the DataReader.
abstract int getTotalCountChange()
The change in totalCount since the last time the listener was called or the status was read...
static DDS.OfferedIncompatibleQosStatus convert(OsplServiceEnvironment env, OfferedIncompatibleQosStatus status)
A (received) sample has been rejected.
Specifies the resources that the Service can consume in order to meet the requested QoS...
abstract int getTotalCountChange()
The change in totalCount since the last time the listener was called or the status was read...
Controls the behavior of the org.omg.dds.core.Entity when acting as a factory for other entities...
The deadline that the org.omg.dds.sub.DataReader was expecting through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.
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.
The deadline that the org.omg.dds.pub.DataWriter has committed through its org.omg.dds.core.policy.Deadline was not respected for a specific instance.
org.omg.dds.sub.DataReader expects a new sample updating the value of each instance at least once eve...
static DDS.RequestedDeadlineMissedStatus convert(OsplServiceEnvironment env, RequestedDeadlineMissedStatus status)
abstract int getCurrentCount()
The number of org.omg.dds.pub.DataWriters currently matched to the concerned org.omg.dds.sub.DataReader.
Another topic exists with the same name but different characteristics.
This QosPolicy specifies whether a DataWriter exclusively may own an instance.
Specifies the maximum duration of validity of the data written by the org.omg.dds.pub.DataWriter.
static OfferedDeadlineMissedStatus convert(OsplServiceEnvironment env, DDS.OfferedDeadlineMissedStatus old)
REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT
abstract int getTotalCount()
Total cumulative number of times that a previously-alive org.omg.dds.pub.DataWriter became not alive ...
Status is the abstract root class for all communication status objects.
User data not known by the middleware, but distributed by means of built-in topics.
abstract int getTotalCountChange()
The change in totalCount since the last time the listener was called or the status was read...
Specifies the behavior of the Service in the case where the value of a sample changes (one or more ti...