diff options
author | rbrooks | 2010-07-24 08:02:08 +0000 |
---|---|---|
committer | rbrooks | 2010-07-24 08:02:08 +0000 |
commit | 4ed8bddc791fda93940f238c5135556a07041dc0 (patch) | |
tree | 64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.ote.messaging.dds/src | |
parent | 542cc7344d3f129d64e47f547384297c8e1b1f43 (diff) | |
download | org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip |
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.ote.messaging.dds/src')
74 files changed, 4476 insertions, 4476 deletions
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Data.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Data.java index cca5dfcb273..a4e45b92cea 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Data.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Data.java @@ -8,45 +8,45 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
+package org.eclipse.osee.ote.messaging.dds; + import java.nio.ByteBuffer; -
-/**
- * Provides the DDS system with a generic means of handling any data type. Any messages
- * that are sent through the system must implement this interface so that the DDS system
- * has a means of handling them in a platform independent manner.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface Data {
-
- /**
- * This method is used to get a byte array representation of the data. This data
- * should be in such a form that it can be passed to the <code>setFromByteArray</code>
- * method to acquire the "same" object.
- *
- * @return A byte array version of the state information for this <code>Data</code>
- */
- public byte[] toByteArray();
- public ByteBuffer toByteBuffer();
- /**
- * This method is used to restore a data item's state from a byte array. This method
- * should work in such a manner that the array received from a <code>Data</code>'s
- * <code>toByteArray</code> method can be passed to this method to construct an object
- * that is the "same".
- *
- * @param input The byte array to build the state information from.
- */
- public void setFromByteArray(byte[] input);
- public void setFromByteBuffer(ByteBuffer buffer);
- public void copyFrom(Data buffer);
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public Object getKeyValue();
- public int getOffset();
-
-}
+ +/** + * Provides the DDS system with a generic means of handling any data type. Any messages + * that are sent through the system must implement this interface so that the DDS system + * has a means of handling them in a platform independent manner. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface Data { + + /** + * This method is used to get a byte array representation of the data. This data + * should be in such a form that it can be passed to the <code>setFromByteArray</code> + * method to acquire the "same" object. + * + * @return A byte array version of the state information for this <code>Data</code> + */ + public byte[] toByteArray(); + public ByteBuffer toByteBuffer(); + /** + * This method is used to restore a data item's state from a byte array. This method + * should work in such a manner that the array received from a <code>Data</code>'s + * <code>toByteArray</code> method can be passed to this method to construct an object + * that is the "same". + * + * @param input The byte array to build the state information from. + */ + public void setFromByteArray(byte[] input); + public void setFromByteBuffer(ByteBuffer buffer); + public void copyFrom(Data buffer); + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public Object getKeyValue(); + public int getOffset(); + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataSample.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataSample.java index e6af3092979..d902b5390a8 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataSample.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataSample.java @@ -8,62 +8,62 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-import java.lang.ref.WeakReference;
-
-import org.eclipse.osee.ote.messaging.dds.entity.SampleInfo;
-
-/**
- * Provides a coupling mechanism for <code>SampleInfo</code> with <code>Data</code> instances.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DataSample {
- private WeakReference<Data> data;
- private SampleInfo sampleInfo;
-
- /**
- * Create a data sample that is used for propogating data through
- * the system.
- *
- * @param data
- * @param sampleInfo
- */
- public DataSample(Data data, SampleInfo sampleInfo) {
- this.data = new WeakReference<Data>(data);
- this.sampleInfo = sampleInfo;
- }
-
- /**
- * Create a data sample that can be used for receiving propogated data.
- *
- * @param data
- */
- public DataSample(Data data) {
- super();
- this.data = new WeakReference<Data>(data);
- this.sampleInfo = new SampleInfo();
- }
- /**
- * @return Returns the data.
- */
- public Data getData() {
- return data.get();
- }
-
- /**
- * @return Returns the sampleInfo.
- */
- public SampleInfo getSampleInfo() {
- return sampleInfo;
- }
-
- /**
- * @param sourceSampleInfo The sampleInfo to set.
- */
- public void setSampleInfo(SampleInfo sourceSampleInfo) {
- sampleInfo.copyFrom(sourceSampleInfo);
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +import java.lang.ref.WeakReference; + +import org.eclipse.osee.ote.messaging.dds.entity.SampleInfo; + +/** + * Provides a coupling mechanism for <code>SampleInfo</code> with <code>Data</code> instances. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DataSample { + private WeakReference<Data> data; + private SampleInfo sampleInfo; + + /** + * Create a data sample that is used for propogating data through + * the system. + * + * @param data + * @param sampleInfo + */ + public DataSample(Data data, SampleInfo sampleInfo) { + this.data = new WeakReference<Data>(data); + this.sampleInfo = sampleInfo; + } + + /** + * Create a data sample that can be used for receiving propogated data. + * + * @param data + */ + public DataSample(Data data) { + super(); + this.data = new WeakReference<Data>(data); + this.sampleInfo = new SampleInfo(); + } + /** + * @return Returns the data. + */ + public Data getData() { + return data.get(); + } + + /** + * @return Returns the sampleInfo. + */ + public SampleInfo getSampleInfo() { + return sampleInfo; + } + + /** + * @param sourceSampleInfo The sampleInfo to set. + */ + public void setSampleInfo(SampleInfo sourceSampleInfo) { + sampleInfo.copyFrom(sourceSampleInfo); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataStoreItem.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataStoreItem.java index 579651668a0..d1a89de5cff 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataStoreItem.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/DataStoreItem.java @@ -8,55 +8,55 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.service.TopicDescription;
-
-/**
- * Provides a coupling of items used for propogating the publication of data.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DataStoreItem {
- private final DataSample theDataSample;
- private final TopicDescription theTopicDescription;
- private final DataWriter theWriter;
-
- /**
- * Create a new <code>DataStoreItem</code> that stores references to all of the necessary information
- * for the system to propogate the data.
- *
- * @param theData
- * @param theTopicDescription
- * @param theWriter
- */
- public DataStoreItem(DataSample theData, TopicDescription theTopicDescription, DataWriter theWriter) {
- super();
- this.theDataSample = theData;
- this.theTopicDescription = theTopicDescription;
- this.theWriter = theWriter;
- }
-
- /**
- * @return Returns the theData.
- */
- public DataSample getTheDataSample() {
- return theDataSample;
- }
-
- /**
- * @return Returns the theTopic.
- */
- public TopicDescription getTheTopicDescription() {
- return theTopicDescription;
- }
-
- /**
- * @return Returns the theWriter.
- */
- public DataWriter getTheWriter() {
- return theWriter;
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.service.TopicDescription; + +/** + * Provides a coupling of items used for propogating the publication of data. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DataStoreItem { + private final DataSample theDataSample; + private final TopicDescription theTopicDescription; + private final DataWriter theWriter; + + /** + * Create a new <code>DataStoreItem</code> that stores references to all of the necessary information + * for the system to propogate the data. + * + * @param theData + * @param theTopicDescription + * @param theWriter + */ + public DataStoreItem(DataSample theData, TopicDescription theTopicDescription, DataWriter theWriter) { + super(); + this.theDataSample = theData; + this.theTopicDescription = theTopicDescription; + this.theWriter = theWriter; + } + + /** + * @return Returns the theData. + */ + public DataSample getTheDataSample() { + return theDataSample; + } + + /** + * @return Returns the theTopic. + */ + public TopicDescription getTheTopicDescription() { + return theTopicDescription; + } + + /** + * @return Returns the theWriter. + */ + public DataWriter getTheWriter() { + return theWriter; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Duration.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Duration.java index 7e33b5d82d2..0ce024eab67 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Duration.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Duration.java @@ -8,44 +8,44 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * <code>Duration</code> is used to specify a difference in time with
- * nano-second resolution.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class Duration extends Time {
- public final static Duration ZERO_DURATION = new Duration(0, 0);
- private Time startTime;
-
- /**
- * Construct a new <code>Duration</code> with specific values.
- *
- * @param seconds - The number of seconds for the duration.
- * @param nanoSeconds - The number of nano-seconds for the duration.
- */
- public Duration(long seconds, long nanoSeconds) {
- super(seconds, nanoSeconds);
- }
-
- /**
- * Mark an instant in time as a "start" point. This is used in
- * conjunction with the <code>expired()</code> method.
- */
- public void markStart() {
- startTime = new Time();
- }
-
- /**
- * Check if the time specified by this <code>Duration</code> is less
- * than the amount of time since <code>markStart()</code> was called.
- *
- * @return <b>true</b> iff the time since <code>markStart()</code> is greater than this duration.
- */
- public boolean expired() {
- return (new Time().millisSince(startTime) > this.getMilliseconds());
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * <code>Duration</code> is used to specify a difference in time with + * nano-second resolution. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class Duration extends Time { + public final static Duration ZERO_DURATION = new Duration(0, 0); + private Time startTime; + + /** + * Construct a new <code>Duration</code> with specific values. + * + * @param seconds - The number of seconds for the duration. + * @param nanoSeconds - The number of nano-seconds for the duration. + */ + public Duration(long seconds, long nanoSeconds) { + super(seconds, nanoSeconds); + } + + /** + * Mark an instant in time as a "start" point. This is used in + * conjunction with the <code>expired()</code> method. + */ + public void markStart() { + startTime = new Time(); + } + + /** + * Check if the time specified by this <code>Duration</code> is less + * than the amount of time since <code>markStart()</code> was called. + * + * @return <b>true</b> iff the time since <code>markStart()</code> is greater than this duration. + */ + public boolean expired() { + return (new Time().millisSince(startTime) > this.getMilliseconds()); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IDestination.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IDestination.java index 9dc74165826..c9fd02f6288 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IDestination.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IDestination.java @@ -8,12 +8,12 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * @author Ken J. Aguilar
- *
- */
-public interface IDestination {
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * @author Ken J. Aguilar + * + */ +public interface IDestination { + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IOteData.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IOteData.java index ee4adc16bc9..8ae62937c37 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IOteData.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/IOteData.java @@ -1,29 +1,29 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.messaging.dds;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author Ken J. Aguilar
- */
-public interface IOteData extends Data {
- /**
- * signals the end of processing for this data instance. This will return it to the data cache so that it can be
- * reused
- */
- void finish();
-
- /**
- * gets the data buffer associated with this instance.
- */
- ByteBuffer getDataBuffer();
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ote.messaging.dds; + +import java.nio.ByteBuffer; + +/** + * @author Ken J. Aguilar + */ +public interface IOteData extends Data { + /** + * signals the end of processing for this data instance. This will return it to the data cache so that it can be + * reused + */ + void finish(); + + /** + * gets the data buffer associated with this instance. + */ + ByteBuffer getDataBuffer(); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ISource.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ISource.java index 30601da2805..d907512bd1e 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ISource.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ISource.java @@ -8,12 +8,12 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * @author Ken J. Aguilar
- *
- */
-public interface ISource {
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * @author Ken J. Aguilar + * + */ +public interface ISource { + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceHandle.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceHandle.java index 01d445c649f..84ddfe00f36 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceHandle.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceHandle.java @@ -8,17 +8,17 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class InstanceHandle {
- // DONT_NEED this class with the current implemention level of the system
- public void copyFrom(InstanceHandle instanceHandle) {
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class InstanceHandle { + // DONT_NEED this class with the current implemention level of the system + public void copyFrom(InstanceHandle instanceHandle) { + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceStateKind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceStateKind.java index 4911e7896ef..87a3712fa9e 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceStateKind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/InstanceStateKind.java @@ -8,32 +8,32 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * The class which stores all of the available states which an instance can
- * be in. The name of any of the values can be acquired from the <code>getKindName()</code>
- * method inherited from <code>Kind</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.Kind
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class InstanceStateKind extends Kind {
-
- public final static InstanceStateKind ALIVE = new InstanceStateKind("Alive instance state", 1);
- public final static InstanceStateKind NOT_ALIVE_DISPOSED = new InstanceStateKind("Not alive disposed instance state", 2);
- public final static InstanceStateKind NOT_ALIVE_NO_WRITERS = new InstanceStateKind("Not alive no writers instance state", 3);
-
- /**
- * Local constructor for creating <code>InstanceStateKind</code> objects.
- *
- * @param kindName The name of the kind
- * @param kindId The id value of the kind
- */
- private InstanceStateKind(String kindName, long kindId) {
- super(kindName, kindId);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * The class which stores all of the available states which an instance can + * be in. The name of any of the values can be acquired from the <code>getKindName()</code> + * method inherited from <code>Kind</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.Kind + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class InstanceStateKind extends Kind { + + public final static InstanceStateKind ALIVE = new InstanceStateKind("Alive instance state", 1); + public final static InstanceStateKind NOT_ALIVE_DISPOSED = new InstanceStateKind("Not alive disposed instance state", 2); + public final static InstanceStateKind NOT_ALIVE_NO_WRITERS = new InstanceStateKind("Not alive no writers instance state", 3); + + /** + * Local constructor for creating <code>InstanceStateKind</code> objects. + * + * @param kindName The name of the kind + * @param kindId The id value of the kind + */ + private InstanceStateKind(String kindName, long kindId) { + super(kindName, kindId); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Kind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Kind.java index b6141483a5d..a9b41a6b885 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Kind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Kind.java @@ -8,34 +8,34 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * Base class for the various *Kind enumerations specified in the DDS specification. This provides
- * the basic structure and accessor methods that are common for these enumerations.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class Kind{
- private String kindName;
- private long kindId;
-
- /**
- * @param kindName
- * @param kindId
- */
- protected Kind(String kindName, long kindId) {
- super();
- this.kindName = kindName;
- this.kindId = kindId;
- }
-
- public String getKindName() {
- return kindName;
- }
-
- public long getKindId() {
- return kindId;
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * Base class for the various *Kind enumerations specified in the DDS specification. This provides + * the basic structure and accessor methods that are common for these enumerations. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class Kind{ + private String kindName; + private long kindId; + + /** + * @param kindName + * @param kindId + */ + protected Kind(String kindName, long kindId) { + super(); + this.kindName = kindName; + this.kindId = kindId; + } + + public String getKindName() { + return kindName; + } + + public long getKindId() { + return kindId; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/NotImplementedException.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/NotImplementedException.java index 4d92f940e60..360dc201e45 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/NotImplementedException.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/NotImplementedException.java @@ -8,25 +8,25 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * This class is used to mark areas of code that are in the DDS Specification
- * but are not currently implemented.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class NotImplementedException extends RuntimeException {
-
- private static final long serialVersionUID = 8437766402272756599L;
-
- /**
- * Creates a new exception with a message specifying that the given
- * functionality is not implemented.
- */
- public NotImplementedException() {
- super("This functionality has not been implemented");
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * This class is used to mark areas of code that are in the DDS Specification + * but are not currently implemented. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class NotImplementedException extends RuntimeException { + + private static final long serialVersionUID = 8437766402272756599L; + + /** + * Creates a new exception with a message specifying that the given + * functionality is not implemented. + */ + public NotImplementedException() { + super("This functionality has not been implemented"); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ReturnCode.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ReturnCode.java index f41fda65281..8e00f39c30f 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ReturnCode.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ReturnCode.java @@ -8,56 +8,56 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * Provides function status for many of the DDS specification routines. These are used
- * to communicate the result of function calls, and the usage of them is specified in the
- * DDS specification.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class ReturnCode {
- public static final ReturnCode OK = new ReturnCode(1, "Successful return");
- public static final ReturnCode ERROR = new ReturnCode(2, "Generic unspecified error");
- public static final ReturnCode BAD_PARAMETER = new ReturnCode(3, "Illegal parameter value");
- public static final ReturnCode UNSUPPORTED = new ReturnCode(4, "Unsupported operation");
- public static final ReturnCode ALREADY_DELETED = new ReturnCode(5, "The object target of this operation has already been deleted");
- public static final ReturnCode OUT_OF_RESOURCES = new ReturnCode(6, "Service ran out of resources needed to complete the operation");
- public static final ReturnCode NOT_ENABLED = new ReturnCode(7, "Operation invoked on an entity not yet enabled");
- public static final ReturnCode IMMUTABLE_POLICY = new ReturnCode(8, "Application attempted to modify an immutable QoS policy");
- public static final ReturnCode INCONSISTENT_POLICY = new ReturnCode(9, "Application specified a set of polices that are not consistent with each other");
- public static final ReturnCode PRECONDITION_NOT_MET = new ReturnCode(10, "A pre-condition for the operation was not met");
- public static final ReturnCode TIMEOUT = new ReturnCode(11, "The operation timed out");
- public static final ReturnCode NO_DATA = new ReturnCode(12, "Indicates a transient situation where the operation did not return any data but there is no inherent error");
-
- private int value;
- private String description;
-
- /**
- * Creates a new <code>ReturnCode</code> with a given value and description.
- *
- * @param value
- * @param description
- */
- private ReturnCode(int value, String description) {
- super();
- this.value = value;
- this.description = description;
- }
-
- /**
- * @return Returns the description.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @return Returns the value.
- */
- public int getValue() {
- return value;
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * Provides function status for many of the DDS specification routines. These are used + * to communicate the result of function calls, and the usage of them is specified in the + * DDS specification. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class ReturnCode { + public static final ReturnCode OK = new ReturnCode(1, "Successful return"); + public static final ReturnCode ERROR = new ReturnCode(2, "Generic unspecified error"); + public static final ReturnCode BAD_PARAMETER = new ReturnCode(3, "Illegal parameter value"); + public static final ReturnCode UNSUPPORTED = new ReturnCode(4, "Unsupported operation"); + public static final ReturnCode ALREADY_DELETED = new ReturnCode(5, "The object target of this operation has already been deleted"); + public static final ReturnCode OUT_OF_RESOURCES = new ReturnCode(6, "Service ran out of resources needed to complete the operation"); + public static final ReturnCode NOT_ENABLED = new ReturnCode(7, "Operation invoked on an entity not yet enabled"); + public static final ReturnCode IMMUTABLE_POLICY = new ReturnCode(8, "Application attempted to modify an immutable QoS policy"); + public static final ReturnCode INCONSISTENT_POLICY = new ReturnCode(9, "Application specified a set of polices that are not consistent with each other"); + public static final ReturnCode PRECONDITION_NOT_MET = new ReturnCode(10, "A pre-condition for the operation was not met"); + public static final ReturnCode TIMEOUT = new ReturnCode(11, "The operation timed out"); + public static final ReturnCode NO_DATA = new ReturnCode(12, "Indicates a transient situation where the operation did not return any data but there is no inherent error"); + + private int value; + private String description; + + /** + * Creates a new <code>ReturnCode</code> with a given value and description. + * + * @param value + * @param description + */ + private ReturnCode(int value, String description) { + super(); + this.value = value; + this.description = description; + } + + /** + * @return Returns the description. + */ + public String getDescription() { + return description; + } + + /** + * @return Returns the value. + */ + public int getValue() { + return value; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/SampleStateKind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/SampleStateKind.java index 1be40aa2038..701fdffc538 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/SampleStateKind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/SampleStateKind.java @@ -8,31 +8,31 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * The class which stores all of the available read states for a sample. The name
- * of any of the values can be acquired from the <code>getKindName()</code>
- * method inherited from <code>Kind</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.Kind
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SampleStateKind extends Kind {
-
- public final static SampleStateKind READ = new SampleStateKind("Read sample state", 1);
- public final static SampleStateKind NOT_READ = new SampleStateKind("Not read sample state", 2);
-
- /**
- * Local constructor for creating <code>SampleStateKind</code> objects.
- *
- * @param kindName The name of the kind
- * @param kindId The id value of the kind
- */
- private SampleStateKind(String kindName, long kindId) {
- super(kindName, kindId);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * The class which stores all of the available read states for a sample. The name + * of any of the values can be acquired from the <code>getKindName()</code> + * method inherited from <code>Kind</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.Kind + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SampleStateKind extends Kind { + + public final static SampleStateKind READ = new SampleStateKind("Read sample state", 1); + public final static SampleStateKind NOT_READ = new SampleStateKind("Not read sample state", 2); + + /** + * Local constructor for creating <code>SampleStateKind</code> objects. + * + * @param kindName The name of the kind + * @param kindId The id value of the kind + */ + private SampleStateKind(String kindName, long kindId) { + super(kindName, kindId); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/StatusKind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/StatusKind.java index 7f2e661e256..27c39934269 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/StatusKind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/StatusKind.java @@ -8,41 +8,41 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * The class which stores all of the available kinds of status. The name
- * of any of the values can be acquired from the <code>getKindName()</code>
- * method inherited from <code>Kind</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.Kind
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class StatusKind extends Kind {
- public final static StatusKind INCONSISTENT_TOPIC_STATUS = new StatusKind("INCONSISTENT_TOPIC_STATUS", 0x0001 << 0);
- public final static StatusKind OFFERED_DEADLINE_MISSED_STATUS = new StatusKind("OFFERED_DEADLINE_MISSED_STATUS", 0x0001 << 1);
- public final static StatusKind REQUESTED_DEADLINE_MISSED_STATUS = new StatusKind("REQUESTED_DEADLINE_MISSED_STATUS", 0x0001 << 2);
- public final static StatusKind OFFERED_INCOMPATIBLE_QOS_STATUS = new StatusKind("OFFERED_INCOMPATIBLE_QOS_STATUS", 0x0001 << 5);
- public final static StatusKind REQUESTED_INCOMPATIBLE_QOS_STATUS = new StatusKind("REQUESTED_INCOMPATIBLE_QOS_STATUS", 0x0001 << 6);
- public final static StatusKind SAMPLE_LOST_STATUS = new StatusKind("SAMPLE_LOST_STATUS", 0x0001 << 7);
- public final static StatusKind SAMPLE_REJECTED_STATUS = new StatusKind("SAMPLE_REJECTED_STATUS", 0x0001 << 8);
- public final static StatusKind DATA_ON_READERS_STATUS = new StatusKind("DATA_ON_READERS_STATUS", 0x0001 << 9);
- public final static StatusKind DATA_AVAILABLE_STATUS = new StatusKind("DATA_AVAILABLE_STATUS", 0x0001 << 10);
- public final static StatusKind LIVELINESS_LOST_STATUS = new StatusKind("LIVELINESS_LOST_STATUS", 0x0001 << 11);
- public final static StatusKind LIVELINESS_CHANGED_STATUS = new StatusKind("LIVELINESS_CHANGED_STATUS", 0x0001 << 12);
- public final static StatusKind PUBLICATION_MATCH_STATUS = new StatusKind("PUBLICATION_MATCH_STATUS", 0x0001 << 13);
- public final static StatusKind SUBSCRIPTION_MATCH_STATUS = new StatusKind("SUBSCRIPTION_MATCH_STATUS", 0x0001 << 14);
-
- /**
- * Local constructor for creating <code>StatusKind</code> objects.
- *
- * @param kindName The name of the kind
- * @param kindId The id value of the kind
- */
- private StatusKind(String kindName, long kindId) {
- super(kindName, kindId);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * The class which stores all of the available kinds of status. The name + * of any of the values can be acquired from the <code>getKindName()</code> + * method inherited from <code>Kind</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.Kind + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class StatusKind extends Kind { + public final static StatusKind INCONSISTENT_TOPIC_STATUS = new StatusKind("INCONSISTENT_TOPIC_STATUS", 0x0001 << 0); + public final static StatusKind OFFERED_DEADLINE_MISSED_STATUS = new StatusKind("OFFERED_DEADLINE_MISSED_STATUS", 0x0001 << 1); + public final static StatusKind REQUESTED_DEADLINE_MISSED_STATUS = new StatusKind("REQUESTED_DEADLINE_MISSED_STATUS", 0x0001 << 2); + public final static StatusKind OFFERED_INCOMPATIBLE_QOS_STATUS = new StatusKind("OFFERED_INCOMPATIBLE_QOS_STATUS", 0x0001 << 5); + public final static StatusKind REQUESTED_INCOMPATIBLE_QOS_STATUS = new StatusKind("REQUESTED_INCOMPATIBLE_QOS_STATUS", 0x0001 << 6); + public final static StatusKind SAMPLE_LOST_STATUS = new StatusKind("SAMPLE_LOST_STATUS", 0x0001 << 7); + public final static StatusKind SAMPLE_REJECTED_STATUS = new StatusKind("SAMPLE_REJECTED_STATUS", 0x0001 << 8); + public final static StatusKind DATA_ON_READERS_STATUS = new StatusKind("DATA_ON_READERS_STATUS", 0x0001 << 9); + public final static StatusKind DATA_AVAILABLE_STATUS = new StatusKind("DATA_AVAILABLE_STATUS", 0x0001 << 10); + public final static StatusKind LIVELINESS_LOST_STATUS = new StatusKind("LIVELINESS_LOST_STATUS", 0x0001 << 11); + public final static StatusKind LIVELINESS_CHANGED_STATUS = new StatusKind("LIVELINESS_CHANGED_STATUS", 0x0001 << 12); + public final static StatusKind PUBLICATION_MATCH_STATUS = new StatusKind("PUBLICATION_MATCH_STATUS", 0x0001 << 13); + public final static StatusKind SUBSCRIPTION_MATCH_STATUS = new StatusKind("SUBSCRIPTION_MATCH_STATUS", 0x0001 << 14); + + /** + * Local constructor for creating <code>StatusKind</code> objects. + * + * @param kindName The name of the kind + * @param kindId The id value of the kind + */ + private StatusKind(String kindName, long kindId) { + super(kindName, kindId); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Time.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Time.java index 4a279e18e95..154639b256f 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Time.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/Time.java @@ -8,62 +8,62 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-
-/**
- * Provides a time class for marking time with nano-second resolution. This class
- * is not fully implemented yet to provide proper nano-second data, as it is not
- * being used yet.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class Time {
- protected long seconds;
- protected long nanoSeconds;
-
- /**
- * Creates a <code>Time</code> object with the current time accurate to the second.
- */
- public Time() {
- seconds = System.currentTimeMillis() / 1000;
- nanoSeconds = 0;
- }
-
- /**
- * @param seconds
- * @param nanoSeconds
- */
- public Time(long seconds, long nanoSeconds) {
- super();
- this.seconds = seconds;
- this.nanoSeconds = nanoSeconds;
- }
-
- public void copyFrom(Time sourceTime) {
- this.seconds = sourceTime.seconds;
- this.nanoSeconds = sourceTime.nanoSeconds;
- }
- /**
- * @return Returns the nanoSeconds.
- */
- public long getNanoSeconds() {
- return nanoSeconds;
- }
-
- /**
- * @return Returns the seconds.
- */
- public long getSeconds() {
- return seconds;
- }
-
- public long getMilliseconds() {
- return seconds*1000 + nanoSeconds/1000;
- }
-
- protected long millisSince(Time time) {
- return this.getMilliseconds() - time.getMilliseconds();
- }
-}
+package org.eclipse.osee.ote.messaging.dds; + + +/** + * Provides a time class for marking time with nano-second resolution. This class + * is not fully implemented yet to provide proper nano-second data, as it is not + * being used yet. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class Time { + protected long seconds; + protected long nanoSeconds; + + /** + * Creates a <code>Time</code> object with the current time accurate to the second. + */ + public Time() { + seconds = System.currentTimeMillis() / 1000; + nanoSeconds = 0; + } + + /** + * @param seconds + * @param nanoSeconds + */ + public Time(long seconds, long nanoSeconds) { + super(); + this.seconds = seconds; + this.nanoSeconds = nanoSeconds; + } + + public void copyFrom(Time sourceTime) { + this.seconds = sourceTime.seconds; + this.nanoSeconds = sourceTime.nanoSeconds; + } + /** + * @return Returns the nanoSeconds. + */ + public long getNanoSeconds() { + return nanoSeconds; + } + + /** + * @return Returns the seconds. + */ + public long getSeconds() { + return seconds; + } + + public long getMilliseconds() { + return seconds*1000 + nanoSeconds/1000; + } + + protected long millisSince(Time time) { + return this.getMilliseconds() - time.getMilliseconds(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ViewStateKind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ViewStateKind.java index e9cf069f53b..fdbdde39602 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ViewStateKind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/ViewStateKind.java @@ -8,29 +8,29 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds;
-
-/**
- * The class which stores all of the available view states for a sample. The name of any of the values can be acquired from the <code>getKindName()</code>
- * method inherited from <code>Kind</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.Kind
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class ViewStateKind extends Kind {
-
- public final static ViewStateKind NEW = new ViewStateKind("New view state", 1);
- public final static ViewStateKind NOT_NEW = new ViewStateKind("Not new view state", 2);
-
- /**
- * Local constructor for creating <code>ViewStateKind</code> objects.
- *
- * @param kindName The name of the kind
- * @param kindId The id value of the kind
- */
- private ViewStateKind(String kindName, long kindId) {
- super(kindName, kindId);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds; + +/** + * The class which stores all of the available view states for a sample. The name of any of the values can be acquired from the <code>getKindName()</code> + * method inherited from <code>Kind</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.Kind + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class ViewStateKind extends Kind { + + public final static ViewStateKind NEW = new ViewStateKind("New view state", 1); + public final static ViewStateKind NOT_NEW = new ViewStateKind("Not new view state", 2); + + /** + * Local constructor for creating <code>ViewStateKind</code> objects. + * + * @param kindName The name of the kind + * @param kindId The id value of the kind + */ + private ViewStateKind(String kindName, long kindId) { + super(kindName, kindId); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/Condition.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/Condition.java index 64ce0bc7b5d..62311906313 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/Condition.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/Condition.java @@ -8,31 +8,31 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class Condition {
- protected boolean trigger;
-
- /**
- *
- */
- public Condition() {
- this.trigger = false;
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- public boolean getTrigger() {
- return trigger;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class Condition { + protected boolean trigger; + + /** + * + */ + public Condition() { + this.trigger = false; + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + public boolean getTrigger() { + return trigger; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/GuardCondition.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/GuardCondition.java index 8c970a8c363..09f88e2a411 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/GuardCondition.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/GuardCondition.java @@ -8,26 +8,26 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class GuardCondition extends Condition {
-
- public GuardCondition() {
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- public void setTrigger(boolean trigger) {
- this.trigger = trigger;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class GuardCondition extends Condition { + + public GuardCondition() { + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + public void setTrigger(boolean trigger) { + this.trigger = trigger; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/QueryCondition.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/QueryCondition.java index de76e37e77f..2bc09f5a7bb 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/QueryCondition.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/QueryCondition.java @@ -8,59 +8,59 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class QueryCondition {
- private String queryExpression;
- private Collection<String> queryArguments;
-
- /**
- * @param queryExpression
- * @param queryArguments
- */
- public QueryCondition(String queryExpression, Collection<String> queryArguments) {
- super();
- this.queryExpression = queryExpression;
- this.queryArguments = Collections.synchronizedList(new ArrayList<String>(queryArguments));
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- /**
- * @return Returns the queryArguments.
- */
- public Collection<String> getQueryArguments() {
- return queryArguments;
- }
-
- /**
- * @param queryArguments The queryArguments to set.
- */
- public ReturnCode setQueryArguments(Collection<String> queryArguments) {
- this.queryArguments = Collections.synchronizedList(new ArrayList<String>(queryArguments));
- return ReturnCode.OK;
- }
-
- /**
- * @return Returns the queryExpression.
- */
- public String getQueryExpression() {
- return queryExpression;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; + + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class QueryCondition { + private String queryExpression; + private Collection<String> queryArguments; + + /** + * @param queryExpression + * @param queryArguments + */ + public QueryCondition(String queryExpression, Collection<String> queryArguments) { + super(); + this.queryExpression = queryExpression; + this.queryArguments = Collections.synchronizedList(new ArrayList<String>(queryArguments)); + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + /** + * @return Returns the queryArguments. + */ + public Collection<String> getQueryArguments() { + return queryArguments; + } + + /** + * @param queryArguments The queryArguments to set. + */ + public ReturnCode setQueryArguments(Collection<String> queryArguments) { + this.queryArguments = Collections.synchronizedList(new ArrayList<String>(queryArguments)); + return ReturnCode.OK; + } + + /** + * @return Returns the queryExpression. + */ + public String getQueryExpression() { + return queryExpression; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/ReadCondition.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/ReadCondition.java index 7c37aa6d2e2..2b5c1cba91d 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/ReadCondition.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/ReadCondition.java @@ -8,68 +8,68 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import java.util.Collection;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class ReadCondition {
- private DataReader dataReader;
- private Collection<?> sampleStateKinds;
- private Collection<?> viewStateKinds;
- private Collection<?> instanceStateKinds;
-
- /**
- * @param dataReader
- * @param sampleStateKinds
- * @param viewStateKinds
- * @param instanceStateKinds
- */
- public ReadCondition(DataReader dataReader, Collection<?> sampleStateKinds, Collection<?> viewStateKinds, Collection<?> instanceStateKinds) {
- super();
- this.dataReader = dataReader;
- this.sampleStateKinds = sampleStateKinds;
- this.viewStateKinds = viewStateKinds;
- this.instanceStateKinds = instanceStateKinds;
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- /**
- * @return Returns the dataReader.
- */
- public DataReader getDataReader() {
- return dataReader;
- }
-
- /**
- * @return Returns the instanceStateKinds.
- */
- public Collection<?> getInstanceStateKinds() {
- return instanceStateKinds;
- }
-
- /**
- * @return Returns the sampleStateKinds.
- */
- public Collection<?> getSampleStateKinds() {
- return sampleStateKinds;
- }
-
- /**
- * @return Returns the viewStateKinds.
- */
- public Collection<?> getViewStateKinds() {
- return viewStateKinds;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import java.util.Collection; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class ReadCondition { + private DataReader dataReader; + private Collection<?> sampleStateKinds; + private Collection<?> viewStateKinds; + private Collection<?> instanceStateKinds; + + /** + * @param dataReader + * @param sampleStateKinds + * @param viewStateKinds + * @param instanceStateKinds + */ + public ReadCondition(DataReader dataReader, Collection<?> sampleStateKinds, Collection<?> viewStateKinds, Collection<?> instanceStateKinds) { + super(); + this.dataReader = dataReader; + this.sampleStateKinds = sampleStateKinds; + this.viewStateKinds = viewStateKinds; + this.instanceStateKinds = instanceStateKinds; + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + /** + * @return Returns the dataReader. + */ + public DataReader getDataReader() { + return dataReader; + } + + /** + * @return Returns the instanceStateKinds. + */ + public Collection<?> getInstanceStateKinds() { + return instanceStateKinds; + } + + /** + * @return Returns the sampleStateKinds. + */ + public Collection<?> getSampleStateKinds() { + return sampleStateKinds; + } + + /** + * @return Returns the viewStateKinds. + */ + public Collection<?> getViewStateKinds() { + return viewStateKinds; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/StatusCondition.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/StatusCondition.java index e359502a49e..e3bd9ac30fc 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/StatusCondition.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/StatusCondition.java @@ -8,50 +8,50 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import java.util.Collection;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.entity.Entity;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class StatusCondition extends Condition {
-
- private Collection<?> enabledStatuses;
- private Entity parentEntity;
-
- /**
- *
- */
- public StatusCondition(Entity parentEntity) {
-
- this.parentEntity = parentEntity;
- enabledStatuses = null; // UNSURE find out if this should be something else?
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- public ReturnCode setEnabledStatuses(Collection<?> mask) {
- return ReturnCode.ERROR;
- }
-
- public Collection<?> getEnabledStatuses() {
- return enabledStatuses;
- }
-
- /**
- * @return Returns the entity.
- */
- public Entity getParentEntity() {
- return parentEntity;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import java.util.Collection; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.entity.Entity; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class StatusCondition extends Condition { + + private Collection<?> enabledStatuses; + private Entity parentEntity; + + /** + * + */ + public StatusCondition(Entity parentEntity) { + + this.parentEntity = parentEntity; + enabledStatuses = null; // UNSURE find out if this should be something else? + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + public ReturnCode setEnabledStatuses(Collection<?> mask) { + return ReturnCode.ERROR; + } + + public Collection<?> getEnabledStatuses() { + return enabledStatuses; + } + + /** + * @return Returns the entity. + */ + public Entity getParentEntity() { + return parentEntity; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/WaitSet.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/WaitSet.java index e8d72d87a02..594913514f4 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/WaitSet.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/WaitSet.java @@ -8,74 +8,74 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.condition;
-
-import java.util.Collection;
-import java.util.concurrent.locks.Condition;
-
-import org.eclipse.osee.ote.messaging.dds.Duration;
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class WaitSet {
- public WaitSet() {
-
- // This class, and the use of it has not been implemented
- throw new NotImplementedException();
- }
-
- /**
- * Not Implemented. Attach a condition to this <code>WaitSet</code>.
- *
- * @param condition The condition to attach
- * @return ERROR - This method is not implemented
- */
- public ReturnCode attachCondition(Condition condition) {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return ReturnCode.ERROR;
-
- }
-
- /**
- * Not Implemented. Detach a condition from this <code>WaitSet</code>.
- *
- * @param condition The condition to detach
- * @return ERROR - This method is not implemented
- */
- public ReturnCode detachCondition(Condition condition) {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return ReturnCode.ERROR;
-
- }
-
- /**
- * Not Implemented. Block execution until a <code>Condition</code> in this <code>WaitSet</code>
- * is triggered. The provided collection will be used to return a list of the triggered conditions
- * when then call unblocks. The timeout parameter is used to specify a maximum amount of time
- * that should be consumed by this call, allowing the block to release with out any of the
- * conditions being met.
- *
- * @param conditions A collection to place the triggered conditions in.
- * @param timeout A max amount of time to wait on this <code>WaitSet</code>
- * @return ERROR - This method is not implemented
- */
- public ReturnCode wait(Collection<?> conditions, Duration timeout) {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return ReturnCode.ERROR;
-
- }
-}
+package org.eclipse.osee.ote.messaging.dds.condition; + +import java.util.Collection; +import java.util.concurrent.locks.Condition; + +import org.eclipse.osee.ote.messaging.dds.Duration; +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; + + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class WaitSet { + public WaitSet() { + + // This class, and the use of it has not been implemented + throw new NotImplementedException(); + } + + /** + * Not Implemented. Attach a condition to this <code>WaitSet</code>. + * + * @param condition The condition to attach + * @return ERROR - This method is not implemented + */ + public ReturnCode attachCondition(Condition condition) { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return ReturnCode.ERROR; + + } + + /** + * Not Implemented. Detach a condition from this <code>WaitSet</code>. + * + * @param condition The condition to detach + * @return ERROR - This method is not implemented + */ + public ReturnCode detachCondition(Condition condition) { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return ReturnCode.ERROR; + + } + + /** + * Not Implemented. Block execution until a <code>Condition</code> in this <code>WaitSet</code> + * is triggered. The provided collection will be used to return a list of the triggered conditions + * when then call unblocks. The timeout parameter is used to specify a maximum amount of time + * that should be consumed by this call, allowing the block to release with out any of the + * conditions being met. + * + * @param conditions A collection to place the triggered conditions in. + * @param timeout A max amount of time to wait on this <code>WaitSet</code> + * @return ERROR - This method is not implemented + */ + public ReturnCode wait(Collection<?> conditions, Duration timeout) { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return ReturnCode.ERROR; + + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/package.html index 5cd97914ec1..826f4e0acb0 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/condition/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides classes that support waiting on conditions generated within the DDS system.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides classes that support waiting on conditions generated within the DDS system. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java index c0eb1350996..819a16878b1 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java @@ -8,594 +8,594 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import java.nio.ByteBuffer;
-import java.util.Collection;
-
-import org.eclipse.osee.ote.messaging.dds.Data;
-import org.eclipse.osee.ote.messaging.dds.DataSample;
-import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
-import org.eclipse.osee.ote.messaging.dds.Duration;
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.SampleStateKind;
-import org.eclipse.osee.ote.messaging.dds.StatusKind;
-import org.eclipse.osee.ote.messaging.dds.ViewStateKind;
-import org.eclipse.osee.ote.messaging.dds.condition.QueryCondition;
-import org.eclipse.osee.ote.messaging.dds.condition.ReadCondition;
-import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener;
-import org.eclipse.osee.ote.messaging.dds.listener.TopicListener;
-import org.eclipse.osee.ote.messaging.dds.service.TopicDescription;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus;
-
-/**
- * The base class which all application specific data readers must extend. Access to read
- * information in the DDS system is all made possible by this class.
- *
- * This class is partially implemented.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DataReader extends DomainEntity {
- private final TopicDescription topicDescription;
- private final Subscriber subscriber;
- private ByteBuffer dataBuffer;
- private boolean deleted;
- private DataStoreItem item;
-
- /**
- * Creates a reader with all of the necessary information. This constructor is only visible to
- * the DDS system, applications should use
- * {@link DomainParticipant#createTopic(String, String, TopicListener)} to create a Topic.
- */
- public DataReader(TopicDescription topicDescription, Subscriber subscriber, Boolean enabled, DataReaderListener listener, EntityFactory parentFactory) {
- super(enabled.booleanValue(), listener, parentFactory);
- this.topicDescription = topicDescription;
- this.subscriber = subscriber;
- this.dataBuffer = ByteBuffer.wrap(new byte[0]);
- this.deleted = false;
- }
-
- /**
- * Provides access to the deletion flag for this <code>DataReader</code>.
- *
- * @return <b>true</b> iff this has been marked as deleted.
- */
- boolean isDeleted() { // package scope since this is system-level code
- return deleted;
- }
-
- /**
- * Set this item as deleted. This should only be called on the item by the factory which created
- * this reader, and when the <code>deleteReader()</code> method is called.
- */
- void markAsDeleted() { // package scope so that factories of this item can mark it as deleted
- deleted = true;
- }
-
- /**
- * Retrieve access to the listener assigned to this <code>DataReader</code>. The reader is not
- * guaranteed to have a listener, so this method may return <b>null</b>, and the user of this
- * method should handle that appropriately.
- */
- public DataReaderListener getListener() {
- return (DataReaderListener) super.getBaseListener();
- }
-
- /**
- * Set the listener for this <code>DataReader</code>. If another listener was already assigned
- * then it will be overridden with out any error. Additionally, <b>null</b> may be passed as the
- * listener to remove the current listener from this reader.
- *
- * @param listener - The listener to invoke when events occur.
- * @param mask - Not implemented, <b>null</b> is acceptable.
- *
- * @return {@link ReturnCode#OK}
- */
- public ReturnCode setListener(DataReaderListener listener, StatusKind mask) {
- return super.setBaseListener(listener, mask);
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode read(Collection<?> dataSamples, long maxSamples, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode take(Collection<?> dataSamples, long maxSamples, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode readWithCondition(Collection<?> dataSamples, long maxSamples, ReadCondition readCondition) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode takeWithCondition(Collection<?> dataSamples, long maxSamples, ReadCondition readCondition) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * Method for reading or taking the next available <code>DataSample</code> for this reader.
- *
- * @param dataSample - A <code>DataSample</code> which the information will be placed in.
- * @param isTake - a <code>boolean</code> stating whether the data should be taken by this
- * call.
- *
- * @return
- * <ul>
- * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled.
- * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take.
- * <li>{@link ReturnCode#OK} otherwise.
- * </ul>
- */
- private ReturnCode readOrTakeNextSample(DataSample dataSample, boolean isTake) {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- DataSample retDataSample = item.getTheDataSample();
-
- if (retDataSample == null)
- return ReturnCode.NO_DATA;
-
- // Copy our information in to the supplied buffers
- //dataSample.getData().setFromByteArray(retDataSample.getData().toByteArray());
- dataSample.getData().copyFrom(retDataSample.getData());
- dataSample.setSampleInfo(retDataSample.getSampleInfo());
-
- // update the local references sample info accordingly
- dataSample.getSampleInfo().setSampleStateKind(SampleStateKind.READ);
- dataSample.getSampleInfo().setViewStateKind(ViewStateKind.NOT_NEW);
- if (isTake) {
- item = null;
- }
- return ReturnCode.OK;
-
- }
-
- /**
- * Method for reading the next available <code>DataSample</code> for this reader.
- *
- * @param dataSample - A <code>DataSample</code> which the information will be placed in.
- *
- * @return
- * <ul>
- * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled.
- * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take.
- * <li>{@link ReturnCode#OK} otherwise.
- * </ul>
- */
- public ReturnCode readNextSample(DataSample dataSample) {
- return readOrTakeNextSample(dataSample, false);
- }
-
- /**
- * Method for taking the next available <code>DataSample</code> for this reader.
- *
- * @param dataSample - A <code>DataSample</code> which the information will be placed in.
- *
- * @return
- * <ul>
- * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled.
- * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take.
- * <li>{@link ReturnCode#OK} otherwise.
- * </ul>
- */
- public ReturnCode takeNextSample(DataSample dataSample) {
- return readOrTakeNextSample(dataSample, true);
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode readInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode takeInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode readNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode takeNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode readNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, ReadCondition readCondition) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode takeNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, ReadCondition readCondition) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode returnLoan(Collection<?> dataSamples) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode getKeyValue(Data keyHolder, InstanceHandle instanceHandle) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReadCondition createReadCondition(Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public QueryCondition createQueryCondition(Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates, String queryExpression, Collection<?> queryParameters) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode deleteReadCondition(ReadCondition readCondition) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public LivelinessChangedStatus getLivelinessChangedStatus() {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public RequestedDeadlineMissedStatus getRequestedDeadlineMissedStatus() {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public RequestedIncompatibleQosStatus getRequestedIncompatibleQosStatus() {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public SampleRejectedStatus getSampleRejectedStatus() {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public SubscriptionMatchStatus getSubscriptionMatchStatus() {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- return null;
- }
-
- /**
- * @return Returns the topicDescription.
- */
- public TopicDescription getTopicDescription() {
- return topicDescription;
- }
-
- /**
- * @return Returns the subscriber.
- */
- public Subscriber getSubscriber() {
- return subscriber;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode waitForHistoricalData(Duration duration) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode getMatchedPublicationData(PublicationBuiltinTopicData publicationData, InstanceHandle instanceHandle) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but
- * has not been implemented or used.
- */
- public ReturnCode getMatchedPublications(Collection<?> instanceHandles) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity
- // object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This is intended to be called whenever new data is "published" to the Service. Calls
- * onDataAvailable on the attached <code>DataReaderListener</code> as appropriate.
- *
- * @param theData
- */
- void store(Data theData) { // package scope
- // Get the data portion from theData
- ByteBuffer incomingBuffer = theData.toByteBuffer();
-
- // Check the size, increase the size of dataBuffer only if needed
- if (incomingBuffer.remaining() != dataBuffer.remaining()) {
- dataBuffer = ByteBuffer.wrap(new byte[incomingBuffer.remaining()]);
- }
-
- incomingBuffer.mark();
- dataBuffer.put(incomingBuffer);
- incomingBuffer.reset();
- dataBuffer.rewind();
- getListener().onDataAvailable(this);
- }
-
- public synchronized void processNewData(DataStoreItem item) {
- this.item = item;
- DataReaderListener listener = getListener();
- if (listener != null) {
- listener.onDataAvailable(this);
- }
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import java.nio.ByteBuffer; +import java.util.Collection; + +import org.eclipse.osee.ote.messaging.dds.Data; +import org.eclipse.osee.ote.messaging.dds.DataSample; +import org.eclipse.osee.ote.messaging.dds.DataStoreItem; +import org.eclipse.osee.ote.messaging.dds.Duration; +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.SampleStateKind; +import org.eclipse.osee.ote.messaging.dds.StatusKind; +import org.eclipse.osee.ote.messaging.dds.ViewStateKind; +import org.eclipse.osee.ote.messaging.dds.condition.QueryCondition; +import org.eclipse.osee.ote.messaging.dds.condition.ReadCondition; +import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener; +import org.eclipse.osee.ote.messaging.dds.listener.TopicListener; +import org.eclipse.osee.ote.messaging.dds.service.TopicDescription; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus; +import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus; + +/** + * The base class which all application specific data readers must extend. Access to read + * information in the DDS system is all made possible by this class. + * + * This class is partially implemented. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DataReader extends DomainEntity { + private final TopicDescription topicDescription; + private final Subscriber subscriber; + private ByteBuffer dataBuffer; + private boolean deleted; + private DataStoreItem item; + + /** + * Creates a reader with all of the necessary information. This constructor is only visible to + * the DDS system, applications should use + * {@link DomainParticipant#createTopic(String, String, TopicListener)} to create a Topic. + */ + public DataReader(TopicDescription topicDescription, Subscriber subscriber, Boolean enabled, DataReaderListener listener, EntityFactory parentFactory) { + super(enabled.booleanValue(), listener, parentFactory); + this.topicDescription = topicDescription; + this.subscriber = subscriber; + this.dataBuffer = ByteBuffer.wrap(new byte[0]); + this.deleted = false; + } + + /** + * Provides access to the deletion flag for this <code>DataReader</code>. + * + * @return <b>true</b> iff this has been marked as deleted. + */ + boolean isDeleted() { // package scope since this is system-level code + return deleted; + } + + /** + * Set this item as deleted. This should only be called on the item by the factory which created + * this reader, and when the <code>deleteReader()</code> method is called. + */ + void markAsDeleted() { // package scope so that factories of this item can mark it as deleted + deleted = true; + } + + /** + * Retrieve access to the listener assigned to this <code>DataReader</code>. The reader is not + * guaranteed to have a listener, so this method may return <b>null</b>, and the user of this + * method should handle that appropriately. + */ + public DataReaderListener getListener() { + return (DataReaderListener) super.getBaseListener(); + } + + /** + * Set the listener for this <code>DataReader</code>. If another listener was already assigned + * then it will be overridden with out any error. Additionally, <b>null</b> may be passed as the + * listener to remove the current listener from this reader. + * + * @param listener - The listener to invoke when events occur. + * @param mask - Not implemented, <b>null</b> is acceptable. + * + * @return {@link ReturnCode#OK} + */ + public ReturnCode setListener(DataReaderListener listener, StatusKind mask) { + return super.setBaseListener(listener, mask); + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode read(Collection<?> dataSamples, long maxSamples, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode take(Collection<?> dataSamples, long maxSamples, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode readWithCondition(Collection<?> dataSamples, long maxSamples, ReadCondition readCondition) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode takeWithCondition(Collection<?> dataSamples, long maxSamples, ReadCondition readCondition) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * Method for reading or taking the next available <code>DataSample</code> for this reader. + * + * @param dataSample - A <code>DataSample</code> which the information will be placed in. + * @param isTake - a <code>boolean</code> stating whether the data should be taken by this + * call. + * + * @return + * <ul> + * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled. + * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take. + * <li>{@link ReturnCode#OK} otherwise. + * </ul> + */ + private ReturnCode readOrTakeNextSample(DataSample dataSample, boolean isTake) { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + DataSample retDataSample = item.getTheDataSample(); + + if (retDataSample == null) + return ReturnCode.NO_DATA; + + // Copy our information in to the supplied buffers + //dataSample.getData().setFromByteArray(retDataSample.getData().toByteArray()); + dataSample.getData().copyFrom(retDataSample.getData()); + dataSample.setSampleInfo(retDataSample.getSampleInfo()); + + // update the local references sample info accordingly + dataSample.getSampleInfo().setSampleStateKind(SampleStateKind.READ); + dataSample.getSampleInfo().setViewStateKind(ViewStateKind.NOT_NEW); + if (isTake) { + item = null; + } + return ReturnCode.OK; + + } + + /** + * Method for reading the next available <code>DataSample</code> for this reader. + * + * @param dataSample - A <code>DataSample</code> which the information will be placed in. + * + * @return + * <ul> + * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled. + * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take. + * <li>{@link ReturnCode#OK} otherwise. + * </ul> + */ + public ReturnCode readNextSample(DataSample dataSample) { + return readOrTakeNextSample(dataSample, false); + } + + /** + * Method for taking the next available <code>DataSample</code> for this reader. + * + * @param dataSample - A <code>DataSample</code> which the information will be placed in. + * + * @return + * <ul> + * <li>{@link ReturnCode#NOT_ENABLED} if this reader is not enabled. + * <li>{@link ReturnCode#NO_DATA} if no data is available to read or take. + * <li>{@link ReturnCode#OK} otherwise. + * </ul> + */ + public ReturnCode takeNextSample(DataSample dataSample) { + return readOrTakeNextSample(dataSample, true); + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode readInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode takeInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode readNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode takeNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode readNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, ReadCondition readCondition) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode takeNextInstance(Collection<?> dataSamples, long maxSamples, InstanceHandle instanceHandle, ReadCondition readCondition) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode returnLoan(Collection<?> dataSamples) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode getKeyValue(Data keyHolder, InstanceHandle instanceHandle) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReadCondition createReadCondition(Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public QueryCondition createQueryCondition(Collection<?> sampleStates, Collection<?> viewStates, Collection<?> instanceStates, String queryExpression, Collection<?> queryParameters) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode deleteReadCondition(ReadCondition readCondition) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public LivelinessChangedStatus getLivelinessChangedStatus() { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public RequestedDeadlineMissedStatus getRequestedDeadlineMissedStatus() { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public RequestedIncompatibleQosStatus getRequestedIncompatibleQosStatus() { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public SampleRejectedStatus getSampleRejectedStatus() { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public SubscriptionMatchStatus getSubscriptionMatchStatus() { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + return null; + } + + /** + * @return Returns the topicDescription. + */ + public TopicDescription getTopicDescription() { + return topicDescription; + } + + /** + * @return Returns the subscriber. + */ + public Subscriber getSubscriber() { + return subscriber; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode waitForHistoricalData(Duration duration) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode getMatchedPublicationData(PublicationBuiltinTopicData publicationData, InstanceHandle instanceHandle) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but + * has not been implemented or used. + */ + public ReturnCode getMatchedPublications(Collection<?> instanceHandles) { + + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity + // object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This is intended to be called whenever new data is "published" to the Service. Calls + * onDataAvailable on the attached <code>DataReaderListener</code> as appropriate. + * + * @param theData + */ + void store(Data theData) { // package scope + // Get the data portion from theData + ByteBuffer incomingBuffer = theData.toByteBuffer(); + + // Check the size, increase the size of dataBuffer only if needed + if (incomingBuffer.remaining() != dataBuffer.remaining()) { + dataBuffer = ByteBuffer.wrap(new byte[incomingBuffer.remaining()]); + } + + incomingBuffer.mark(); + dataBuffer.put(incomingBuffer); + incomingBuffer.reset(); + dataBuffer.rewind(); + getListener().onDataAvailable(this); + } + + public synchronized void processNewData(DataStoreItem item) { + this.item = item; + DataReaderListener listener = getListener(); + if (listener != null) { + listener.onDataAvailable(this); + } + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java index 10000f78d7f..984cea0cee7 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java @@ -8,27 +8,27 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import org.eclipse.osee.ote.messaging.dds.listener.Listener;
-
-
-/**
- * The base class which all of the entity classes in the DDS system extend,
- * except for the <code>DomainParticipant</code>. This intermediate class
- * is in place simply to clarify that a <code>DomainParticipant</code> can
- * contain any other type of entity, except another <code>DomainParticipant</code>.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class DomainEntity extends Entity {
-
- /**
- * @param enabled
- * @param parentFactory
- */
- public DomainEntity(boolean enabled, Listener listener, EntityFactory parentFactory) {
- super(enabled, listener, parentFactory);
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import org.eclipse.osee.ote.messaging.dds.listener.Listener; + + +/** + * The base class which all of the entity classes in the DDS system extend, + * except for the <code>DomainParticipant</code>. This intermediate class + * is in place simply to clarify that a <code>DomainParticipant</code> can + * contain any other type of entity, except another <code>DomainParticipant</code>. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class DomainEntity extends Entity { + + /** + * @param enabled + * @param parentFactory + */ + public DomainEntity(boolean enabled, Listener listener, EntityFactory parentFactory) { + super(enabled, listener, parentFactory); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java index 6745189fd4c..cd00b876bba 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipant.java @@ -1,619 +1,619 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.messaging.dds.entity;
-
-import java.util.Collection;
-import java.util.concurrent.CopyOnWriteArrayList;
-import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
-import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
-import org.eclipse.osee.ote.messaging.dds.IDestination;
-import org.eclipse.osee.ote.messaging.dds.ISource;
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.StatusKind;
-import org.eclipse.osee.ote.messaging.dds.listener.DataWriterListener;
-import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener;
-import org.eclipse.osee.ote.messaging.dds.listener.Listener;
-import org.eclipse.osee.ote.messaging.dds.listener.PublisherListener;
-import org.eclipse.osee.ote.messaging.dds.listener.SubscriberListener;
-import org.eclipse.osee.ote.messaging.dds.listener.TopicListener;
-import org.eclipse.osee.ote.messaging.dds.service.DomainId;
-import org.eclipse.osee.ote.messaging.dds.service.TopicDescription;
-import org.eclipse.osee.ote.messaging.dds.service.TypeRegistry;
-import org.eclipse.osee.ote.messaging.dds.service.TypeSignature;
-import org.eclipse.osee.ote.messaging.dds.service.TypeSupport;
-
-/**
- * Provides functionality for applications to participate within a domain as described in the DDS specification. The
- * DomainParticipant is a factory used by the application to create {@link Publisher}'s and {@link Subscriber}'s to
- * interact with the system.
- * <p>
- * In addition to the functionality described in the DDS specification, this class provides particular functionality to
- * interact with middleware which could be used to link this with another data system. The middleware is provided a
- * special publisher to inject data into this system, and receives data from all other publishers by means of the
- * {@link DomainParticipantListener}.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DomainParticipant extends Entity implements EntityFactory {
- private final DomainId domainId;
- // These collections REALLY need to be thread safe!!!
- private final CopyOnWriteArrayList<Publisher> publishers;
- private final CopyOnWriteArrayList<Subscriber> subscribers;
- private final CompositeKeyHashMap<String, String, Topic> topics;
-
- private final TypeRegistry typeRegistry;
- private Publisher middlewarePublisher; // Publisher who can send anything
-
- // DONT_NEED The builtinSubscriber is here for future functionality that is described in the DDS specification but has not been implemented or used.
- private final Subscriber builtinSubscriber;
-
- /**
- * @param domainId The domain this participant will belong to
- * @param domain A reference to the collection of all participants in this domain.
- * @param enabled Flag which indicates if this is enabled.
- * @param listener The listener attached to this.
- * @param parentFactory A reference to the factory that is creating this.
- * @param threadedPublishing <code>True</code> if we should create a separate thread for processing published data.
- * If <code>False</code>, the published data will be processed within the thread which makes the call to
- * write data into the system (or resume publications).
- * @param typeCapacity The initial capacity to use when creating the <code>Map</code> for the {@link TypeRegistry}.
- * @param typeFactor The load factor to use when creating the <code>Map</code> for the {@link TypeRegistry}.
- */
- DomainParticipant(DomainId domainId, Collection<DomainParticipant> domain, boolean enabled, DomainParticipantListener listener, EntityFactory parentFactory, boolean threadedPublishing, int typeCapacity, float typeFactor) {
- super(enabled, listener, parentFactory);
-
- this.domainId = domainId;
- this.publishers = new CopyOnWriteArrayList<Publisher>(); // Thread Safe
- this.subscribers = new CopyOnWriteArrayList<Subscriber>(); // Thread Safe
- this.topics = new CompositeKeyHashMap<String, String, Topic>(512, true);
- this.middlewarePublisher = null;
- this.typeRegistry = new TypeRegistry(typeCapacity, typeFactor);
-
- this.builtinSubscriber = null;
- }
-
- /**
- * Creates the DomainParticipant with default settings for typeCapacity and typeFactor.
- *
- * @see DomainParticipant#DomainParticipant(DomainId, Collection, boolean, DomainParticipantListener, EntityFactory,
- * boolean, int, float)
- */
- DomainParticipant(DomainId domainId, Collection<DomainParticipant> domain, boolean enabled, DomainParticipantListener listener, EntityFactory parentFactory, boolean threadedPublishing) {
- this(domainId, domain, enabled, listener, parentFactory, threadedPublishing, 256, .75f);
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- *
- * @return Returns the builtinSubscriber.
- */
- public Subscriber getBuiltinSubscriber() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
- return builtinSubscriber;
- }
-
- /**
- * Gets the listener attached to this <code>DomainParticipant</code>.
- */
- public DomainParticipantListener getListener() {
- return (DomainParticipantListener) super.getBaseListener();
- }
-
- /**
- * Sets the listener attached to this <code>DomainParticipant</code>. This replaces the existing listener.
- *
- * @param listener The listener to attach.
- * @param mask A mask identifying which communication statuses the listener should be invoked.
- * @return The {@link ReturnCode}returned by {@link Entity#setBaseListener(Listener, StatusKind)}.
- * @see Entity#setBaseListener(Listener, StatusKind)
- */
- public ReturnCode setListener(DomainParticipantListener listener, StatusKind mask) {
- return super.setBaseListener(listener, mask);
- }
-
- /**
- * Creates a publisher with the passed listener attached.
- *
- * @param publisherListener The listener to attach to the newly created Publisher.
- * @return The newly created publisher, or null if an error occurred in creation.
- */
- private Publisher createAPublisher(PublisherListener publisherListener) {
- Publisher publisher = null;
- try {
- publisher = new Publisher(this, this.isEnabled(), publisherListener);
- publishers.add(publisher);
- } catch (OutOfMemoryError er) {
- er.printStackTrace();
- publisher = null;
- }
-
- return publisher;
- }
-
- /**
- * Creates a middlewarePublisher. If a middlewarePublisher has already been created this will return a reference to
- * the existing middlewarePublisher. The middlewarePublisher is provided as a link for an outside system to be able
- * to inject data into this system.
- *
- * @param publisherListener The listener to attach to the newly created <code>Publisher</code>. Note that this can be
- * null.
- * @return A <code>Publisher</code> with the passed in listener assigned to it, or null if an error occurred in
- * creation.
- */
- public Publisher getMiddlewarePublisherInstance(PublisherListener publisherListener) {
- if (middlewarePublisher == null) {
- middlewarePublisher = createAPublisher(publisherListener);
- }
- return middlewarePublisher;
- }
-
- /**
- * Creates a new <code>Publisher</code> with a particular listener assigned to it. The publisher will be created
- * enabled iff this <code>DomainParticipant</code> is enabled. If an OutOfMemoryError is thrown while attempting get
- * the new publisher, <b>null </b> will be returned.
- *
- * @param publisherListener The listener to be attached.
- * @return The newly created <code>Publisher</code>, or null if an error occurred in creation.
- */
- public Publisher createPublisher(PublisherListener publisherListener) {
- Publisher publisher = createAPublisher(publisherListener);
- if (publisher != null) {
- publishers.add(publisher);
- }
- return publisher;
- }
-
- /**
- * Removes the passed <code>Publisher</code> iff the publisher was created by this <code>DomainParticipant</code> and
- * does not have any attached <code>DataWriter</code> 's.
- *
- * @param publisher The publisher to be removed.
- * @return {@link ReturnCode#OK}if the publisher was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if
- * the publisher had writers or was not created by this DomainParticipant, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode deletePublisher(Publisher publisher) {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- // Check that a publisher was supplied
- if (publisher == null) {
- return ReturnCode.ERROR;
- }
-
- // Check the pre-condition
- if (publisher.hasDataWriters()) {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
-
- // Attempt to remove, if it did not exist in our list then return an error,
- // since it can only be removed from the <code>DomainParticipant</code> which created it.
- if (publishers.remove(publisher)) {
- return ReturnCode.OK;
- } else {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
- }
-
- /**
- * Creates a <code>Subscriber</code> with the provided listener attached.
- *
- * @param subscriberListener The listener to be attached.
- * @return The newly created <code>Subscriber</code>, or null if an error occurred in creation.
- */
- public Subscriber createSubscriber(SubscriberListener subscriberListener) {
- Subscriber subscriber = null;
- try {
- subscriber = new Subscriber(this, this.isEnabled(), subscriberListener);
- subscribers.add(subscriber);
- } catch (OutOfMemoryError er) {
- er.printStackTrace();
- subscriber = null;
- }
- return subscriber;
- }
-
- /**
- * Removes the passed <code>Subscriber</code> iff the subscriber was created by this <code>DomainParticipant</code>
- * and does not have any attached <code>DataReader</code> 's.
- *
- * @param subscriber The subscriber to be removed.
- * @return {@link ReturnCode#OK}if the subscriber was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if
- * the subscriber had readers or was not created by this DomainParticipant, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode deleteSubscriber(Subscriber subscriber) {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- // Check that a subscriber was supplied
- if (subscriber == null) {
- return ReturnCode.ERROR;
- }
-
- // Check the pre-condition
- if (subscriber.hasDataReaders()) {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
-
- // Attempt to remove, if it did not exist in our list then return an error,
- // since it can only be removed from the <code>DomainParticipant</code> which created it.
- if (subscribers.remove(subscriber)) {
- return ReturnCode.OK;
- } else {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
- }
-
- /**
- * Creates a <code>Topic</code> on this <code>DomainParticipant</code> with the give name. If a <code>Topic</code>
- * already exists with the given name, then the existing topic will be returned IF the typeName matches that of the
- * existing <code>Topic</code>. If the type's do not match, <b>null </b> is returned.
- *
- * @param name The name of the topic to create.
- * @param typeName The name of the type associated with the topic.
- * @param topicListener The listener to be attached to the created topic if it is newly created. If the topic already
- * exists, the provided listener is ignored.
- * @return A new <code>Topic</code> if one does not already exist, or an existing topic with the same
- * <code>name</code> and <code>typeName</code>, otherwise <b>null </b>
- */
- public Topic createTopic(String name, String namespace, String typeName, TopicListener topicListener) {
-
- Topic topic = null;
-
- // Even before that, check that the type was registered
- TypeSignature typeSignature = typeRegistry.lookupSignature(typeName);
- if (typeSignature == null) {
- throw new RuntimeException(String.format("No type signature with name [%s] was found.", typeName));
- } else {
-
- // First check to see if the topic already exists
- TopicDescription topicDescription = lookupTopicDescription(namespace, name);
- if (topicDescription != null && topicDescription instanceof Topic) {
-
- topic = (Topic) topicDescription;
-
- // Make sure that the type name is the same, otherwise it is failure
- if (topic.getTypeName().equals(typeName)) {
- // Track that another create has been called for this topic
- topic.incrementCount();
- } else {
- // There is a violation, and no topic will be returned since a topic
- // with this name already exists, but the types do not match
- throw new RuntimeException(
- String.format(
- "found topic name:[%s] namespace:[%s] but there was a type incompatibility between [%s] (from topic [%s]) and [%s].",
- name, namespace, topic.getTypeName(), topic.getName(), typeName));
- }
- } else { // Otherwise, the topic did not already exist
- topic = new Topic(this, typeSignature, name, namespace, this.isEnabled(), topicListener, this);
- topics.put(namespace, name, topic);
- }
- }
- return topic;
- }
-
- /**
- * This method deletes a <code>Topic</code> previously created by this <code>DomainParticipant</code>. No action will
- * be taken if the topic still has data readers/writers attached to it, or if it was not created by this
- * <code>DomainParticipant</code>.
- *
- * @param topic The topic to delete.
- * @return {@link ReturnCode#OK}if the topic was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if the
- * topic has readers/writers or was not created by this DomainParticipant, {@link ReturnCode#NOT_ENABLED}if
- * this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode deleteTopic(Topic topic) {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- // Check the pre-condition
- if (topic.hasDataReaders()) {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
- // Check the pre-condition
- if (topic.hasDataWriters()) {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
-
- // Check that a topic was supplied
- if (topic == null) {
- return ReturnCode.ERROR;
- }
-
- // Attempt to remove, if it did not exist in our list then return an error,
- // since it can only be removed from the <code>DomainParticipant</code> which created it.
- if (topics.containsKey(topic.getNamespace() + topic.getName())) {
- // Reduce the count of creations by 1
- topic.decrementCount();
-
- // If the creation count is zero, then remove it from the list
- if (topic.getCount() <= 0) {
- topics.removeValues(topic.getNamespace() + topic.getName());
- }
-
- return ReturnCode.OK;
- } else {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
- }
-
- /**
- * Get a <code>TopicDescription</code> that matches a particular name. PARTIAL: Since the
- * <code>ContentFilteredTopic</code> and <code>MultiTopic</code> classes are not implemented, this method simply
- * searches the list of <code>Topic</code> classes.
- *
- * @param namespace The name to match against the <code>TopicDescription</code>.
- * @return The <code>TopicDescription</code> that has the specified name, <b>null </b> if no such one exists.
- */
- public TopicDescription lookupTopicDescription(String namespace, String topic) {
- //PARTIAL ContentFilteredTopic and MultiTopic are not implemented, so this only searches Topic.
- return findTopicByName(namespace, topic);
- }
-
- /**
- * Searches the current list of Topics for this DomainParticipant for a topic whose name matches the provided
- * topicName
- *
- * @param topicName The topic name to match
- * @return A reference to the existing topic whose name matches topicName, or null if no such topic exists.
- */
- private Topic findTopicByName(String namespace, String topicName) {
- return topics.get(namespace, topicName);
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- *
- * @return {@link ReturnCode#OK}if the participant was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED}
- * if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode ignoreParticipant() {
- // UNSURE this is stubbed for now, until we determine it's necessity
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- *
- * @return {@link ReturnCode#OK}if the topic was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED}if
- * this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode ignoreTopic() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- *
- * @return {@link ReturnCode#OK}if the publication was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED}
- * if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode ignorePublication() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- *
- * @return {@link ReturnCode#OK}if the subscription was successfully set to be ignored,
- * {@link ReturnCode#NOT_ENABLED}if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}.
- */
- public ReturnCode ignoreSubscription() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
- }
-
- /**
- * Gets the <code>DomainId</code> that this <code>DomainParticipant</code> belongs to.
- *
- * @return The <code>DomainId</code> of this participant.
- */
- public DomainId getDomainId() {
- return domainId;
- }
-
- /**
- * Performs a deep deletion of contained entities (Publishers, Subscribers, Topics). This will cause a recursive call
- * of <code>deleteContainedEntities</code> through out all of the contained entities. This can only be performed if
- * the <code>DomainParticipant</code> is enabled.
- *
- * @return {@link ReturnCode#OK}if the all entities were successfully deleted, or {@link ReturnCode#NOT_ENABLED}if
- * this DomainParticipant is not enabled.
- */
- public ReturnCode deleteContainedEntities() {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- for (Publisher publisher : publishers) {
- publisher.deleteContainedEntities();
- }
- publishers.clear();
-
- for (Subscriber subscriber : subscribers) {
- subscriber.deleteContainedEntities();
- }
-
- subscribers.clear();
-
- this.middlewarePublisher = null;
-
- // Topics do not contain anything else
- topics.clear();
-
- return ReturnCode.OK;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been
- * implemented or used.
- */
- public void assertLiveliness() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
- }
-
- /**
- * Returns true iff this <code>DomainParticipant</code> contains at least one publisher, subscriber or topic.
- *
- * @return <b>true </b> if this contains an entity, <b>false </b> otherwise.
- */
- public boolean hasEntities() {
- return !(publishers.isEmpty() && subscribers.isEmpty() && topics.isEmpty());
- }
-
- /**
- * Propagates the published data to each <code>Subscriber</code> of this <code>DomainParticipant</code>. Notifies the
- * middleware (by means of the {@link DomainParticipantListener}of the new data unless it originated from the
- * middlewarePublisher. The middleware is only notified of data originating from this <code>DomainPariticipant</code>
- * , that is, data published from other participants in the domain will not be sent to the middleware.
- *
- * @param destination TODO
- * @param source TODO
- * @param dataStoreItem The <code>DataStoreItem</code> that was published.
- */
- void processPublishedData(IDestination destination, ISource source, DataStoreItem dataStoreItem) { // package scope since it is a
- // system-level call
-
- // Notify the middleware of new data, unless it was published by the middlewarePublisher
- // When data is published by the middlewarePublisher it does not have an associated DataWriter
-
- DataWriter writer = dataStoreItem.getTheWriter();
- if (writer != null) {
- // Invoke the DomainParticipantListener if available
- DomainParticipantListener domainParticipantListener = getListener();
- if (domainParticipantListener != null) {
- domainParticipantListener.onPublishNotifyMiddleware(destination, source, dataStoreItem);
- }
-
- // If the writer has a listener, then invoke it
- DataWriterListener writerListener = writer.getListener();
- if (writerListener != null) {
- writerListener.onDataSentToMiddleware(writer);
- }
-
- }
-
- if (writer == null || writer != null && writer.isPublishBackToLocalDDSReaders()) {
- // Notify all of the subscribers in our domain
- for (Subscriber domainSubscribers : subscribers) {
- domainSubscribers.processNewData(dataStoreItem);
- }
- }
- }
-
- /**
- * Gets the <code>TypeRegistry</code> used by {@link TypeSupport}to store the types registered for this
- * <code>DomainParticipant</code>.
- *
- * @return Returns the typeRegistry.
- */
- public TypeRegistry getTypeRegistry() {
- return typeRegistry;
- }
-
- /**
- * Gets the Middleware <code>Publisher</code> if one has been created.
- *
- * @return Returns the <code>Publisher</code> for the middleware, or null if it has not been created.
- * @see DomainParticipant
- */
- public Publisher getMiddlewarePublisher() {
- return middlewarePublisher;
- }
-
- /**
- * Gets the current <code>Collection</code> of <code>Publisher</code>'s for this <code>DomainPariticpant</code>.
- *
- * @return Returns the <code>Collection</code> of <code>Publisher</code> 's.
- */
- public CopyOnWriteArrayList<Publisher> getPublishers() {
- return publishers;
- }
-
- public void dispose() {
- for (Topic topic : topics.values()) {
- topic.clearDataReaders();
- topic.clearDataWriters();
- }
- topics.clear();
- for (Subscriber subscriber : subscribers) {
- if (subscriber.deleteContainedEntities() == ReturnCode.NOT_ENABLED) {
- System.err.println("failed to delete subscriber because it was not enabled");
- }
- }
- subscribers.clear();
-
- for (Publisher publisher : publishers) {
- publisher.dispose();
- }
- publishers.clear();
-
- typeRegistry.clear();
- }
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ote.messaging.dds.entity; + +import java.util.Collection; +import java.util.concurrent.CopyOnWriteArrayList; +import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; +import org.eclipse.osee.ote.messaging.dds.DataStoreItem; +import org.eclipse.osee.ote.messaging.dds.IDestination; +import org.eclipse.osee.ote.messaging.dds.ISource; +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.StatusKind; +import org.eclipse.osee.ote.messaging.dds.listener.DataWriterListener; +import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener; +import org.eclipse.osee.ote.messaging.dds.listener.Listener; +import org.eclipse.osee.ote.messaging.dds.listener.PublisherListener; +import org.eclipse.osee.ote.messaging.dds.listener.SubscriberListener; +import org.eclipse.osee.ote.messaging.dds.listener.TopicListener; +import org.eclipse.osee.ote.messaging.dds.service.DomainId; +import org.eclipse.osee.ote.messaging.dds.service.TopicDescription; +import org.eclipse.osee.ote.messaging.dds.service.TypeRegistry; +import org.eclipse.osee.ote.messaging.dds.service.TypeSignature; +import org.eclipse.osee.ote.messaging.dds.service.TypeSupport; + +/** + * Provides functionality for applications to participate within a domain as described in the DDS specification. The + * DomainParticipant is a factory used by the application to create {@link Publisher}'s and {@link Subscriber}'s to + * interact with the system. + * <p> + * In addition to the functionality described in the DDS specification, this class provides particular functionality to + * interact with middleware which could be used to link this with another data system. The middleware is provided a + * special publisher to inject data into this system, and receives data from all other publishers by means of the + * {@link DomainParticipantListener}. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DomainParticipant extends Entity implements EntityFactory { + private final DomainId domainId; + // These collections REALLY need to be thread safe!!! + private final CopyOnWriteArrayList<Publisher> publishers; + private final CopyOnWriteArrayList<Subscriber> subscribers; + private final CompositeKeyHashMap<String, String, Topic> topics; + + private final TypeRegistry typeRegistry; + private Publisher middlewarePublisher; // Publisher who can send anything + + // DONT_NEED The builtinSubscriber is here for future functionality that is described in the DDS specification but has not been implemented or used. + private final Subscriber builtinSubscriber; + + /** + * @param domainId The domain this participant will belong to + * @param domain A reference to the collection of all participants in this domain. + * @param enabled Flag which indicates if this is enabled. + * @param listener The listener attached to this. + * @param parentFactory A reference to the factory that is creating this. + * @param threadedPublishing <code>True</code> if we should create a separate thread for processing published data. + * If <code>False</code>, the published data will be processed within the thread which makes the call to + * write data into the system (or resume publications). + * @param typeCapacity The initial capacity to use when creating the <code>Map</code> for the {@link TypeRegistry}. + * @param typeFactor The load factor to use when creating the <code>Map</code> for the {@link TypeRegistry}. + */ + DomainParticipant(DomainId domainId, Collection<DomainParticipant> domain, boolean enabled, DomainParticipantListener listener, EntityFactory parentFactory, boolean threadedPublishing, int typeCapacity, float typeFactor) { + super(enabled, listener, parentFactory); + + this.domainId = domainId; + this.publishers = new CopyOnWriteArrayList<Publisher>(); // Thread Safe + this.subscribers = new CopyOnWriteArrayList<Subscriber>(); // Thread Safe + this.topics = new CompositeKeyHashMap<String, String, Topic>(512, true); + this.middlewarePublisher = null; + this.typeRegistry = new TypeRegistry(typeCapacity, typeFactor); + + this.builtinSubscriber = null; + } + + /** + * Creates the DomainParticipant with default settings for typeCapacity and typeFactor. + * + * @see DomainParticipant#DomainParticipant(DomainId, Collection, boolean, DomainParticipantListener, EntityFactory, + * boolean, int, float) + */ + DomainParticipant(DomainId domainId, Collection<DomainParticipant> domain, boolean enabled, DomainParticipantListener listener, EntityFactory parentFactory, boolean threadedPublishing) { + this(domainId, domain, enabled, listener, parentFactory, threadedPublishing, 256, .75f); + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + * + * @return Returns the builtinSubscriber. + */ + public Subscriber getBuiltinSubscriber() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) { + throw new NotImplementedException(); + } + return builtinSubscriber; + } + + /** + * Gets the listener attached to this <code>DomainParticipant</code>. + */ + public DomainParticipantListener getListener() { + return (DomainParticipantListener) super.getBaseListener(); + } + + /** + * Sets the listener attached to this <code>DomainParticipant</code>. This replaces the existing listener. + * + * @param listener The listener to attach. + * @param mask A mask identifying which communication statuses the listener should be invoked. + * @return The {@link ReturnCode}returned by {@link Entity#setBaseListener(Listener, StatusKind)}. + * @see Entity#setBaseListener(Listener, StatusKind) + */ + public ReturnCode setListener(DomainParticipantListener listener, StatusKind mask) { + return super.setBaseListener(listener, mask); + } + + /** + * Creates a publisher with the passed listener attached. + * + * @param publisherListener The listener to attach to the newly created Publisher. + * @return The newly created publisher, or null if an error occurred in creation. + */ + private Publisher createAPublisher(PublisherListener publisherListener) { + Publisher publisher = null; + try { + publisher = new Publisher(this, this.isEnabled(), publisherListener); + publishers.add(publisher); + } catch (OutOfMemoryError er) { + er.printStackTrace(); + publisher = null; + } + + return publisher; + } + + /** + * Creates a middlewarePublisher. If a middlewarePublisher has already been created this will return a reference to + * the existing middlewarePublisher. The middlewarePublisher is provided as a link for an outside system to be able + * to inject data into this system. + * + * @param publisherListener The listener to attach to the newly created <code>Publisher</code>. Note that this can be + * null. + * @return A <code>Publisher</code> with the passed in listener assigned to it, or null if an error occurred in + * creation. + */ + public Publisher getMiddlewarePublisherInstance(PublisherListener publisherListener) { + if (middlewarePublisher == null) { + middlewarePublisher = createAPublisher(publisherListener); + } + return middlewarePublisher; + } + + /** + * Creates a new <code>Publisher</code> with a particular listener assigned to it. The publisher will be created + * enabled iff this <code>DomainParticipant</code> is enabled. If an OutOfMemoryError is thrown while attempting get + * the new publisher, <b>null </b> will be returned. + * + * @param publisherListener The listener to be attached. + * @return The newly created <code>Publisher</code>, or null if an error occurred in creation. + */ + public Publisher createPublisher(PublisherListener publisherListener) { + Publisher publisher = createAPublisher(publisherListener); + if (publisher != null) { + publishers.add(publisher); + } + return publisher; + } + + /** + * Removes the passed <code>Publisher</code> iff the publisher was created by this <code>DomainParticipant</code> and + * does not have any attached <code>DataWriter</code> 's. + * + * @param publisher The publisher to be removed. + * @return {@link ReturnCode#OK}if the publisher was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if + * the publisher had writers or was not created by this DomainParticipant, or {@link ReturnCode#ERROR}. + */ + public ReturnCode deletePublisher(Publisher publisher) { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + // Check that a publisher was supplied + if (publisher == null) { + return ReturnCode.ERROR; + } + + // Check the pre-condition + if (publisher.hasDataWriters()) { + return ReturnCode.PRECONDITION_NOT_MET; + } + + // Attempt to remove, if it did not exist in our list then return an error, + // since it can only be removed from the <code>DomainParticipant</code> which created it. + if (publishers.remove(publisher)) { + return ReturnCode.OK; + } else { + return ReturnCode.PRECONDITION_NOT_MET; + } + } + + /** + * Creates a <code>Subscriber</code> with the provided listener attached. + * + * @param subscriberListener The listener to be attached. + * @return The newly created <code>Subscriber</code>, or null if an error occurred in creation. + */ + public Subscriber createSubscriber(SubscriberListener subscriberListener) { + Subscriber subscriber = null; + try { + subscriber = new Subscriber(this, this.isEnabled(), subscriberListener); + subscribers.add(subscriber); + } catch (OutOfMemoryError er) { + er.printStackTrace(); + subscriber = null; + } + return subscriber; + } + + /** + * Removes the passed <code>Subscriber</code> iff the subscriber was created by this <code>DomainParticipant</code> + * and does not have any attached <code>DataReader</code> 's. + * + * @param subscriber The subscriber to be removed. + * @return {@link ReturnCode#OK}if the subscriber was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if + * the subscriber had readers or was not created by this DomainParticipant, or {@link ReturnCode#ERROR}. + */ + public ReturnCode deleteSubscriber(Subscriber subscriber) { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + // Check that a subscriber was supplied + if (subscriber == null) { + return ReturnCode.ERROR; + } + + // Check the pre-condition + if (subscriber.hasDataReaders()) { + return ReturnCode.PRECONDITION_NOT_MET; + } + + // Attempt to remove, if it did not exist in our list then return an error, + // since it can only be removed from the <code>DomainParticipant</code> which created it. + if (subscribers.remove(subscriber)) { + return ReturnCode.OK; + } else { + return ReturnCode.PRECONDITION_NOT_MET; + } + } + + /** + * Creates a <code>Topic</code> on this <code>DomainParticipant</code> with the give name. If a <code>Topic</code> + * already exists with the given name, then the existing topic will be returned IF the typeName matches that of the + * existing <code>Topic</code>. If the type's do not match, <b>null </b> is returned. + * + * @param name The name of the topic to create. + * @param typeName The name of the type associated with the topic. + * @param topicListener The listener to be attached to the created topic if it is newly created. If the topic already + * exists, the provided listener is ignored. + * @return A new <code>Topic</code> if one does not already exist, or an existing topic with the same + * <code>name</code> and <code>typeName</code>, otherwise <b>null </b> + */ + public Topic createTopic(String name, String namespace, String typeName, TopicListener topicListener) { + + Topic topic = null; + + // Even before that, check that the type was registered + TypeSignature typeSignature = typeRegistry.lookupSignature(typeName); + if (typeSignature == null) { + throw new RuntimeException(String.format("No type signature with name [%s] was found.", typeName)); + } else { + + // First check to see if the topic already exists + TopicDescription topicDescription = lookupTopicDescription(namespace, name); + if (topicDescription != null && topicDescription instanceof Topic) { + + topic = (Topic) topicDescription; + + // Make sure that the type name is the same, otherwise it is failure + if (topic.getTypeName().equals(typeName)) { + // Track that another create has been called for this topic + topic.incrementCount(); + } else { + // There is a violation, and no topic will be returned since a topic + // with this name already exists, but the types do not match + throw new RuntimeException( + String.format( + "found topic name:[%s] namespace:[%s] but there was a type incompatibility between [%s] (from topic [%s]) and [%s].", + name, namespace, topic.getTypeName(), topic.getName(), typeName)); + } + } else { // Otherwise, the topic did not already exist + topic = new Topic(this, typeSignature, name, namespace, this.isEnabled(), topicListener, this); + topics.put(namespace, name, topic); + } + } + return topic; + } + + /** + * This method deletes a <code>Topic</code> previously created by this <code>DomainParticipant</code>. No action will + * be taken if the topic still has data readers/writers attached to it, or if it was not created by this + * <code>DomainParticipant</code>. + * + * @param topic The topic to delete. + * @return {@link ReturnCode#OK}if the topic was successfully removed, {@link ReturnCode#PRECONDITION_NOT_MET}if the + * topic has readers/writers or was not created by this DomainParticipant, {@link ReturnCode#NOT_ENABLED}if + * this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}. + */ + public ReturnCode deleteTopic(Topic topic) { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + // Check the pre-condition + if (topic.hasDataReaders()) { + return ReturnCode.PRECONDITION_NOT_MET; + } + // Check the pre-condition + if (topic.hasDataWriters()) { + return ReturnCode.PRECONDITION_NOT_MET; + } + + // Check that a topic was supplied + if (topic == null) { + return ReturnCode.ERROR; + } + + // Attempt to remove, if it did not exist in our list then return an error, + // since it can only be removed from the <code>DomainParticipant</code> which created it. + if (topics.containsKey(topic.getNamespace() + topic.getName())) { + // Reduce the count of creations by 1 + topic.decrementCount(); + + // If the creation count is zero, then remove it from the list + if (topic.getCount() <= 0) { + topics.removeValues(topic.getNamespace() + topic.getName()); + } + + return ReturnCode.OK; + } else { + return ReturnCode.PRECONDITION_NOT_MET; + } + } + + /** + * Get a <code>TopicDescription</code> that matches a particular name. PARTIAL: Since the + * <code>ContentFilteredTopic</code> and <code>MultiTopic</code> classes are not implemented, this method simply + * searches the list of <code>Topic</code> classes. + * + * @param namespace The name to match against the <code>TopicDescription</code>. + * @return The <code>TopicDescription</code> that has the specified name, <b>null </b> if no such one exists. + */ + public TopicDescription lookupTopicDescription(String namespace, String topic) { + //PARTIAL ContentFilteredTopic and MultiTopic are not implemented, so this only searches Topic. + return findTopicByName(namespace, topic); + } + + /** + * Searches the current list of Topics for this DomainParticipant for a topic whose name matches the provided + * topicName + * + * @param topicName The topic name to match + * @return A reference to the existing topic whose name matches topicName, or null if no such topic exists. + */ + private Topic findTopicByName(String namespace, String topicName) { + return topics.get(namespace, topicName); + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + * + * @return {@link ReturnCode#OK}if the participant was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED} + * if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}. + */ + public ReturnCode ignoreParticipant() { + // UNSURE this is stubbed for now, until we determine it's necessity + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + * + * @return {@link ReturnCode#OK}if the topic was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED}if + * this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}. + */ + public ReturnCode ignoreTopic() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) { + throw new NotImplementedException(); + } + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + * + * @return {@link ReturnCode#OK}if the publication was successfully set to be ignored, {@link ReturnCode#NOT_ENABLED} + * if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}. + */ + public ReturnCode ignorePublication() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) { + throw new NotImplementedException(); + } + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + * + * @return {@link ReturnCode#OK}if the subscription was successfully set to be ignored, + * {@link ReturnCode#NOT_ENABLED}if this DomainParticipant is not enabled, or {@link ReturnCode#ERROR}. + */ + public ReturnCode ignoreSubscription() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) { + throw new NotImplementedException(); + } + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + return ReturnCode.ERROR; + } + + /** + * Gets the <code>DomainId</code> that this <code>DomainParticipant</code> belongs to. + * + * @return The <code>DomainId</code> of this participant. + */ + public DomainId getDomainId() { + return domainId; + } + + /** + * Performs a deep deletion of contained entities (Publishers, Subscribers, Topics). This will cause a recursive call + * of <code>deleteContainedEntities</code> through out all of the contained entities. This can only be performed if + * the <code>DomainParticipant</code> is enabled. + * + * @return {@link ReturnCode#OK}if the all entities were successfully deleted, or {@link ReturnCode#NOT_ENABLED}if + * this DomainParticipant is not enabled. + */ + public ReturnCode deleteContainedEntities() { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) { + return ReturnCode.NOT_ENABLED; + } + + for (Publisher publisher : publishers) { + publisher.deleteContainedEntities(); + } + publishers.clear(); + + for (Subscriber subscriber : subscribers) { + subscriber.deleteContainedEntities(); + } + + subscribers.clear(); + + this.middlewarePublisher = null; + + // Topics do not contain anything else + topics.clear(); + + return ReturnCode.OK; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been + * implemented or used. + */ + public void assertLiveliness() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) { + throw new NotImplementedException(); + } + } + + /** + * Returns true iff this <code>DomainParticipant</code> contains at least one publisher, subscriber or topic. + * + * @return <b>true </b> if this contains an entity, <b>false </b> otherwise. + */ + public boolean hasEntities() { + return !(publishers.isEmpty() && subscribers.isEmpty() && topics.isEmpty()); + } + + /** + * Propagates the published data to each <code>Subscriber</code> of this <code>DomainParticipant</code>. Notifies the + * middleware (by means of the {@link DomainParticipantListener}of the new data unless it originated from the + * middlewarePublisher. The middleware is only notified of data originating from this <code>DomainPariticipant</code> + * , that is, data published from other participants in the domain will not be sent to the middleware. + * + * @param destination TODO + * @param source TODO + * @param dataStoreItem The <code>DataStoreItem</code> that was published. + */ + void processPublishedData(IDestination destination, ISource source, DataStoreItem dataStoreItem) { // package scope since it is a + // system-level call + + // Notify the middleware of new data, unless it was published by the middlewarePublisher + // When data is published by the middlewarePublisher it does not have an associated DataWriter + + DataWriter writer = dataStoreItem.getTheWriter(); + if (writer != null) { + // Invoke the DomainParticipantListener if available + DomainParticipantListener domainParticipantListener = getListener(); + if (domainParticipantListener != null) { + domainParticipantListener.onPublishNotifyMiddleware(destination, source, dataStoreItem); + } + + // If the writer has a listener, then invoke it + DataWriterListener writerListener = writer.getListener(); + if (writerListener != null) { + writerListener.onDataSentToMiddleware(writer); + } + + } + + if (writer == null || writer != null && writer.isPublishBackToLocalDDSReaders()) { + // Notify all of the subscribers in our domain + for (Subscriber domainSubscribers : subscribers) { + domainSubscribers.processNewData(dataStoreItem); + } + } + } + + /** + * Gets the <code>TypeRegistry</code> used by {@link TypeSupport}to store the types registered for this + * <code>DomainParticipant</code>. + * + * @return Returns the typeRegistry. + */ + public TypeRegistry getTypeRegistry() { + return typeRegistry; + } + + /** + * Gets the Middleware <code>Publisher</code> if one has been created. + * + * @return Returns the <code>Publisher</code> for the middleware, or null if it has not been created. + * @see DomainParticipant + */ + public Publisher getMiddlewarePublisher() { + return middlewarePublisher; + } + + /** + * Gets the current <code>Collection</code> of <code>Publisher</code>'s for this <code>DomainPariticpant</code>. + * + * @return Returns the <code>Collection</code> of <code>Publisher</code> 's. + */ + public CopyOnWriteArrayList<Publisher> getPublishers() { + return publishers; + } + + public void dispose() { + for (Topic topic : topics.values()) { + topic.clearDataReaders(); + topic.clearDataWriters(); + } + topics.clear(); + for (Subscriber subscriber : subscribers) { + if (subscriber.deleteContainedEntities() == ReturnCode.NOT_ENABLED) { + System.err.println("failed to delete subscriber because it was not enabled"); + } + } + subscribers.clear(); + + for (Publisher publisher : publishers) { + publisher.dispose(); + } + publishers.clear(); + + typeRegistry.clear(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipantFactory.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipantFactory.java index 4dc0f3c55da..affdf6d51b2 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipantFactory.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainParticipantFactory.java @@ -8,135 +8,135 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener;
-import org.eclipse.osee.ote.messaging.dds.service.DomainId;
-
-/**
- * This is the entry point of the DDS system. This is a singleton factory class used by the application to create <code>DomainParticipant</code> 's.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DomainParticipantFactory implements EntityFactory {
- private static DomainParticipantFactory factory = null;
- private Map<DomainId, Collection<DomainParticipant>> domainMap;
-
- private DomainParticipantFactory() {
- // This map is very important since data must be sent to all
- domainMap = Collections.synchronizedMap(new HashMap<DomainId, Collection<DomainParticipant>>(10, .75f));
- }
-
- /**
- * This is a singleton class so this will always return the same DomainParticipantFactory.
- *
- * @return The instance of the <code>DomainParticipantFactory</code>
- */
- public static DomainParticipantFactory getInstance() {
- if (factory == null)
- factory = new DomainParticipantFactory();
-
- return factory;
- }
-
- /**
- * Creates a <code>DomainParticipant</code> that belongs to this <code>DomainParticipantFactory</code>
- *
- * @param domainId The ID of the domain that the <code>DomainParticipant</code> should belong to. All participants will receive publications from any
- * publisher in the domain.
- * @param listener The listener to attach to the <code>DomainParticipant</code>.
- * @param threadedPublishing <b>true </b> if the participant should use a separate thread for processing publications.
- * @return A DomainParticipant in the domainId with provided listener attached.
- */
- public DomainParticipant createParticipant(DomainId domainId, DomainParticipantListener listener, boolean threadedPublishing) {
-
- Collection<DomainParticipant> domain = domainMap.get(domainId);
-
- // If there is not a collection for this ID yet, then make one and add it to the hash
- if (domain == null) {
- domain = Collections.synchronizedList(new ArrayList<DomainParticipant>(1));
- domainMap.put(domainId, domain);
- }
-
- // Get a new DomainParticipant
- DomainParticipant participant = new DomainParticipant(domainId, domain, this.isEnabled(), listener, this, threadedPublishing);
-
- // Add the participant to that domain collection
- domain.add(participant);
-
- return participant;
- }
-
- /**
- * Removes a <code>DomainParticipant</code> from the <code>DomainParticipantFactory</code>. If the participant contains entities the method will fail.
- * This can be satisfied by calling {@link DomainParticipant#deleteContainedEntities()}on the participant.
- *
- * @param participant The participant to be removed.
- * @return {@link ReturnCode#OK}if successful, otherwise {@link ReturnCode#PRECONDITION_NOT_MET}.
- */
- public ReturnCode deleteParticipant(DomainParticipant participant) {
- // Check the pre-conditions
- // NOTE: This can be satisfied by calling deleteContainedEntities() on the participant
- if (participant.hasEntities())
- return ReturnCode.PRECONDITION_NOT_MET;
-
- // Remove the participant and return OK status
- Collection<DomainParticipant> domain = domainMap.get(participant.getDomainId());
-
- // If the domain doesn't exist, return ALREADY_DELETED
- if (domain == null)
- return ReturnCode.ALREADY_DELETED;
-
- // Remove the participant from the domain
- domain.remove(participant);
-
- // If the domain is empty now, then remove it from the map
- if (domain.isEmpty())
- domainMap.remove(participant.getDomainId());
-
- return ReturnCode.OK;
- }
-
- /**
- * Finds a <code>DomainParticipant</code> that belongs to the domain passed. If multiple <code>DomainPariticpant</code>'s are in the domain, any one of
- * them may be returned.
- *
- * @param domainId The domain to find a <code>DomainParticipant</code> in.
- * @return A <code>DomainParticipant</code> whose domainId matches the id provided, or NULL if the factory does not contain a participant in the provided
- * domain.
- */
- public DomainParticipant lookupParticipant(DomainId domainId) {
-
- // Attempt to find a matching participant
- Collection<DomainParticipant> domain = domainMap.get(domainId);
-
- // If the domain exists, then get the first participant from the domain
- if (domain != null)
- return (DomainParticipant) domain.iterator().next();
- // Otherwise, no such participant exists
- else
- return null;
- }
-
- public boolean isEnabled() {
- // This is always true because DomainParticipantFactory is never disabled nor disableable.
- return true;
- }
-
- public static void dispose() {
- for (Collection<DomainParticipant> collection : factory.domainMap.values()) {
- for (DomainParticipant p : collection) {
- p.dispose();
- }
- }
- factory.domainMap.clear();
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener; +import org.eclipse.osee.ote.messaging.dds.service.DomainId; + +/** + * This is the entry point of the DDS system. This is a singleton factory class used by the application to create <code>DomainParticipant</code> 's. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DomainParticipantFactory implements EntityFactory { + private static DomainParticipantFactory factory = null; + private Map<DomainId, Collection<DomainParticipant>> domainMap; + + private DomainParticipantFactory() { + // This map is very important since data must be sent to all + domainMap = Collections.synchronizedMap(new HashMap<DomainId, Collection<DomainParticipant>>(10, .75f)); + } + + /** + * This is a singleton class so this will always return the same DomainParticipantFactory. + * + * @return The instance of the <code>DomainParticipantFactory</code> + */ + public static DomainParticipantFactory getInstance() { + if (factory == null) + factory = new DomainParticipantFactory(); + + return factory; + } + + /** + * Creates a <code>DomainParticipant</code> that belongs to this <code>DomainParticipantFactory</code> + * + * @param domainId The ID of the domain that the <code>DomainParticipant</code> should belong to. All participants will receive publications from any + * publisher in the domain. + * @param listener The listener to attach to the <code>DomainParticipant</code>. + * @param threadedPublishing <b>true </b> if the participant should use a separate thread for processing publications. + * @return A DomainParticipant in the domainId with provided listener attached. + */ + public DomainParticipant createParticipant(DomainId domainId, DomainParticipantListener listener, boolean threadedPublishing) { + + Collection<DomainParticipant> domain = domainMap.get(domainId); + + // If there is not a collection for this ID yet, then make one and add it to the hash + if (domain == null) { + domain = Collections.synchronizedList(new ArrayList<DomainParticipant>(1)); + domainMap.put(domainId, domain); + } + + // Get a new DomainParticipant + DomainParticipant participant = new DomainParticipant(domainId, domain, this.isEnabled(), listener, this, threadedPublishing); + + // Add the participant to that domain collection + domain.add(participant); + + return participant; + } + + /** + * Removes a <code>DomainParticipant</code> from the <code>DomainParticipantFactory</code>. If the participant contains entities the method will fail. + * This can be satisfied by calling {@link DomainParticipant#deleteContainedEntities()}on the participant. + * + * @param participant The participant to be removed. + * @return {@link ReturnCode#OK}if successful, otherwise {@link ReturnCode#PRECONDITION_NOT_MET}. + */ + public ReturnCode deleteParticipant(DomainParticipant participant) { + // Check the pre-conditions + // NOTE: This can be satisfied by calling deleteContainedEntities() on the participant + if (participant.hasEntities()) + return ReturnCode.PRECONDITION_NOT_MET; + + // Remove the participant and return OK status + Collection<DomainParticipant> domain = domainMap.get(participant.getDomainId()); + + // If the domain doesn't exist, return ALREADY_DELETED + if (domain == null) + return ReturnCode.ALREADY_DELETED; + + // Remove the participant from the domain + domain.remove(participant); + + // If the domain is empty now, then remove it from the map + if (domain.isEmpty()) + domainMap.remove(participant.getDomainId()); + + return ReturnCode.OK; + } + + /** + * Finds a <code>DomainParticipant</code> that belongs to the domain passed. If multiple <code>DomainPariticpant</code>'s are in the domain, any one of + * them may be returned. + * + * @param domainId The domain to find a <code>DomainParticipant</code> in. + * @return A <code>DomainParticipant</code> whose domainId matches the id provided, or NULL if the factory does not contain a participant in the provided + * domain. + */ + public DomainParticipant lookupParticipant(DomainId domainId) { + + // Attempt to find a matching participant + Collection<DomainParticipant> domain = domainMap.get(domainId); + + // If the domain exists, then get the first participant from the domain + if (domain != null) + return (DomainParticipant) domain.iterator().next(); + // Otherwise, no such participant exists + else + return null; + } + + public boolean isEnabled() { + // This is always true because DomainParticipantFactory is never disabled nor disableable. + return true; + } + + public static void dispose() { + for (Collection<DomainParticipant> collection : factory.domainMap.values()) { + for (DomainParticipant p : collection) { + p.dispose(); + } + } + factory.domainMap.clear(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java index 56e2c379116..596b7a62cf1 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java @@ -8,126 +8,126 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.StatusKind;
-import org.eclipse.osee.ote.messaging.dds.condition.StatusCondition;
-import org.eclipse.osee.ote.messaging.dds.listener.Listener;
-
-/**
- * Base class for all <code>Entity</code> objects. Provides common functionality needed for all Entities such as listeners, enabled, etc.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class Entity {
-
- private EntityFactory parentFactory;
- private Listener listener;
-
- @SuppressWarnings("unused")
- private StatusKind statusMask; // DONT_NEED This has not been implemented, but is called out in the spec
- private StatusCondition statusCondition; //DONT_NEED This has not been implemented, but is called out in the spec
- private StatusKind[] statusChanges; //DONT_NEED This has not been implemented, but is called out in the spec
- private boolean enabled;
-
- /**
- * Creates a default <code>Entity</code> with enabled set as passed, the listener attached, and a reference to the parent creating this.
- *
- * @param enabled The value to set for enabled. If true, <code>enabled()</code> is run.
- * @param listener The listener to be attached to this.
- * @param parentFactory The parent which is creating this.
- */
- public Entity(boolean enabled, Listener listener, EntityFactory parentFactory) {
- super();
-
- this.parentFactory = parentFactory;
- this.listener = listener;
-
- // DONT_NEED This has not been implemented, but is called out in the spec
- this.statusMask = null;
- this.statusCondition = null;
- this.statusChanges = null;
-
- // Default enabled to false, if it is passed as true then call enable() to set this as enabled.
- this.enabled = false; // This is correct
- if (enabled)
- this.enable();
- }
-
- /**
- * Sets the <code>Listener</code> attached to this <code>Entity</code>. If a listener is already set, this will replace it.
- * <p>
- * PARTIAL - The statusMask is not currently being used.
- *
- * @param listener The listener to attach to this.
- * @param statusMask The mask for this listener
- * @return {@link ReturnCode#OK}
- */
- protected ReturnCode setBaseListener(Listener listener, StatusKind statusMask) {
- this.listener = listener;
- this.statusMask = statusMask;
-
- return ReturnCode.OK;
- }
-
- /**
- * Gets the attached listener
- *
- * @return The <code>Listener</code> attached to this <code>Entity</code>.
- */
- protected Listener getBaseListener() {
- return listener;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public StatusCondition getStatusCondition() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return statusCondition;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public StatusKind[] getStatusChanges() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return statusChanges;
- }
-
- /**
- * Gets the enabled status.
- *
- * @return Returns <b>true </b> if this <code>Entity</code> has been enabled, otherwise <b>false </b>.
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * Enables this entity. This method is idempotent. Note that the creating factory for this entity must be enabled.
- *
- * @return {@link ReturnCode#OK}if successful, or if this was previously enabled. {@link ReturnCode#PRECONDITION_NOT_MET}if the creating factory is not
- * enabled.
- */
- public ReturnCode enable() {
-
- // Check pre-conditions
- if (!parentFactory.isEnabled())
- return ReturnCode.PRECONDITION_NOT_MET;
-
- // If the entity is already enabled, then do nothing and return
- if (enabled)
- return ReturnCode.OK;
-
- enabled = true;
- return ReturnCode.OK;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.StatusKind; +import org.eclipse.osee.ote.messaging.dds.condition.StatusCondition; +import org.eclipse.osee.ote.messaging.dds.listener.Listener; + +/** + * Base class for all <code>Entity</code> objects. Provides common functionality needed for all Entities such as listeners, enabled, etc. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class Entity { + + private EntityFactory parentFactory; + private Listener listener; + + @SuppressWarnings("unused") + private StatusKind statusMask; // DONT_NEED This has not been implemented, but is called out in the spec + private StatusCondition statusCondition; //DONT_NEED This has not been implemented, but is called out in the spec + private StatusKind[] statusChanges; //DONT_NEED This has not been implemented, but is called out in the spec + private boolean enabled; + + /** + * Creates a default <code>Entity</code> with enabled set as passed, the listener attached, and a reference to the parent creating this. + * + * @param enabled The value to set for enabled. If true, <code>enabled()</code> is run. + * @param listener The listener to be attached to this. + * @param parentFactory The parent which is creating this. + */ + public Entity(boolean enabled, Listener listener, EntityFactory parentFactory) { + super(); + + this.parentFactory = parentFactory; + this.listener = listener; + + // DONT_NEED This has not been implemented, but is called out in the spec + this.statusMask = null; + this.statusCondition = null; + this.statusChanges = null; + + // Default enabled to false, if it is passed as true then call enable() to set this as enabled. + this.enabled = false; // This is correct + if (enabled) + this.enable(); + } + + /** + * Sets the <code>Listener</code> attached to this <code>Entity</code>. If a listener is already set, this will replace it. + * <p> + * PARTIAL - The statusMask is not currently being used. + * + * @param listener The listener to attach to this. + * @param statusMask The mask for this listener + * @return {@link ReturnCode#OK} + */ + protected ReturnCode setBaseListener(Listener listener, StatusKind statusMask) { + this.listener = listener; + this.statusMask = statusMask; + + return ReturnCode.OK; + } + + /** + * Gets the attached listener + * + * @return The <code>Listener</code> attached to this <code>Entity</code>. + */ + protected Listener getBaseListener() { + return listener; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public StatusCondition getStatusCondition() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return statusCondition; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public StatusKind[] getStatusChanges() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return statusChanges; + } + + /** + * Gets the enabled status. + * + * @return Returns <b>true </b> if this <code>Entity</code> has been enabled, otherwise <b>false </b>. + */ + public boolean isEnabled() { + return enabled; + } + + /** + * Enables this entity. This method is idempotent. Note that the creating factory for this entity must be enabled. + * + * @return {@link ReturnCode#OK}if successful, or if this was previously enabled. {@link ReturnCode#PRECONDITION_NOT_MET}if the creating factory is not + * enabled. + */ + public ReturnCode enable() { + + // Check pre-conditions + if (!parentFactory.isEnabled()) + return ReturnCode.PRECONDITION_NOT_MET; + + // If the entity is already enabled, then do nothing and return + if (enabled) + return ReturnCode.OK; + + enabled = true; + return ReturnCode.OK; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/EntityFactory.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/EntityFactory.java index 1732ce4fa28..41ae149b8e0 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/EntityFactory.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/EntityFactory.java @@ -8,18 +8,18 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-/**
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface EntityFactory {
-
- /**
- * Gets the enabled status.
- *
- * @return Returns <b>true </b> if this has been enabled, otherwise <b>false </b>.
- */
- public boolean isEnabled();
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +/** + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface EntityFactory { + + /** + * Gets the enabled status. + * + * @return Returns <b>true </b> if this has been enabled, otherwise <b>false </b>. + */ + public boolean isEnabled(); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublicationBuiltinTopicData.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublicationBuiltinTopicData.java index 6c19def2130..c47173409e4 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublicationBuiltinTopicData.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublicationBuiltinTopicData.java @@ -8,32 +8,32 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import org.eclipse.osee.ote.messaging.dds.listener.TopicListener;
-import org.eclipse.osee.ote.messaging.dds.service.TypeSignature;
-
-//UNSURE This class has not been implemented, but is called out in the spec
-
-/**
- * This class is here for future functionality that is described in the DDS specification but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class PublicationBuiltinTopicData extends Topic {
-
- /**
- * @param participant
- * @param typeName
- * @param name
- * @param enabled
- * @param listener
- * @param parentFactory
- */
- PublicationBuiltinTopicData(DomainParticipant participant, TypeSignature typeName, String name, String namespace, boolean enabled, TopicListener listener, EntityFactory parentFactory) {
- super(participant, typeName, name, namespace, enabled, listener, parentFactory);
- }
-
-
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import org.eclipse.osee.ote.messaging.dds.listener.TopicListener; +import org.eclipse.osee.ote.messaging.dds.service.TypeSignature; + +//UNSURE This class has not been implemented, but is called out in the spec + +/** + * This class is here for future functionality that is described in the DDS specification but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class PublicationBuiltinTopicData extends Topic { + + /** + * @param participant + * @param typeName + * @param name + * @param enabled + * @param listener + * @param parentFactory + */ + PublicationBuiltinTopicData(DomainParticipant participant, TypeSignature typeName, String name, String namespace, boolean enabled, TopicListener listener, EntityFactory parentFactory) { + super(participant, typeName, name, namespace, enabled, listener, parentFactory); + } + + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublisherThread.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublisherThread.java index 752b63dc92b..9508239b74f 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublisherThread.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/PublisherThread.java @@ -8,60 +8,60 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Provides threading capability for the publication of data. The DDS system
- * makes use of this class internally and controls it as needed to control
- * the publication of data.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-class PublisherThread extends Thread {
- private DomainParticipant domainParticipant;
-
- /**
- * Get a <code>PublisherThread</code> for a particular <code>DomainParticipant</code>
- *
- * @param domainParticipant - The participant for the thread to call upon
- */
- public PublisherThread(DomainParticipant domainParticipant) {
- super("Publisher Thread");
- this.domainParticipant = domainParticipant;
- setDaemon(true);
- }
-
- public synchronized void run() {
-
- try {
- while (true) {
- wait(); // Wait for a notify
-
- // Once notified, call all the queue publishing
- Collection<Publisher> publishers = domainParticipant.getPublishers();
- synchronized (publishers) {
- Iterator<Publisher> iter = publishers.iterator();
- while (iter.hasNext()) {
- iter.next().publishQueuedData();
- }
- }
- }
- }
- catch (InterruptedException ex) {
- // We do not expect to be interrupted, so print the error
- ex.printStackTrace();
- }
- }
-
- /**
- * Method to cause the thread to publish the queue'd information in each <code>Subscriber</code>
- * then go back to sleep.
- */
- public synchronized void wakeUp() {
- notifyAll();
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import java.util.Collection; +import java.util.Iterator; + +/** + * Provides threading capability for the publication of data. The DDS system + * makes use of this class internally and controls it as needed to control + * the publication of data. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +class PublisherThread extends Thread { + private DomainParticipant domainParticipant; + + /** + * Get a <code>PublisherThread</code> for a particular <code>DomainParticipant</code> + * + * @param domainParticipant - The participant for the thread to call upon + */ + public PublisherThread(DomainParticipant domainParticipant) { + super("Publisher Thread"); + this.domainParticipant = domainParticipant; + setDaemon(true); + } + + public synchronized void run() { + + try { + while (true) { + wait(); // Wait for a notify + + // Once notified, call all the queue publishing + Collection<Publisher> publishers = domainParticipant.getPublishers(); + synchronized (publishers) { + Iterator<Publisher> iter = publishers.iterator(); + while (iter.hasNext()) { + iter.next().publishQueuedData(); + } + } + } + } + catch (InterruptedException ex) { + // We do not expect to be interrupted, so print the error + ex.printStackTrace(); + } + } + + /** + * Method to cause the thread to publish the queue'd information in each <code>Subscriber</code> + * then go back to sleep. + */ + public synchronized void wakeUp() { + notifyAll(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SampleInfo.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SampleInfo.java index c9c14009a28..2d47b7ef304 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SampleInfo.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SampleInfo.java @@ -8,271 +8,271 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-import org.eclipse.osee.ote.messaging.dds.InstanceStateKind;
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.SampleStateKind;
-import org.eclipse.osee.ote.messaging.dds.Time;
-import org.eclipse.osee.ote.messaging.dds.ViewStateKind;
-
-/*
- * NOTE: This class is in the same package as DataReader so that the setter methods
- * on this class can have 'default'/'package' visibility, allowing only the
- * DDS system classes modify the SampleInfo fields, and thusly causing the
- * application using the DDS system to only be able to read the fields.
- */
-
-/**
- * Provides information about a sample of data. This class is not fully implemented, but is passed
- * through the system with default values in the current implementation.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SampleInfo {
-
- public static final SampleInfo DEFAULT_SAMPLE_INFO = new SampleInfo(null, null, null, 0, 0, 0, 0, 0, null, null);
-
- private SampleStateKind sampleStateKind;
- private ViewStateKind viewStateKind;
- private InstanceStateKind instanceStateKind;
- private long disposeGenerationCount;
- private long noWritersGenerationCount;
- private long sampleRank;
- private long generationRank;
- private long absoluteGenerationRank;
- private Time sourceTimestamp;
- private InstanceHandle instanceHandle;
-
- /**
- * Create a <code>SampleInfo</code> with particular values for all of the state date.
- *
- */
- public SampleInfo(SampleStateKind sampleStateKind, ViewStateKind viewStateKind, InstanceStateKind instanceStateKind, long disposeGenerationCount,
- long noWritersGenerationCount, long sampleRank, long generationRank, long absoluteGenerationRank, Time sourceTimestamp, InstanceHandle instanceHandle) {
- super();
- this.sampleStateKind = sampleStateKind;
- this.viewStateKind = viewStateKind;
- this.instanceStateKind = instanceStateKind;
- this.disposeGenerationCount = disposeGenerationCount;
- this.noWritersGenerationCount = noWritersGenerationCount;
- this.sampleRank = sampleRank;
- this.generationRank = generationRank;
- this.absoluteGenerationRank = absoluteGenerationRank;
- this.sourceTimestamp = sourceTimestamp;
- this.instanceHandle = instanceHandle;
- }
-
- /**
- * Create a <code>SampleInfo</code> with default values for all of the state data.
- *
- */
- public SampleInfo() {
- this(SampleStateKind.NOT_READ, ViewStateKind.NEW, InstanceStateKind.ALIVE, 0, 0, 0, 0, 0, new Time(), new InstanceHandle());
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the absoluteGenerationRank.
- */
- public long getAbsoluteGenerationRank() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return absoluteGenerationRank;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the disposeGenerationCount.
- */
- public long getDisposeGenerationCount() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return disposeGenerationCount;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the generationRank.
- */
- public long getGenerationRank() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return generationRank;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the instanceHandle.
- */
- public InstanceHandle getInstanceHandle() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return instanceHandle;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the instanceStateKind.
- */
- public InstanceStateKind getInstanceStateKind() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return instanceStateKind;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the noWritersGenerationCount.
- */
- public long getNoWritersGenerationCount() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return noWritersGenerationCount;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the sampleRank.
- */
- public long getSampleRank() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return sampleRank;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the sampleStateKind.
- */
- public SampleStateKind getSampleStateKind() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return sampleStateKind;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the sourceTimestamp.
- */
- public Time getSourceTimestamp() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return sourceTimestamp;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @return Returns the viewStateKind.
- */
- public ViewStateKind getViewStateKind() {
- //DONT_NEED
- if (true) throw new NotImplementedException();
- return viewStateKind;
- }
-
- public void copyFrom(SampleInfo sampleInfo) {
- this.sampleStateKind = sampleInfo.sampleStateKind;
- this.viewStateKind = sampleInfo.viewStateKind;
- this.instanceStateKind = sampleInfo.instanceStateKind;
- this.disposeGenerationCount = sampleInfo.disposeGenerationCount;
- this.noWritersGenerationCount = sampleInfo.noWritersGenerationCount;
- this.sampleRank = sampleInfo.sampleRank;
- this.generationRank = sampleInfo.generationRank;
- this.absoluteGenerationRank = sampleInfo.absoluteGenerationRank;
- this.sourceTimestamp.copyFrom(sampleInfo.sourceTimestamp);
- this.instanceHandle.copyFrom(sampleInfo.instanceHandle);
- }
-
- /**
- * @param absoluteGenerationRank The absoluteGenerationRank to set.
- */
- void setAbsoluteGenerationRank(long absoluteGenerationRank) {
- this.absoluteGenerationRank = absoluteGenerationRank;
- }
-
- /**
- * @param disposeGenerationCount The disposeGenerationCount to set.
- */
- void setDisposeGenerationCount(long disposeGenerationCount) {
- this.disposeGenerationCount = disposeGenerationCount;
- }
-
- /**
- * @param generationRank The generationRank to set.
- */
- void setGenerationRank(long generationRank) {
- this.generationRank = generationRank;
- }
-
- /**
- * @param instanceHandle The instanceHandle to set.
- */
- void setInstanceHandle(InstanceHandle instanceHandle) {
- this.instanceHandle = instanceHandle;
- }
-
- /**
- * @param instanceStateKind The instanceStateKind to set.
- */
- void setInstanceStateKind(InstanceStateKind instanceStateKind) {
- this.instanceStateKind = instanceStateKind;
- }
-
- /**
- * @param noWritersGenerationCount The noWritersGenerationCount to set.
- */
- void setNoWritersGenerationCount(long noWritersGenerationCount) {
- this.noWritersGenerationCount = noWritersGenerationCount;
- }
-
- /**
- * @param sampleRank The sampleRank to set.
- */
- void setSampleRank(long sampleRank) {
- this.sampleRank = sampleRank;
- }
-
- /**
- * @param sampleStateKind The sampleStateKind to set.
- */
- void setSampleStateKind(SampleStateKind sampleStateKind) {
- this.sampleStateKind = sampleStateKind;
- }
-
- /**
- * @param sourceTimestamp The sourceTimestamp to set.
- */
- void setSourceTimestamp(Time sourceTimestamp) {
- this.sourceTimestamp = sourceTimestamp;
- }
-
- /**
- * @param viewStateKind The viewStateKind to set.
- */
- void setViewStateKind(ViewStateKind viewStateKind) {
- this.viewStateKind = viewStateKind;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; +import org.eclipse.osee.ote.messaging.dds.InstanceStateKind; +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.SampleStateKind; +import org.eclipse.osee.ote.messaging.dds.Time; +import org.eclipse.osee.ote.messaging.dds.ViewStateKind; + +/* + * NOTE: This class is in the same package as DataReader so that the setter methods + * on this class can have 'default'/'package' visibility, allowing only the + * DDS system classes modify the SampleInfo fields, and thusly causing the + * application using the DDS system to only be able to read the fields. + */ + +/** + * Provides information about a sample of data. This class is not fully implemented, but is passed + * through the system with default values in the current implementation. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SampleInfo { + + public static final SampleInfo DEFAULT_SAMPLE_INFO = new SampleInfo(null, null, null, 0, 0, 0, 0, 0, null, null); + + private SampleStateKind sampleStateKind; + private ViewStateKind viewStateKind; + private InstanceStateKind instanceStateKind; + private long disposeGenerationCount; + private long noWritersGenerationCount; + private long sampleRank; + private long generationRank; + private long absoluteGenerationRank; + private Time sourceTimestamp; + private InstanceHandle instanceHandle; + + /** + * Create a <code>SampleInfo</code> with particular values for all of the state date. + * + */ + public SampleInfo(SampleStateKind sampleStateKind, ViewStateKind viewStateKind, InstanceStateKind instanceStateKind, long disposeGenerationCount, + long noWritersGenerationCount, long sampleRank, long generationRank, long absoluteGenerationRank, Time sourceTimestamp, InstanceHandle instanceHandle) { + super(); + this.sampleStateKind = sampleStateKind; + this.viewStateKind = viewStateKind; + this.instanceStateKind = instanceStateKind; + this.disposeGenerationCount = disposeGenerationCount; + this.noWritersGenerationCount = noWritersGenerationCount; + this.sampleRank = sampleRank; + this.generationRank = generationRank; + this.absoluteGenerationRank = absoluteGenerationRank; + this.sourceTimestamp = sourceTimestamp; + this.instanceHandle = instanceHandle; + } + + /** + * Create a <code>SampleInfo</code> with default values for all of the state data. + * + */ + public SampleInfo() { + this(SampleStateKind.NOT_READ, ViewStateKind.NEW, InstanceStateKind.ALIVE, 0, 0, 0, 0, 0, new Time(), new InstanceHandle()); + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the absoluteGenerationRank. + */ + public long getAbsoluteGenerationRank() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return absoluteGenerationRank; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the disposeGenerationCount. + */ + public long getDisposeGenerationCount() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return disposeGenerationCount; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the generationRank. + */ + public long getGenerationRank() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return generationRank; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the instanceHandle. + */ + public InstanceHandle getInstanceHandle() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return instanceHandle; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the instanceStateKind. + */ + public InstanceStateKind getInstanceStateKind() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return instanceStateKind; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the noWritersGenerationCount. + */ + public long getNoWritersGenerationCount() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return noWritersGenerationCount; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the sampleRank. + */ + public long getSampleRank() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return sampleRank; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the sampleStateKind. + */ + public SampleStateKind getSampleStateKind() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return sampleStateKind; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the sourceTimestamp. + */ + public Time getSourceTimestamp() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return sourceTimestamp; + } + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @return Returns the viewStateKind. + */ + public ViewStateKind getViewStateKind() { + //DONT_NEED + if (true) throw new NotImplementedException(); + return viewStateKind; + } + + public void copyFrom(SampleInfo sampleInfo) { + this.sampleStateKind = sampleInfo.sampleStateKind; + this.viewStateKind = sampleInfo.viewStateKind; + this.instanceStateKind = sampleInfo.instanceStateKind; + this.disposeGenerationCount = sampleInfo.disposeGenerationCount; + this.noWritersGenerationCount = sampleInfo.noWritersGenerationCount; + this.sampleRank = sampleInfo.sampleRank; + this.generationRank = sampleInfo.generationRank; + this.absoluteGenerationRank = sampleInfo.absoluteGenerationRank; + this.sourceTimestamp.copyFrom(sampleInfo.sourceTimestamp); + this.instanceHandle.copyFrom(sampleInfo.instanceHandle); + } + + /** + * @param absoluteGenerationRank The absoluteGenerationRank to set. + */ + void setAbsoluteGenerationRank(long absoluteGenerationRank) { + this.absoluteGenerationRank = absoluteGenerationRank; + } + + /** + * @param disposeGenerationCount The disposeGenerationCount to set. + */ + void setDisposeGenerationCount(long disposeGenerationCount) { + this.disposeGenerationCount = disposeGenerationCount; + } + + /** + * @param generationRank The generationRank to set. + */ + void setGenerationRank(long generationRank) { + this.generationRank = generationRank; + } + + /** + * @param instanceHandle The instanceHandle to set. + */ + void setInstanceHandle(InstanceHandle instanceHandle) { + this.instanceHandle = instanceHandle; + } + + /** + * @param instanceStateKind The instanceStateKind to set. + */ + void setInstanceStateKind(InstanceStateKind instanceStateKind) { + this.instanceStateKind = instanceStateKind; + } + + /** + * @param noWritersGenerationCount The noWritersGenerationCount to set. + */ + void setNoWritersGenerationCount(long noWritersGenerationCount) { + this.noWritersGenerationCount = noWritersGenerationCount; + } + + /** + * @param sampleRank The sampleRank to set. + */ + void setSampleRank(long sampleRank) { + this.sampleRank = sampleRank; + } + + /** + * @param sampleStateKind The sampleStateKind to set. + */ + void setSampleStateKind(SampleStateKind sampleStateKind) { + this.sampleStateKind = sampleStateKind; + } + + /** + * @param sourceTimestamp The sourceTimestamp to set. + */ + void setSourceTimestamp(Time sourceTimestamp) { + this.sourceTimestamp = sourceTimestamp; + } + + /** + * @param viewStateKind The viewStateKind to set. + */ + void setViewStateKind(ViewStateKind viewStateKind) { + this.viewStateKind = viewStateKind; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Subscriber.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Subscriber.java index 462ea8521c7..eae6c326b6a 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Subscriber.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Subscriber.java @@ -8,316 +8,316 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.StatusKind;
-import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener;
-import org.eclipse.osee.ote.messaging.dds.listener.Listener;
-import org.eclipse.osee.ote.messaging.dds.listener.SubscriberListener;
-import org.eclipse.osee.ote.messaging.dds.service.TopicDescription;
-import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus;
-
-/**
- * Provides functionality for applications to create <code>DataReader</code>'s to receive the appropriate published data. Maintains the data which is made
- * available to those <code>DataReader</code> 's.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class Subscriber extends DomainEntity implements EntityFactory {
-
- private final ConcurrentHashMap<TopicDescription, CopyOnWriteArrayList<DataReader>> topicMap = new ConcurrentHashMap<TopicDescription, CopyOnWriteArrayList<DataReader>>(512);
- private DomainParticipant participant;
- private final ExecutorService threadService;
- /**
- * Constructor for <code>Subscriber</code> with the provided listener attached, and enabled status set as passed. This constructor is only visible to the
- * DDS system, applications should use {@link DomainParticipant#createSubscriber(SubscriberListener)}to create a <code>Subscriber</code>.
- *
- * @param participant The participant creating this <code>Subscriber</code>. This is also used as the parentEntity for enabling purposes.
- * @param enabled If <b>true </b>, the created <code>Subscriber</code> will be enabled iff the parentEntity is enabled.
- * @param listener The listener to attach to the created subscriber.
- */
- Subscriber(DomainParticipant participant, boolean enabled, Listener listener) {
- super(enabled, listener, participant);
- this.participant = participant;
- threadService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
- }
-
- /**
- * Gets the attached listener.
- *
- * @return The <code>SubscriberListener</code> attached to this.
- * @see Entity#getBaseListener()
- */
- public SubscriberListener getListener() {
- return (SubscriberListener) super.getBaseListener();
- }
-
- /**
- * Sets the <code>SubscriberListener</code> attached to this. If a listener is already set, this will replace it.
- *
- * @see Entity#setBaseListener(Listener, StatusKind)
- */
- public ReturnCode setListener(SubscriberListener listener, StatusKind mask) {
- return super.setBaseListener(listener, mask);
- }
-
- /**
- * Creates a <code>DataReader</code> for the given <code>Topic</code> and adds it to this <code>Subscriber</code>.
- *
- * @param topicDescription The <code>Topic</code> associated with the <code>DataReader</code> to be created.
- * @param listener The <code>DataReaderListener</code> to be attached to the created <code>DataReader</code>.
- * @return The <code>DataReader</code> created, or null if it could not be created.
- */
- public DataReader createDataReader(TopicDescription topicDescription, DataReaderListener listener) {
- DataReader dataReader = null;
-
- if (true != (topicDescription instanceof Topic)) {
- return null;
- }
-
- //TUNE - get the classloader & constructor during Topic creation instead of here
- try {
-// Class readerClass = topic.getTypeSignature().getClassLoader().loadClass(topic.getTypeSignature().getReaderName());
-//
-// Constructor constructor = readerClass.getConstructor(new Class[] {TopicDescription.class, Subscriber.class, Boolean.class, DataReaderListener.class,
-// EntityFactory.class});
-//
-// dataReader = (DataReader) constructor.newInstance(new Object[] {topicDescription, this, new Boolean(this.isEnabled()), listener, this});
-
-
- dataReader = new DataReader(topicDescription, this, new Boolean(this.isEnabled()), listener, this);
- }
-// catch (InstantiationException ex) {
-// ex.printStackTrace();
-// }
-// catch (IllegalAccessException ex) {
-// ex.printStackTrace();
-// }
-// catch (ClassNotFoundException ex) {
-// ex.printStackTrace();
-// }
- catch (IllegalArgumentException ex) {
- ex.printStackTrace();
- }
- catch (SecurityException ex) {
- ex.printStackTrace();
- }
-// catch (InvocationTargetException ex) {
-// ex.printStackTrace();
-// }
-// catch (NoSuchMethodException ex) {
-// ex.printStackTrace();
-// }
- catch (OutOfMemoryError er) {
- er.printStackTrace();
- }
-
- // Only keep this writer if it was successfully created.
- if (dataReader != null) {
- CopyOnWriteArrayList<DataReader> readers = topicMap.get(topicDescription);
- if (readers == null) {
- readers = new CopyOnWriteArrayList<DataReader>();
- topicMap.put(topicDescription, readers);
- }
- readers.add(dataReader);
- }
- return dataReader;
- }
-
- /**
- * Removes the <code>DataReader</code> from this <code>Subscriber</code>. If the reader was already deleted, or was not created by this
- * <code>Subscriber</code>, an error is returned.
- *
- * @param dataReader The reader to delete.
- * @return {@link ReturnCode#OK}if the reader was successfully deleted, otherwise {@link ReturnCode#NOT_ENABLED}if this <code>Subscriber</code> is not
- * enabled, or {@link ReturnCode#ALREADY_DELETED}if the reader has already been deleted, or {@link ReturnCode#PRECONDITION_NOT_MET}if dataReader
- * was not created by this <code>Subscriber</code>.
- */
- public ReturnCode deleteDataReader(DataReader dataReader) {
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- // Check that the writer is not already marked as deleted (in case others kept a reference to it
- if (dataReader.isDeleted())
- return ReturnCode.ALREADY_DELETED;
-
-
-
-// boolean found = dataReaders.remove(dataReader);
-
- if (topicMap.remove(dataReader.getTopicDescription()) != null) {
- dataReader.markAsDeleted();
- return ReturnCode.OK;
- } else {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
-
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public DataReader lookupDataReader(String topicName) {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return null;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public ReturnCode beginAccess() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public ReturnCode endAccess() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public ReturnCode getDataReaders(Collection<DataReader> dataReaders, Collection<?> sampleStateKind, Collection<?> viewStateKind, Collection<?> instanceStateKind) {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
- return ReturnCode.ERROR;
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public void notifyDataReaders() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- }
-
- /**
- * This method is here for future functionality that is described in the DDS specification but has not been implemented or used.
- */
- public SampleLostStatus getSampleLostStatus() {
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true)
- throw new NotImplementedException();
- return null;
- }
-
- /**
- * @return the <code>DomainParticipant</code> to which this belongs.
- */
- public DomainParticipant getParticipant() {
- // NOTE this method is part of the DDS spec.
- return participant;
- }
-
- /**
- * Deletes all of the <code>DataReader</code> objects currently in this <code>Subscriber</code>.
- *
- * @return {@link ReturnCode#OK}if the readers were successfully deleted, otherwise {@link ReturnCode#NOT_ENABLED}if this <code>Subscriber</code> is not
- * enabled.
- */
- public ReturnCode deleteContainedEntities() {
- /*
- * PARTIAL per the DDS spec, this should also delete the ReadCondition and QueryCondition objects stored in the <code> DataReader </code> 's, however
- * because we haven't implemented the conditions they are not deleted here.
- */
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled())
- return ReturnCode.NOT_ENABLED;
-
-
-
- for (CopyOnWriteArrayList<DataReader> readers : topicMap.values()) {
- for (DataReader reader : readers) {
- reader.markAsDeleted();
- }
- readers.clear();
- }
- topicMap.clear();
- return ReturnCode.OK;
- }
-
- /**
- * @return <b>true </b> iff this <code>Subscriber</code> currently has any data readers.
- */
- public boolean hasDataReaders() {
- return !topicMap.isEmpty();
- }
-
- /**
- * Processes new data received. If this Subscriber has at least one DataReader who is interested in this data, and the <code>Subscriber</code> has an
- * attached listener, notify it via {@link SubscriberListener#onDataOnReaders(CopyOfSubscriber)}. Otherwise, if there is no <code>SubscriberListener</code> then
- * notify all of the interested <code>DataReader</code>'s via {@link DataReaderListener#onDataAvailable(DataReader)}. The data is stored so that it is
- * available for a reader to read or take.
- *
- * @param dataStoreItem The newly published data.
- */
- void processNewData(final DataStoreItem dataStoreItem) { // This has package scope since it is a system-level type call
- final Collection<DataReader> readers = topicMap.get(dataStoreItem.getTheTopicDescription());
- if (readers !=null && !readers.isEmpty()) {
-
- // SPEC NOTE: The following listener logic is based on paragraph "Listener access to Read Communication Status"
- // in the DDS specification.
-
- // Invoke the SubscriberListener if available
- SubscriberListener listener = getListener();
- if (listener != null) {
- listener.onDataOnReaders(this);
-
- // Otherwise, invoke the DataReaderListeners
- } else {
- // Check all DataReader objects for listeners
- for (final DataReader reader : readers){
- reader.processNewData(dataStoreItem);
- /*
- threadService.submit(new Runnable() {
- public void run() {
- reader.processNewData(dataStoreItem);
- }
-
- });
- */
-
- }
- }
- }
- }
+package org.eclipse.osee.ote.messaging.dds.entity; + +import java.util.Collection; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import org.eclipse.osee.ote.messaging.dds.DataStoreItem; +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.StatusKind; +import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener; +import org.eclipse.osee.ote.messaging.dds.listener.Listener; +import org.eclipse.osee.ote.messaging.dds.listener.SubscriberListener; +import org.eclipse.osee.ote.messaging.dds.service.TopicDescription; +import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus; + +/** + * Provides functionality for applications to create <code>DataReader</code>'s to receive the appropriate published data. Maintains the data which is made + * available to those <code>DataReader</code> 's. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class Subscriber extends DomainEntity implements EntityFactory { + + private final ConcurrentHashMap<TopicDescription, CopyOnWriteArrayList<DataReader>> topicMap = new ConcurrentHashMap<TopicDescription, CopyOnWriteArrayList<DataReader>>(512); + private DomainParticipant participant; + private final ExecutorService threadService; + /** + * Constructor for <code>Subscriber</code> with the provided listener attached, and enabled status set as passed. This constructor is only visible to the + * DDS system, applications should use {@link DomainParticipant#createSubscriber(SubscriberListener)}to create a <code>Subscriber</code>. + * + * @param participant The participant creating this <code>Subscriber</code>. This is also used as the parentEntity for enabling purposes. + * @param enabled If <b>true </b>, the created <code>Subscriber</code> will be enabled iff the parentEntity is enabled. + * @param listener The listener to attach to the created subscriber. + */ + Subscriber(DomainParticipant participant, boolean enabled, Listener listener) { + super(enabled, listener, participant); + this.participant = participant; + threadService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1); + } + + /** + * Gets the attached listener. + * + * @return The <code>SubscriberListener</code> attached to this. + * @see Entity#getBaseListener() + */ + public SubscriberListener getListener() { + return (SubscriberListener) super.getBaseListener(); + } + + /** + * Sets the <code>SubscriberListener</code> attached to this. If a listener is already set, this will replace it. + * + * @see Entity#setBaseListener(Listener, StatusKind) + */ + public ReturnCode setListener(SubscriberListener listener, StatusKind mask) { + return super.setBaseListener(listener, mask); + } + + /** + * Creates a <code>DataReader</code> for the given <code>Topic</code> and adds it to this <code>Subscriber</code>. + * + * @param topicDescription The <code>Topic</code> associated with the <code>DataReader</code> to be created. + * @param listener The <code>DataReaderListener</code> to be attached to the created <code>DataReader</code>. + * @return The <code>DataReader</code> created, or null if it could not be created. + */ + public DataReader createDataReader(TopicDescription topicDescription, DataReaderListener listener) { + DataReader dataReader = null; + + if (true != (topicDescription instanceof Topic)) { + return null; + } + + //TUNE - get the classloader & constructor during Topic creation instead of here + try { +// Class readerClass = topic.getTypeSignature().getClassLoader().loadClass(topic.getTypeSignature().getReaderName()); +// +// Constructor constructor = readerClass.getConstructor(new Class[] {TopicDescription.class, Subscriber.class, Boolean.class, DataReaderListener.class, +// EntityFactory.class}); +// +// dataReader = (DataReader) constructor.newInstance(new Object[] {topicDescription, this, new Boolean(this.isEnabled()), listener, this}); + + + dataReader = new DataReader(topicDescription, this, new Boolean(this.isEnabled()), listener, this); + } +// catch (InstantiationException ex) { +// ex.printStackTrace(); +// } +// catch (IllegalAccessException ex) { +// ex.printStackTrace(); +// } +// catch (ClassNotFoundException ex) { +// ex.printStackTrace(); +// } + catch (IllegalArgumentException ex) { + ex.printStackTrace(); + } + catch (SecurityException ex) { + ex.printStackTrace(); + } +// catch (InvocationTargetException ex) { +// ex.printStackTrace(); +// } +// catch (NoSuchMethodException ex) { +// ex.printStackTrace(); +// } + catch (OutOfMemoryError er) { + er.printStackTrace(); + } + + // Only keep this writer if it was successfully created. + if (dataReader != null) { + CopyOnWriteArrayList<DataReader> readers = topicMap.get(topicDescription); + if (readers == null) { + readers = new CopyOnWriteArrayList<DataReader>(); + topicMap.put(topicDescription, readers); + } + readers.add(dataReader); + } + return dataReader; + } + + /** + * Removes the <code>DataReader</code> from this <code>Subscriber</code>. If the reader was already deleted, or was not created by this + * <code>Subscriber</code>, an error is returned. + * + * @param dataReader The reader to delete. + * @return {@link ReturnCode#OK}if the reader was successfully deleted, otherwise {@link ReturnCode#NOT_ENABLED}if this <code>Subscriber</code> is not + * enabled, or {@link ReturnCode#ALREADY_DELETED}if the reader has already been deleted, or {@link ReturnCode#PRECONDITION_NOT_MET}if dataReader + * was not created by this <code>Subscriber</code>. + */ + public ReturnCode deleteDataReader(DataReader dataReader) { + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + // Check that the writer is not already marked as deleted (in case others kept a reference to it + if (dataReader.isDeleted()) + return ReturnCode.ALREADY_DELETED; + + + +// boolean found = dataReaders.remove(dataReader); + + if (topicMap.remove(dataReader.getTopicDescription()) != null) { + dataReader.markAsDeleted(); + return ReturnCode.OK; + } else { + return ReturnCode.PRECONDITION_NOT_MET; + } + + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public DataReader lookupDataReader(String topicName) { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return null; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public ReturnCode beginAccess() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public ReturnCode endAccess() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public ReturnCode getDataReaders(Collection<DataReader> dataReaders, Collection<?> sampleStateKind, Collection<?> viewStateKind, Collection<?> instanceStateKind) { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + return ReturnCode.ERROR; + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public void notifyDataReaders() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + } + + /** + * This method is here for future functionality that is described in the DDS specification but has not been implemented or used. + */ + public SampleLostStatus getSampleLostStatus() { + // UNSURE This method has not been implemented, but is called out in the spec + if (true) + throw new NotImplementedException(); + return null; + } + + /** + * @return the <code>DomainParticipant</code> to which this belongs. + */ + public DomainParticipant getParticipant() { + // NOTE this method is part of the DDS spec. + return participant; + } + + /** + * Deletes all of the <code>DataReader</code> objects currently in this <code>Subscriber</code>. + * + * @return {@link ReturnCode#OK}if the readers were successfully deleted, otherwise {@link ReturnCode#NOT_ENABLED}if this <code>Subscriber</code> is not + * enabled. + */ + public ReturnCode deleteContainedEntities() { + /* + * PARTIAL per the DDS spec, this should also delete the ReadCondition and QueryCondition objects stored in the <code> DataReader </code> 's, however + * because we haven't implemented the conditions they are not deleted here. + */ + + // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec) + if (!isEnabled()) + return ReturnCode.NOT_ENABLED; + + + + for (CopyOnWriteArrayList<DataReader> readers : topicMap.values()) { + for (DataReader reader : readers) { + reader.markAsDeleted(); + } + readers.clear(); + } + topicMap.clear(); + return ReturnCode.OK; + } + + /** + * @return <b>true </b> iff this <code>Subscriber</code> currently has any data readers. + */ + public boolean hasDataReaders() { + return !topicMap.isEmpty(); + } + + /** + * Processes new data received. If this Subscriber has at least one DataReader who is interested in this data, and the <code>Subscriber</code> has an + * attached listener, notify it via {@link SubscriberListener#onDataOnReaders(CopyOfSubscriber)}. Otherwise, if there is no <code>SubscriberListener</code> then + * notify all of the interested <code>DataReader</code>'s via {@link DataReaderListener#onDataAvailable(DataReader)}. The data is stored so that it is + * available for a reader to read or take. + * + * @param dataStoreItem The newly published data. + */ + void processNewData(final DataStoreItem dataStoreItem) { // This has package scope since it is a system-level type call + final Collection<DataReader> readers = topicMap.get(dataStoreItem.getTheTopicDescription()); + if (readers !=null && !readers.isEmpty()) { + + // SPEC NOTE: The following listener logic is based on paragraph "Listener access to Read Communication Status" + // in the DDS specification. + + // Invoke the SubscriberListener if available + SubscriberListener listener = getListener(); + if (listener != null) { + listener.onDataOnReaders(this); + + // Otherwise, invoke the DataReaderListeners + } else { + // Check all DataReader objects for listeners + for (final DataReader reader : readers){ + reader.processNewData(dataStoreItem); + /* + threadService.submit(new Runnable() { + public void run() { + reader.processNewData(dataStoreItem); + } + + }); + */ + + } + } + } + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SubscriptionBuiltinTopicData.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SubscriptionBuiltinTopicData.java index 81f8454f4d4..98b74e58fe5 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SubscriptionBuiltinTopicData.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/SubscriptionBuiltinTopicData.java @@ -8,31 +8,31 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.entity;
-
-import org.eclipse.osee.ote.messaging.dds.listener.TopicListener;
-import org.eclipse.osee.ote.messaging.dds.service.TypeSignature;
-
-//UNSURE This class has not been implemented, but is called out in the spec
-
-/**
- * This class is here for future functionality that is described in the DDS specification but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SubscriptionBuiltinTopicData extends Topic {
-
- /**
- * @param participant
- * @param typeName
- * @param name
- * @param enabled
- * @param listener
- * @param parentFactory
- */
- SubscriptionBuiltinTopicData(DomainParticipant participant, TypeSignature typeName, String name, String namespace, boolean enabled, TopicListener listener, EntityFactory parentFactory) {
- super(participant, typeName, name, namespace, enabled, listener, parentFactory);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds.entity; + +import org.eclipse.osee.ote.messaging.dds.listener.TopicListener; +import org.eclipse.osee.ote.messaging.dds.service.TypeSignature; + +//UNSURE This class has not been implemented, but is called out in the spec + +/** + * This class is here for future functionality that is described in the DDS specification but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SubscriptionBuiltinTopicData extends Topic { + + /** + * @param participant + * @param typeName + * @param name + * @param enabled + * @param listener + * @param parentFactory + */ + SubscriptionBuiltinTopicData(DomainParticipant participant, TypeSignature typeName, String name, String namespace, boolean enabled, TopicListener listener, EntityFactory parentFactory) { + super(participant, typeName, name, namespace, enabled, listener, parentFactory); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/package.html index e4fedf69ff6..47bbc8b9985 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides all of descendants of {@link osee.messaging.dds.entity.Entity} class, classes immediately controlled by these classes, and their factories.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides all of descendants of {@link osee.messaging.dds.entity.Entity} class, classes immediately controlled by these classes, and their factories. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataReaderListener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataReaderListener.java index fad88c4124f..31fe94e2641 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataReaderListener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataReaderListener.java @@ -8,68 +8,68 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus;
-
-/**
- * The interface for receiving events from a particular <code>DataReader</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.entity.DataReader
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface DataReaderListener extends Listener{
-
- /**
- * The method called when data is available for a <code>DataReader</code>. This method
- * is only called if there is no <code>SubscriberListener</code> assigned to the
- * <code>Subscriber</code> that created the <code>DataReader</code>.
- *
- * @param theReader - The reader for which data is available.
- */
- public void onDataAvailable(DataReader theReader);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onSampleRejected(DataReader theReader, SampleRejectedStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onSampleLost(DataReader theReader, SampleLostStatus status);
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus; +import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus; + +/** + * The interface for receiving events from a particular <code>DataReader</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.entity.DataReader + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface DataReaderListener extends Listener{ + + /** + * The method called when data is available for a <code>DataReader</code>. This method + * is only called if there is no <code>SubscriberListener</code> assigned to the + * <code>Subscriber</code> that created the <code>DataReader</code>. + * + * @param theReader - The reader for which data is available. + */ + public void onDataAvailable(DataReader theReader); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onSampleRejected(DataReader theReader, SampleRejectedStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onSampleLost(DataReader theReader, SampleLostStatus status); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataWriterListener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataWriterListener.java index 8eb3865d08d..f384722b8d8 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataWriterListener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/DataWriterListener.java @@ -8,51 +8,51 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessLostStatus;
-import org.eclipse.osee.ote.messaging.dds.status.OfferedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.OfferedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.PublicationMatchStatus;
-
-/**
- * The interface for receiving events from <code>DataWriter</code>'s.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface DataWriterListener extends Listener{
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onLivelinessLost(DataWriter theWriter, LivelinessLostStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onOfferedDeadlineMissed(DataWriter theWriter, OfferedDeadlineMissedStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onOfferedIncompatibleQos(DataWriter theWriter, OfferedIncompatibleQosStatus status);
-
- /**
- * This method is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- */
- public void onPublicationMatch(DataWriter theWriter, PublicationMatchStatus status);
-
- /**
- * This method is called when information for a <code>DataWriter</code> has been sent to the
- * middleware.
- *
- * @param theWriter - The <code>DataWriter</code> who's information was sent.
- */
- public void onDataSentToMiddleware(DataWriter theWriter);
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessLostStatus; +import org.eclipse.osee.ote.messaging.dds.status.OfferedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.OfferedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.PublicationMatchStatus; + +/** + * The interface for receiving events from <code>DataWriter</code>'s. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface DataWriterListener extends Listener{ + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onLivelinessLost(DataWriter theWriter, LivelinessLostStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onOfferedDeadlineMissed(DataWriter theWriter, OfferedDeadlineMissedStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onOfferedIncompatibleQos(DataWriter theWriter, OfferedIncompatibleQosStatus status); + + /** + * This method is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + */ + public void onPublicationMatch(DataWriter theWriter, PublicationMatchStatus status); + + /** + * This method is called when information for a <code>DataWriter</code> has been sent to the + * middleware. + * + * @param theWriter - The <code>DataWriter</code> who's information was sent. + */ + public void onDataSentToMiddleware(DataWriter theWriter); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/Listener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/Listener.java index 42893be880c..2a73ae5951c 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/Listener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/Listener.java @@ -8,16 +8,16 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-/**
- * This is the base interface for all of the DDS listener interfaces. The sole
- * purpose of this interface is to provide a common root for all of the
- * DDS listener interfaces.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface Listener {
-
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + +/** + * This is the base interface for all of the DDS listener interfaces. The sole + * purpose of this interface is to provide a common root for all of the + * DDS listener interfaces. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface Listener { + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/PublisherListener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/PublisherListener.java index 06db6909975..3f4fb6592dc 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/PublisherListener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/PublisherListener.java @@ -8,15 +8,15 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface PublisherListener extends DataWriterListener{
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface PublisherListener extends DataWriterListener{ +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/SubscriberListener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/SubscriberListener.java index ef9cf9d6105..a28112a7ec7 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/SubscriberListener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/SubscriberListener.java @@ -8,25 +8,25 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-import org.eclipse.osee.ote.messaging.dds.entity.Subscriber;
-
-/**
- * The listener interface for receiving notification that data is available to
- * <code>DataReader</code> objects in a <code>Subscriber</code>.
- *
- * @see org.eclipse.osee.ote.messaging.dds.entity.Subscriber
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface SubscriberListener extends DataReaderListener{
-
- /**
- * This is the first listener invoked when data becomes available. A
- * reference to the <code>Subscriber</code> with available information
- * is passed to the method.
- */
- public void onDataOnReaders(Subscriber theSubscriber);
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + +import org.eclipse.osee.ote.messaging.dds.entity.Subscriber; + +/** + * The listener interface for receiving notification that data is available to + * <code>DataReader</code> objects in a <code>Subscriber</code>. + * + * @see org.eclipse.osee.ote.messaging.dds.entity.Subscriber + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface SubscriberListener extends DataReaderListener{ + + /** + * This is the first listener invoked when data becomes available. A + * reference to the <code>Subscriber</code> with available information + * is passed to the method. + */ + public void onDataOnReaders(Subscriber theSubscriber); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/TopicListener.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/TopicListener.java index 6cc4b834a8b..11cce5c3512 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/TopicListener.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/TopicListener.java @@ -8,18 +8,18 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.listener;
-
-import org.eclipse.osee.ote.messaging.dds.entity.Topic;
-import org.eclipse.osee.ote.messaging.dds.status.InconsistentTopicStatus;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface TopicListener extends Listener{
- public void onInconsistentTopic(Topic theTopic, InconsistentTopicStatus status);
-}
+package org.eclipse.osee.ote.messaging.dds.listener; + +import org.eclipse.osee.ote.messaging.dds.entity.Topic; +import org.eclipse.osee.ote.messaging.dds.status.InconsistentTopicStatus; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface TopicListener extends Listener{ + public void onInconsistentTopic(Topic theTopic, InconsistentTopicStatus status); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/package.html index 221975004cc..66cee2586d2 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/listener/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides all of the listener interfaces supported by the DDS system.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides all of the listener interfaces supported by the DDS system. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/package.html index d7808a66144..d4782bc330a 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides the basic classes for the system, such as utility and miscellaneous classes.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides the basic classes for the system, such as utility and miscellaneous classes. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/QosPolicy.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/QosPolicy.java index 70e8bfb3faa..8e62c2f7758 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/QosPolicy.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/QosPolicy.java @@ -8,46 +8,46 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.qos;
-
-import org.eclipse.osee.ote.messaging.dds.NotImplementedException;
-
-/**
- * This class is here for future functionality that is described in the DDS specification
- * but has not been implemented or used.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class QosPolicy {
- public final static QosPolicy USERDATA_QOS_POLICY = new QosPolicy("UserData", 1);
-
- private String policyName;
- private long policyId;
-
-
- /**
- * @param policyName
- * @param policyId
- */
- private QosPolicy(String policyName, long policyId) {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true) throw new NotImplementedException();
- this.policyName = policyName;
- this.policyId = policyId;
- }
-
- public String getPolicyName() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true) throw new NotImplementedException();
-
- return policyName;
- }
-
- public long getPolicyId() {
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true) throw new NotImplementedException();
-
- return policyId;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.qos; + +import org.eclipse.osee.ote.messaging.dds.NotImplementedException; + +/** + * This class is here for future functionality that is described in the DDS specification + * but has not been implemented or used. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class QosPolicy { + public final static QosPolicy USERDATA_QOS_POLICY = new QosPolicy("UserData", 1); + + private String policyName; + private long policyId; + + + /** + * @param policyName + * @param policyId + */ + private QosPolicy(String policyName, long policyId) { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) throw new NotImplementedException(); + this.policyName = policyName; + this.policyId = policyId; + } + + public String getPolicyName() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) throw new NotImplementedException(); + + return policyName; + } + + public long getPolicyId() { + // DONT_NEED This method has not been implemented, but is called out in the spec + if (true) throw new NotImplementedException(); + + return policyId; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/package.html index b12eb4b942b..1bb4ec69d0b 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/qos/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides the Quality of Service support classes.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides the Quality of Service support classes. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/DomainId.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/DomainId.java index 2de7834025c..29dfe7925db 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/DomainId.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/DomainId.java @@ -8,46 +8,46 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-/**
- * Stores the data necessary to discern virtual DDS networks within a physical network.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class DomainId {
- private long id;
-
- /**
- * @param id - The id value for this <code>DomainId</code>.
- */
- public DomainId(long id) {
- super();
- this.id = id;
- }
-
- /**
- * @return Returns the id.
- */
- public long getId() {
- return id;
- }
-
- public boolean equals(Object obj) {
-
- if (obj instanceof DomainId) {
- DomainId domainId = (DomainId)obj;
- return domainId.id == this.id;
- }
-
- return false;
- }
-
- public int hashCode() {
- int result = 17;
- result = 1313723*result + (int)(id^(id>>>32));
-
- return result;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +/** + * Stores the data necessary to discern virtual DDS networks within a physical network. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class DomainId { + private long id; + + /** + * @param id - The id value for this <code>DomainId</code>. + */ + public DomainId(long id) { + super(); + this.id = id; + } + + /** + * @return Returns the id. + */ + public long getId() { + return id; + } + + public boolean equals(Object obj) { + + if (obj instanceof DomainId) { + DomainId domainId = (DomainId)obj; + return domainId.id == this.id; + } + + return false; + } + + public int hashCode() { + int result = 17; + result = 1313723*result + (int)(id^(id>>>32)); + + return result; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/Key.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/Key.java index 6590358c86b..94cc6af0632 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/Key.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/Key.java @@ -8,26 +8,26 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-/**
- * Provides the DDS system with a means of recognizing multiple instances of one type.
- * Users of the DDS system should provide an object that implements this interface
- * for topics which may have multiple instances.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface Key {
-
- /**
- * This method returns true iff the information in both sets of data
- * represent the same instance.
- *
- * This method should be commutative, that is, isSameInstance(A,B) should
- * always return the same value as isSameInstance(B,A).
- *
- * @return <b>true</b> if the data values are the same instance, <b>false</b> otherwise.
- */
- public boolean isSameInstance(byte[] data1, byte[] data2);
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +/** + * Provides the DDS system with a means of recognizing multiple instances of one type. + * Users of the DDS system should provide an object that implements this interface + * for topics which may have multiple instances. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface Key { + + /** + * This method returns true iff the information in both sets of data + * represent the same instance. + * + * This method should be commutative, that is, isSameInstance(A,B) should + * always return the same value as isSameInstance(B,A). + * + * @return <b>true</b> if the data values are the same instance, <b>false</b> otherwise. + */ + public boolean isSameInstance(byte[] data1, byte[] data2); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TopicDescription.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TopicDescription.java index 6161741decf..19839d7f495 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TopicDescription.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TopicDescription.java @@ -8,40 +8,40 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant;
-
-/**
- * Provides a description of all topic classes. Any class that is a topic of
- * some sort should implement this interface.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public interface TopicDescription {
-
- /**
- * The method which will supply the name used to create the topic.
- *
- * @return A string representation of the topic name.
- */
- public String getName();
-
- /**
- * The method which will return a reference to the <code>DomainParticipant</code>
- * which created the topic.
- *
- * @return The <code>DomainParticipant</code> that created this topic.
- */
- public DomainParticipant getParticipant();
-
- /**
- * The method which will supply the type name used to create the topic.
- *
- * @return A string representation of the type name.
- */
- public String getTypeName();
-
- public String getNamespace();
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant; + +/** + * Provides a description of all topic classes. Any class that is a topic of + * some sort should implement this interface. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public interface TopicDescription { + + /** + * The method which will supply the name used to create the topic. + * + * @return A string representation of the topic name. + */ + public String getName(); + + /** + * The method which will return a reference to the <code>DomainParticipant</code> + * which created the topic. + * + * @return The <code>DomainParticipant</code> that created this topic. + */ + public DomainParticipant getParticipant(); + + /** + * The method which will supply the type name used to create the topic. + * + * @return A string representation of the type name. + */ + public String getTypeName(); + + public String getNamespace(); +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeRegistry.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeRegistry.java index a3e7861acde..6f91fc76bf8 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeRegistry.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeRegistry.java @@ -8,82 +8,82 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-
-/**
- * Provides registration functionality of types that are used in the DDS system. The
- * registry relies on a hash map for optimum performance tuning which can be done via
- * the parameters to the constructor. The registry acts as the authority for types
- * by keeping track of <code>TypeSignature</code>'s.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class TypeRegistry {
- private Map<String, TypeSignature> typeHash;
-
- /**
- * Create a new <code>TypeRegistry</code> with particular characteristics. This is used
- * by portions of the DDS system for resolving necessary information about types during
- * run time.
- *
- * @param initialCapacity The initial capacity to create the hash map with
- * @param loadFactor The load factor for the hash map. This specifies how full the map can get
- * before more memory is allocated for the map.
- */
- public TypeRegistry(int initialCapacity, float loadFactor) {
- super();
- typeHash = Collections.synchronizedMap(new HashMap<String, TypeSignature>(initialCapacity, loadFactor));
- }
-
- /**
- * Register a <code>TypeSignature</code> with the registry.
- *
- * @see TypeSignature
- * @param signature The signature of the type to register.
- * @return OK if the type was registered. OUT_OF_RESOURCES if a memory error happened, or PRECONDITION_NOT_MET
- * if the signature conflicts with one already registered.
- */
- public ReturnCode register(TypeSignature signature) {
- ReturnCode retCode = ReturnCode.OK;
-
- TypeSignature checkSignature = typeHash.get(signature.getTypeName());
- // If the signature was not already registered, then add it.
- if (checkSignature == null) {
- try {
- typeHash.put(signature.getTypeName(), signature);
- } catch (OutOfMemoryError er) {
- er.printStackTrace();
- retCode = ReturnCode.OUT_OF_RESOURCES;
- }
-
- // If the signature was already registered, then make sure the signature is the same
- } else {
- if (!checkSignature.equals(signature))
- retCode = ReturnCode.PRECONDITION_NOT_MET;
- }
-
- return retCode;
- }
-
- /**
- * Provides the signature for a type with a particular name.
- *
- * @param typeName The name of the type to lookup
- * @return The appropriate signature for the name as registered with the registry, null if no
- * such signature exists.
- */
- public TypeSignature lookupSignature(String typeName) {
- return typeHash.get(typeName);
- }
-
- public void clear() {
- typeHash.clear();
- }
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.osee.ote.messaging.dds.ReturnCode; + +/** + * Provides registration functionality of types that are used in the DDS system. The + * registry relies on a hash map for optimum performance tuning which can be done via + * the parameters to the constructor. The registry acts as the authority for types + * by keeping track of <code>TypeSignature</code>'s. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class TypeRegistry { + private Map<String, TypeSignature> typeHash; + + /** + * Create a new <code>TypeRegistry</code> with particular characteristics. This is used + * by portions of the DDS system for resolving necessary information about types during + * run time. + * + * @param initialCapacity The initial capacity to create the hash map with + * @param loadFactor The load factor for the hash map. This specifies how full the map can get + * before more memory is allocated for the map. + */ + public TypeRegistry(int initialCapacity, float loadFactor) { + super(); + typeHash = Collections.synchronizedMap(new HashMap<String, TypeSignature>(initialCapacity, loadFactor)); + } + + /** + * Register a <code>TypeSignature</code> with the registry. + * + * @see TypeSignature + * @param signature The signature of the type to register. + * @return OK if the type was registered. OUT_OF_RESOURCES if a memory error happened, or PRECONDITION_NOT_MET + * if the signature conflicts with one already registered. + */ + public ReturnCode register(TypeSignature signature) { + ReturnCode retCode = ReturnCode.OK; + + TypeSignature checkSignature = typeHash.get(signature.getTypeName()); + // If the signature was not already registered, then add it. + if (checkSignature == null) { + try { + typeHash.put(signature.getTypeName(), signature); + } catch (OutOfMemoryError er) { + er.printStackTrace(); + retCode = ReturnCode.OUT_OF_RESOURCES; + } + + // If the signature was already registered, then make sure the signature is the same + } else { + if (!checkSignature.equals(signature)) + retCode = ReturnCode.PRECONDITION_NOT_MET; + } + + return retCode; + } + + /** + * Provides the signature for a type with a particular name. + * + * @param typeName The name of the type to lookup + * @return The appropriate signature for the name as registered with the registry, null if no + * such signature exists. + */ + public TypeSignature lookupSignature(String typeName) { + return typeHash.get(typeName); + } + + public void clear() { + typeHash.clear(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSignature.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSignature.java index cf693efa38f..fc6e4f894d9 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSignature.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSignature.java @@ -8,104 +8,104 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-import java.lang.ref.WeakReference;
-
-/**
- * Provides the necessary information to communicate type information for messaging
- * within the DDS system. This allows the DDS system to be introduced to new types
- * at run time, and be able to handle them properly.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class TypeSignature {
- private String typeName;
- private int typeDataSize;
- private WeakReference<Key> key;
- private String readerName;
- private String writerName;
- private WeakReference<ClassLoader> classLoader;
-
- /**
- * Create a <code>TypeSignature</code> with all of the necessary information.
- *
- * @param typeName The name used to reference this type.
- * @param typeDataSize The full size in bytes of this type when transmitted.
- * @param key The <code>Key</code> used to distinguish instances of data for this type.
- * @param readerName The name used to load the reader class for this type from the supplied class loader
- * @param writerName The name used to load the reader class for this type from the supplied class loader
- * @param classLoader The class loader which can load the reader and writer for this type
- */
- public TypeSignature(String typeName, int typeDataSize, Key key, String readerName, String writerName, ClassLoader classLoader) {
- super();
- this.typeName = typeName;
- this.typeDataSize = typeDataSize;
- this.key = new WeakReference<Key>(key);
- this.readerName = readerName;
- this.writerName = writerName;
- this.classLoader = new WeakReference<ClassLoader>( classLoader);
- }
-
- /**
- * @return Returns the classLoader.
- */
- public ClassLoader getClassLoader() {
- return classLoader.get();
- }
-
- /**
- * @return Returns the key.
- */
- public Key getKey() {
- return key.get();
- }
-
- /**
- * @return Returns the readerName.
- */
- public String getReaderName() {
- return readerName;
- }
-
- /**
- * @return Returns the typeDataSize.
- */
- public int getTypeDataSize() {
- return typeDataSize;
- }
-
- /**
- * @return Returns the typeName.
- */
- public String getTypeName() {
- return typeName;
- }
-
- /**
- * @return Returns the writerName.
- */
- public String getWriterName() {
- return writerName;
- }
-
- public boolean equals(Object obj) {
-
- if (obj instanceof TypeSignature) {
- TypeSignature signature = (TypeSignature)obj;
-
- return typeName.equals(signature.typeName) &&
- typeDataSize == signature.typeDataSize &&
- readerName.equals(signature.readerName) &&
- writerName.equals(signature.writerName) &&
- classLoader.get().equals(signature.classLoader.get());
- }
-
- return false;
- }
-
- public int hashCode() {
- return typeName.hashCode();
- }
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +import java.lang.ref.WeakReference; + +/** + * Provides the necessary information to communicate type information for messaging + * within the DDS system. This allows the DDS system to be introduced to new types + * at run time, and be able to handle them properly. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class TypeSignature { + private String typeName; + private int typeDataSize; + private WeakReference<Key> key; + private String readerName; + private String writerName; + private WeakReference<ClassLoader> classLoader; + + /** + * Create a <code>TypeSignature</code> with all of the necessary information. + * + * @param typeName The name used to reference this type. + * @param typeDataSize The full size in bytes of this type when transmitted. + * @param key The <code>Key</code> used to distinguish instances of data for this type. + * @param readerName The name used to load the reader class for this type from the supplied class loader + * @param writerName The name used to load the reader class for this type from the supplied class loader + * @param classLoader The class loader which can load the reader and writer for this type + */ + public TypeSignature(String typeName, int typeDataSize, Key key, String readerName, String writerName, ClassLoader classLoader) { + super(); + this.typeName = typeName; + this.typeDataSize = typeDataSize; + this.key = new WeakReference<Key>(key); + this.readerName = readerName; + this.writerName = writerName; + this.classLoader = new WeakReference<ClassLoader>( classLoader); + } + + /** + * @return Returns the classLoader. + */ + public ClassLoader getClassLoader() { + return classLoader.get(); + } + + /** + * @return Returns the key. + */ + public Key getKey() { + return key.get(); + } + + /** + * @return Returns the readerName. + */ + public String getReaderName() { + return readerName; + } + + /** + * @return Returns the typeDataSize. + */ + public int getTypeDataSize() { + return typeDataSize; + } + + /** + * @return Returns the typeName. + */ + public String getTypeName() { + return typeName; + } + + /** + * @return Returns the writerName. + */ + public String getWriterName() { + return writerName; + } + + public boolean equals(Object obj) { + + if (obj instanceof TypeSignature) { + TypeSignature signature = (TypeSignature)obj; + + return typeName.equals(signature.typeName) && + typeDataSize == signature.typeDataSize && + readerName.equals(signature.readerName) && + writerName.equals(signature.writerName) && + classLoader.get().equals(signature.classLoader.get()); + } + + return false; + } + + public int hashCode() { + return typeName.hashCode(); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSupport.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSupport.java index 77fa57bb052..2953c72233d 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSupport.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/TypeSupport.java @@ -8,80 +8,80 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.service;
-
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant;
-
-/**
- * The base class that needs to be extended by application specific type support classes.
- * This is used to allow the DDS system to recognize and make use of application specific
- * types for creating topics at run time.
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class TypeSupport {
-
- /**
- * The method which tells the system how large the data type is in bytes.
- *
- * @return The integer count of bytes for the type.
- */
- protected abstract int getTypeDataSize();
-
- /**
- * The method which supplies the <code>Key</code> for distinguishing instances
- * of this data type.
- *
- * @see Key
- */
- protected abstract Key getKey();
-
- /**
- * The method that supplies the class name for the application class that extends
- * <code>DataReader</code> for this type. The string returned must be formatted
- * such that the <code>ClassLoader</code> designated during registration will be able
- * to supply the reader.
- *
- * @return The class name for the reader of this type.
- */
- protected abstract String getReaderName();
-
- /**
- * The method that supplies the class name for the application class that extends
- * <code>DataWriter</code> for this type. The string returned must be formatted
- * such that the <code>ClassLoader</code> designated during registration will be able
- * to supply the writer.
- *
- * @return The class name for the writer of this type.
- */
- protected abstract String getWriterName();
-
- // TUNE should/could this method be made static ?
- /**
- * The method used to register this type. This method allows a the application to supply any
- * <code>ClassLoader</code> for the system to use to load the application specific data
- * readers and writers.
- *
- * @param participant - The <code>DomainParticipant</code> to register the type with.
- * @param typeName - The typeName to register this type as.
- * @param classLoader - The <code>ClassLoader</code> to register for this type.
- */
- public ReturnCode registerType(DomainParticipant participant, String typeName, ClassLoader classLoader) {
- return participant.getTypeRegistry().register(
- new TypeSignature(typeName, getTypeDataSize(), getKey(), getReaderName(), getWriterName(), classLoader));
- }
-
- /**
- * The method used to register this type. This method registers the type with the system
- * <code>ClassLoader</code> as the loader for the reader and writer.
- *
- * @param participant - The <code>DomainParticipant</code> to register the type with.
- * @param typeName - The typeName to register this type as.
- */
- public ReturnCode registerType(DomainParticipant participant, String typeName) {
- ClassLoader defaultClassLoader = ClassLoader.getSystemClassLoader();
-
- return registerType(participant, typeName, defaultClassLoader);
- }
-}
+package org.eclipse.osee.ote.messaging.dds.service; + +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant; + +/** + * The base class that needs to be extended by application specific type support classes. + * This is used to allow the DDS system to recognize and make use of application specific + * types for creating topics at run time. + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class TypeSupport { + + /** + * The method which tells the system how large the data type is in bytes. + * + * @return The integer count of bytes for the type. + */ + protected abstract int getTypeDataSize(); + + /** + * The method which supplies the <code>Key</code> for distinguishing instances + * of this data type. + * + * @see Key + */ + protected abstract Key getKey(); + + /** + * The method that supplies the class name for the application class that extends + * <code>DataReader</code> for this type. The string returned must be formatted + * such that the <code>ClassLoader</code> designated during registration will be able + * to supply the reader. + * + * @return The class name for the reader of this type. + */ + protected abstract String getReaderName(); + + /** + * The method that supplies the class name for the application class that extends + * <code>DataWriter</code> for this type. The string returned must be formatted + * such that the <code>ClassLoader</code> designated during registration will be able + * to supply the writer. + * + * @return The class name for the writer of this type. + */ + protected abstract String getWriterName(); + + // TUNE should/could this method be made static ? + /** + * The method used to register this type. This method allows a the application to supply any + * <code>ClassLoader</code> for the system to use to load the application specific data + * readers and writers. + * + * @param participant - The <code>DomainParticipant</code> to register the type with. + * @param typeName - The typeName to register this type as. + * @param classLoader - The <code>ClassLoader</code> to register for this type. + */ + public ReturnCode registerType(DomainParticipant participant, String typeName, ClassLoader classLoader) { + return participant.getTypeRegistry().register( + new TypeSignature(typeName, getTypeDataSize(), getKey(), getReaderName(), getWriterName(), classLoader)); + } + + /** + * The method used to register this type. This method registers the type with the system + * <code>ClassLoader</code> as the loader for the reader and writer. + * + * @param participant - The <code>DomainParticipant</code> to register the type with. + * @param typeName - The typeName to register this type as. + */ + public ReturnCode registerType(DomainParticipant participant, String typeName) { + ClassLoader defaultClassLoader = ClassLoader.getSystemClassLoader(); + + return registerType(participant, typeName, defaultClassLoader); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/package.html index 0357634f5c9..2818d5897d8 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/service/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides service level support classes.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides service level support classes. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/CountedStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/CountedStatus.java index 68755fb64a2..4d7a35a96c4 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/CountedStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/CountedStatus.java @@ -8,44 +8,44 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-/**
- * A <code>Status</code> that also maintains a counts for the total and incremental number of samples associated with the status.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class CountedStatus extends Status {
- private long totalCount;
- private long totalCountChange;
-
- /**
- * @param totalCount The cumulative count of samples or topics associated with this status.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- */
- public CountedStatus(long totalCount, long totalCountChange) {
- super();
- this.totalCount = totalCount;
- this.totalCountChange = totalCountChange;
- }
-
- /**
- * Gets the Total Count of all samples or topics associated with this status.
- *
- * @return Returns the totalCount.
- */
- public long getTotalCount() {
- return totalCount;
- }
-
- /**
- * Gets the number of samples or topics associated with this status since the last time the listener was called or the status was read.
- *
- * @return Returns the totalCountChange.
- */
- public long getTotalCountChange() {
- return totalCountChange;
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +/** + * A <code>Status</code> that also maintains a counts for the total and incremental number of samples associated with the status. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class CountedStatus extends Status { + private long totalCount; + private long totalCountChange; + + /** + * @param totalCount The cumulative count of samples or topics associated with this status. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + */ + public CountedStatus(long totalCount, long totalCountChange) { + super(); + this.totalCount = totalCount; + this.totalCountChange = totalCountChange; + } + + /** + * Gets the Total Count of all samples or topics associated with this status. + * + * @return Returns the totalCount. + */ + public long getTotalCount() { + return totalCount; + } + + /** + * Gets the number of samples or topics associated with this status since the last time the listener was called or the status was read. + * + * @return Returns the totalCountChange. + */ + public long getTotalCountChange() { + return totalCountChange; + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/InconsistentTopicStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/InconsistentTopicStatus.java index a6585965579..ae26bafc79d 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/InconsistentTopicStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/InconsistentTopicStatus.java @@ -8,23 +8,23 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-
-/**
- * Maintains counts of Topics whose name match the topic this <code>Status</code> is attached to, but type differs.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class InconsistentTopicStatus extends CountedStatus {
-
- /**
- * @param totalCount The cumulative countt of inconsistent statuses.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- */
- public InconsistentTopicStatus(long totalCount, long totalCountChange) {
- super(totalCount, totalCountChange);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds.status; + + +/** + * Maintains counts of Topics whose name match the topic this <code>Status</code> is attached to, but type differs. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class InconsistentTopicStatus extends CountedStatus { + + /** + * @param totalCount The cumulative countt of inconsistent statuses. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + */ + public InconsistentTopicStatus(long totalCount, long totalCountChange) { + super(totalCount, totalCountChange); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessChangedStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessChangedStatus.java index e4243f6b29b..c2b2ce0b494 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessChangedStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessChangedStatus.java @@ -8,67 +8,67 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-/**
- * Maintains counts of {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter}'s actively or inactively write the same Topic as the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}this is attached to.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class LivelinessChangedStatus extends Status {
- private long activeCount;
- private long activeCountChange;
- private long inactiveCount;
- private long inactiveCountChange;
-
- /**
- * @param activeCount The current number of active <code>DataWriter</code>'s with the same Topic.
- * @param inactiveCount The current number of inactive <code>DataWriter</code>'s with the same Topic.
- * @param activeCountChange The change in activeCount since the last time the listener was called or the status was read.
- * @param inactiveCountChange The change in inactiveCount since the last time the listener was called or the status was read.
- */
- public LivelinessChangedStatus(long activeCount, long inactiveCount, long activeCountChange, long inactiveCountChange) {
- super();
- this.activeCount = activeCount;
- this.inactiveCount = inactiveCount;
- this.activeCountChange = activeCountChange;
- this.inactiveCountChange = inactiveCountChange;
- }
-
- /**
- * Gets the current number of active <code>DataWriter</code>'s with the same Topic.
- *
- * @return Returns the activeCount.
- */
- public long getActiveCount() {
- return activeCount;
- }
-
- /**
- * Gets the change in activeCount since the last time the listener was called or the status was read.
- *
- * @return Returns the activeCountChange.
- */
- public long getActiveCountChange() {
- return activeCountChange;
- }
-
- /**
- * Gets the current number of inactive <code>DataWriter</code>'s with the same Topic.
- *
- * @return Returns the inactiveCount.
- */
- public long getInactiveCount() {
- return inactiveCount;
- }
-
- /**
- * Gets the change in inactiveCount since the last time the listener was called or the status was read.
- *
- * @return Returns the inactiveCountChange.
- */
- public long getInactiveCountChange() {
- return inactiveCountChange;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +/** + * Maintains counts of {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter}'s actively or inactively write the same Topic as the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}this is attached to. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class LivelinessChangedStatus extends Status { + private long activeCount; + private long activeCountChange; + private long inactiveCount; + private long inactiveCountChange; + + /** + * @param activeCount The current number of active <code>DataWriter</code>'s with the same Topic. + * @param inactiveCount The current number of inactive <code>DataWriter</code>'s with the same Topic. + * @param activeCountChange The change in activeCount since the last time the listener was called or the status was read. + * @param inactiveCountChange The change in inactiveCount since the last time the listener was called or the status was read. + */ + public LivelinessChangedStatus(long activeCount, long inactiveCount, long activeCountChange, long inactiveCountChange) { + super(); + this.activeCount = activeCount; + this.inactiveCount = inactiveCount; + this.activeCountChange = activeCountChange; + this.inactiveCountChange = inactiveCountChange; + } + + /** + * Gets the current number of active <code>DataWriter</code>'s with the same Topic. + * + * @return Returns the activeCount. + */ + public long getActiveCount() { + return activeCount; + } + + /** + * Gets the change in activeCount since the last time the listener was called or the status was read. + * + * @return Returns the activeCountChange. + */ + public long getActiveCountChange() { + return activeCountChange; + } + + /** + * Gets the current number of inactive <code>DataWriter</code>'s with the same Topic. + * + * @return Returns the inactiveCount. + */ + public long getInactiveCount() { + return inactiveCount; + } + + /** + * Gets the change in inactiveCount since the last time the listener was called or the status was read. + * + * @return Returns the inactiveCountChange. + */ + public long getInactiveCountChange() { + return inactiveCountChange; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessLostStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessLostStatus.java index 31a649b3c25..b6cdd6bda09 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessLostStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/LivelinessLostStatus.java @@ -8,22 +8,22 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-/**
- * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} failed to signal its liveliness within the liveliness period.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class LivelinessLostStatus extends CountedStatus {
-
- /**
- * @param totalCount The cumulative count of liveliness lost.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- */
- public LivelinessLostStatus(long totalCount, long totalCountChange) {
- super(totalCount, totalCountChange);
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +/** + * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} failed to signal its liveliness within the liveliness period. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class LivelinessLostStatus extends CountedStatus { + + /** + * @param totalCount The cumulative count of liveliness lost. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + */ + public LivelinessLostStatus(long totalCount, long totalCountChange) { + super(totalCount, totalCountChange); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedDeadlineMissedStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedDeadlineMissedStatus.java index ad4ffc9d8f2..3c92ff1d290 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedDeadlineMissedStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedDeadlineMissedStatus.java @@ -8,35 +8,35 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-
-/**
- * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} failed to write within the offered deadline.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class OfferedDeadlineMissedStatus extends CountedStatus {
- private InstanceHandle lastInstanceHandle;
-
- /**
- * @param totalCount The cumulative count of offered deadlines missed.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastInstanceHandle The last instance in the <code>DataWriter</code> for which the deadline was missed.
- */
- public OfferedDeadlineMissedStatus(long totalCount, long totalCountChange, InstanceHandle lastInstanceHandle) {
- super(totalCount, totalCountChange);
- this.lastInstanceHandle = lastInstanceHandle;
- }
-
- /**
- * Gets a handle to the instance in the <code>DataWriter</code> for which the last offered deadline that was missed.
- *
- * @return Returns the lastInstanceHandle.
- */
- public InstanceHandle getLastInstanceHandle() {
- return lastInstanceHandle;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; + +/** + * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} failed to write within the offered deadline. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class OfferedDeadlineMissedStatus extends CountedStatus { + private InstanceHandle lastInstanceHandle; + + /** + * @param totalCount The cumulative count of offered deadlines missed. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastInstanceHandle The last instance in the <code>DataWriter</code> for which the deadline was missed. + */ + public OfferedDeadlineMissedStatus(long totalCount, long totalCountChange, InstanceHandle lastInstanceHandle) { + super(totalCount, totalCountChange); + this.lastInstanceHandle = lastInstanceHandle; + } + + /** + * Gets a handle to the instance in the <code>DataWriter</code> for which the last offered deadline that was missed. + * + * @return Returns the lastInstanceHandle. + */ + public InstanceHandle getLastInstanceHandle() { + return lastInstanceHandle; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedIncompatibleQosStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedIncompatibleQosStatus.java index 3a1cd1e9e4f..49689440f1b 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedIncompatibleQosStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/OfferedIncompatibleQosStatus.java @@ -8,53 +8,53 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.qos.QosPolicy;
-
-
-/**
- * Maintains counts of the number of {@link DataReader}'s that the {@link DataWriter} <code>Topic</code> matched but has an incompatible Qos Policy.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class OfferedIncompatibleQosStatus extends CountedStatus {
-
- private long lastPolicyId;
- private Collection<QosPolicy> policies;
-
- /**
- * @param totalCount The cumulative count of <code>DataReader</code>'s whose <code>Topic</code>'s match but have an incompatible Qos Policy.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastPolicyId The ID of one of the incompatible policies found from the last detected incompatibility.
- * @param policies The total counts of incompatibilities for each policy which has been found to be incompatible at some point.
- */
- public OfferedIncompatibleQosStatus(long totalCount, long totalCountChange, long lastPolicyId, Collection<QosPolicy> policies) {
- super(totalCount, totalCountChange);
- this.lastPolicyId = lastPolicyId;
- this.policies = new ArrayList<QosPolicy>(policies);
- }
-
- /**
- * Gets the ID of one of the incompatible policies found from the last detected incompatibility.
- * @return Returns the lastPolicyId.
- */
- public long getLastPolicyId() {
- return lastPolicyId;
- }
-
- /**
- * Gets the total counts of incompatibilities for each policy which has been found to be incompatible at some point.
- *
- * @return Returns the counts by individual policy.
- */
- public Collection<QosPolicy> getPolicies() {
- return policies;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.qos.QosPolicy; + + +/** + * Maintains counts of the number of {@link DataReader}'s that the {@link DataWriter} <code>Topic</code> matched but has an incompatible Qos Policy. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class OfferedIncompatibleQosStatus extends CountedStatus { + + private long lastPolicyId; + private Collection<QosPolicy> policies; + + /** + * @param totalCount The cumulative count of <code>DataReader</code>'s whose <code>Topic</code>'s match but have an incompatible Qos Policy. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastPolicyId The ID of one of the incompatible policies found from the last detected incompatibility. + * @param policies The total counts of incompatibilities for each policy which has been found to be incompatible at some point. + */ + public OfferedIncompatibleQosStatus(long totalCount, long totalCountChange, long lastPolicyId, Collection<QosPolicy> policies) { + super(totalCount, totalCountChange); + this.lastPolicyId = lastPolicyId; + this.policies = new ArrayList<QosPolicy>(policies); + } + + /** + * Gets the ID of one of the incompatible policies found from the last detected incompatibility. + * @return Returns the lastPolicyId. + */ + public long getLastPolicyId() { + return lastPolicyId; + } + + /** + * Gets the total counts of incompatibilities for each policy which has been found to be incompatible at some point. + * + * @return Returns the counts by individual policy. + */ + public Collection<QosPolicy> getPolicies() { + return policies; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/PublicationMatchStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/PublicationMatchStatus.java index e2ff0e7f4e8..83dbf0fcdac 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/PublicationMatchStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/PublicationMatchStatus.java @@ -8,35 +8,35 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-
-/**
- * Maintains counts of the number of {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}'s that the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} matched based upon <code>Topic</code> & Qos Policies.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class PublicationMatchStatus extends CountedStatus {
- private InstanceHandle lastSubscriptionHandle;
-
- /**
- * @param totalCount The cumulative count of <code>DataReader</code>'s whose Qos Policies match.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastSubscriptionHandle The last <code>DataReader</code> matching the <code>DataWriter</code> causing the status to change.
- */
- public PublicationMatchStatus(long totalCount, long totalCountChange, InstanceHandle lastSubscriptionHandle) {
- super(totalCount, totalCountChange);
- this.lastSubscriptionHandle = lastSubscriptionHandle;
- }
-
- /**
- * Gets a handle to the last <code>DataReader</code> matching the DataWriter causing the status to change.
- *
- * @return Returns the lastInstanceHandle.
- */
- public InstanceHandle getLastSubscriptionHandle() {
- return lastSubscriptionHandle;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; + +/** + * Maintains counts of the number of {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}'s that the {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter} matched based upon <code>Topic</code> & Qos Policies. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class PublicationMatchStatus extends CountedStatus { + private InstanceHandle lastSubscriptionHandle; + + /** + * @param totalCount The cumulative count of <code>DataReader</code>'s whose Qos Policies match. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastSubscriptionHandle The last <code>DataReader</code> matching the <code>DataWriter</code> causing the status to change. + */ + public PublicationMatchStatus(long totalCount, long totalCountChange, InstanceHandle lastSubscriptionHandle) { + super(totalCount, totalCountChange); + this.lastSubscriptionHandle = lastSubscriptionHandle; + } + + /** + * Gets a handle to the last <code>DataReader</code> matching the DataWriter causing the status to change. + * + * @return Returns the lastInstanceHandle. + */ + public InstanceHandle getLastSubscriptionHandle() { + return lastSubscriptionHandle; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedDeadlineMissedStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedDeadlineMissedStatus.java index ada4b9649eb..dbd0ff6f4e2 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedDeadlineMissedStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedDeadlineMissedStatus.java @@ -8,35 +8,35 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-
-/**
- * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader} detected a missed deadline.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class RequestedDeadlineMissedStatus extends CountedStatus {
- private InstanceHandle lastInstanceHandle;
-
- /**
- * @param totalCount The cumulative count of deadlines missed.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastInstanceHandle The last instance in the <code>DataReader</code> for which the deadline was missed.
- */
- public RequestedDeadlineMissedStatus(long totalCount, long totalCountChange, InstanceHandle lastInstanceHandle) {
- super(totalCount, totalCountChange);
- this.lastInstanceHandle = lastInstanceHandle;
- }
-
- /**
- * Gets a handle to the instance in the <code>DataReader</code> for which the last deadline that was missed.
- *
- * @return Returns the lastInstanceHandle.
- */
- public InstanceHandle getLastInstanceHandle() {
- return lastInstanceHandle;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; + +/** + * Maintains counts of the number of times the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader} detected a missed deadline. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class RequestedDeadlineMissedStatus extends CountedStatus { + private InstanceHandle lastInstanceHandle; + + /** + * @param totalCount The cumulative count of deadlines missed. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastInstanceHandle The last instance in the <code>DataReader</code> for which the deadline was missed. + */ + public RequestedDeadlineMissedStatus(long totalCount, long totalCountChange, InstanceHandle lastInstanceHandle) { + super(totalCount, totalCountChange); + this.lastInstanceHandle = lastInstanceHandle; + } + + /** + * Gets a handle to the instance in the <code>DataReader</code> for which the last deadline that was missed. + * + * @return Returns the lastInstanceHandle. + */ + public InstanceHandle getLastInstanceHandle() { + return lastInstanceHandle; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedIncompatibleQosStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedIncompatibleQosStatus.java index 3c5abab6b5b..0c68bd0edd0 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedIncompatibleQosStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/RequestedIncompatibleQosStatus.java @@ -8,53 +8,53 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.qos.QosPolicy;
-
-
-/**
- * Maintains counts of the number of {@link DataWriter}'s that the {@link DataReader} <code>Topic</code> matched but has an incompatible Qos Policy.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class RequestedIncompatibleQosStatus extends CountedStatus {
- private long lastPolicyId;
- private Collection<QosPolicy> policies;
-
- /**
- * @param totalCount The cumulative count of <code>DataWriter</code>'s whose <code>Topic</code>'s match but have an incompatible Qos Policy.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastPolicyId The ID of one of the incompatible policies found from the last detected incompatibility.
- * @param policies The total counts of incompatibilities for each policy which has been found to be incompatible at some point.
- */
- public RequestedIncompatibleQosStatus(long totalCount, long totalCountChange, long lastPolicyId, Collection<QosPolicy> policies) {
- super(totalCount, totalCountChange);
- this.lastPolicyId = lastPolicyId;
- this.policies = new ArrayList<QosPolicy>(policies);
- }
-
- /**
- * Gets the ID of one of the incompatible policies found from the last detected incompatibility.
- *
- * @return Returns the lastPolicyId.
- */
- public long getLastPolicyId() {
- return lastPolicyId;
- }
-
- /**
- * Gets the total counts of incompatibilities for each policy which has been found to be incompatible at some point.
- *
- * @return Returns the counts by individual policy.
- */
- public Collection<QosPolicy> getPolicies() {
- return policies;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.qos.QosPolicy; + + +/** + * Maintains counts of the number of {@link DataWriter}'s that the {@link DataReader} <code>Topic</code> matched but has an incompatible Qos Policy. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class RequestedIncompatibleQosStatus extends CountedStatus { + private long lastPolicyId; + private Collection<QosPolicy> policies; + + /** + * @param totalCount The cumulative count of <code>DataWriter</code>'s whose <code>Topic</code>'s match but have an incompatible Qos Policy. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastPolicyId The ID of one of the incompatible policies found from the last detected incompatibility. + * @param policies The total counts of incompatibilities for each policy which has been found to be incompatible at some point. + */ + public RequestedIncompatibleQosStatus(long totalCount, long totalCountChange, long lastPolicyId, Collection<QosPolicy> policies) { + super(totalCount, totalCountChange); + this.lastPolicyId = lastPolicyId; + this.policies = new ArrayList<QosPolicy>(policies); + } + + /** + * Gets the ID of one of the incompatible policies found from the last detected incompatibility. + * + * @return Returns the lastPolicyId. + */ + public long getLastPolicyId() { + return lastPolicyId; + } + + /** + * Gets the total counts of incompatibilities for each policy which has been found to be incompatible at some point. + * + * @return Returns the counts by individual policy. + */ + public Collection<QosPolicy> getPolicies() { + return policies; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleLostStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleLostStatus.java index df6c26f3516..168e39fce01 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleLostStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleLostStatus.java @@ -8,22 +8,22 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-
-/**
- * Maintains counts of the samples lost across all instances of data published for the {@link org.eclipse.osee.ote.messaging.dds.entity.Topic}.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SampleLostStatus extends CountedStatus {
-
- /**
- * @param totalCount The cumulative count of all samples lost for the <code>Topic</code>.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- */
- public SampleLostStatus(long totalCount, long totalCountChange) {
- super(totalCount, totalCountChange);
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + + +/** + * Maintains counts of the samples lost across all instances of data published for the {@link org.eclipse.osee.ote.messaging.dds.entity.Topic}. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SampleLostStatus extends CountedStatus { + + /** + * @param totalCount The cumulative count of all samples lost for the <code>Topic</code>. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + */ + public SampleLostStatus(long totalCount, long totalCountChange) { + super(totalCount, totalCountChange); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatus.java index ff73a85e0e6..c2c695c5d02 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatus.java @@ -8,47 +8,47 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-
-/**
- * Maintains counts of the number of samples rejected by a {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SampleRejectedStatus extends CountedStatus {
- private SampleRejectedStatusKind lastReason;
- private InstanceHandle lastInstanceHandle;
-
- /**
- * @param totalCount The cumulative count of all samples rejected by the <code>DataReader</code>.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastReason The reason the last sample was rejected.
- * @param lastInstanceHandle The instance of the last rejected sample.
- */
- public SampleRejectedStatus(long totalCount, long totalCountChange, SampleRejectedStatusKind lastReason, InstanceHandle lastInstanceHandle) {
- super(totalCount, totalCountChange);
- this.lastReason = lastReason;
- this.lastInstanceHandle = lastInstanceHandle;
- }
-
- /**
- * Gets the instance of the last sample that was rejected.
- *
- * @return Returns the lastInstanceHandle.
- */
- public InstanceHandle getLastInstanceHandle() {
- return lastInstanceHandle;
- }
-
- /**
- * Gets the reason the last sample was rejected.
- *
- * @return Returns the lastReason.
- */
- public SampleRejectedStatusKind getLastReason() {
- return lastReason;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; + +/** + * Maintains counts of the number of samples rejected by a {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SampleRejectedStatus extends CountedStatus { + private SampleRejectedStatusKind lastReason; + private InstanceHandle lastInstanceHandle; + + /** + * @param totalCount The cumulative count of all samples rejected by the <code>DataReader</code>. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastReason The reason the last sample was rejected. + * @param lastInstanceHandle The instance of the last rejected sample. + */ + public SampleRejectedStatus(long totalCount, long totalCountChange, SampleRejectedStatusKind lastReason, InstanceHandle lastInstanceHandle) { + super(totalCount, totalCountChange); + this.lastReason = lastReason; + this.lastInstanceHandle = lastInstanceHandle; + } + + /** + * Gets the instance of the last sample that was rejected. + * + * @return Returns the lastInstanceHandle. + */ + public InstanceHandle getLastInstanceHandle() { + return lastInstanceHandle; + } + + /** + * Gets the reason the last sample was rejected. + * + * @return Returns the lastReason. + */ + public SampleRejectedStatusKind getLastReason() { + return lastReason; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatusKind.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatusKind.java index 4a6b295d002..c8ec27c4b78 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatusKind.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SampleRejectedStatusKind.java @@ -8,42 +8,42 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-/**
- * Enumeration class for the reasons a sample was rejected by a {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SampleRejectedStatusKind {
- public static final SampleRejectedStatusKind REJECTED_BY_INSTANCE_LIMIT = new SampleRejectedStatusKind(1, "Rejected by instance limit");
- public static final SampleRejectedStatusKind REJECTED_BY_TOPIC_LIMIT = new SampleRejectedStatusKind(2, "Rejected by topic limit");
-
- private int value;
- private String description;
-
- private SampleRejectedStatusKind(int value, String description) {
- super();
- this.value = value;
- this.description = description;
- }
-
- /**
- * Gets the description of the rejected status.
- *
- * @return Returns the description.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the value used to identify the rejected status.
- *
- * @return Returns the value.
- */
- public int getValue() {
- return value;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +/** + * Enumeration class for the reasons a sample was rejected by a {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader}. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SampleRejectedStatusKind { + public static final SampleRejectedStatusKind REJECTED_BY_INSTANCE_LIMIT = new SampleRejectedStatusKind(1, "Rejected by instance limit"); + public static final SampleRejectedStatusKind REJECTED_BY_TOPIC_LIMIT = new SampleRejectedStatusKind(2, "Rejected by topic limit"); + + private int value; + private String description; + + private SampleRejectedStatusKind(int value, String description) { + super(); + this.value = value; + this.description = description; + } + + /** + * Gets the description of the rejected status. + * + * @return Returns the description. + */ + public String getDescription() { + return description; + } + + /** + * Gets the value used to identify the rejected status. + * + * @return Returns the value. + */ + public int getValue() { + return value; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/Status.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/Status.java index e2140434d17..5dc3d7359f4 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/Status.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/Status.java @@ -8,14 +8,14 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-/**
- * Base class for the various *Status classes specified in the DDS specification.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public abstract class Status {
-
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +/** + * Base class for the various *Status classes specified in the DDS specification. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public abstract class Status { + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SubscriptionMatchStatus.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SubscriptionMatchStatus.java index ea9e731bb7d..3a06d3441b8 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SubscriptionMatchStatus.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/SubscriptionMatchStatus.java @@ -8,35 +8,35 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.status;
-
-import org.eclipse.osee.ote.messaging.dds.InstanceHandle;
-
-/**
- * Maintains counts of the number of {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter}'s that the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader} matched based upon <code>Topic</code> & Qos Policies.
- *
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class SubscriptionMatchStatus extends CountedStatus {
- private InstanceHandle lastPublicationHandle;
-
- /**
- * @param totalCount The cumulative count of <code>DataWriter</code>'s whose Qos Policies match.
- * @param totalCountChange The change in count since the last time the listener was called or the status was read.
- * @param lastPublicationHandle The last <code>DataWriter</code> matching the <code>DataReader</code> causing the status to change.
- */
- public SubscriptionMatchStatus(long totalCount, long totalCountChange, InstanceHandle lastPublicationHandle) {
- super(totalCount, totalCountChange);
- this.lastPublicationHandle = lastPublicationHandle;
- }
-
- /**
- * Gets a handle to the last <code>DataWriter</code> matching the DataWriter causing the status to change.
- *
- * @return Returns the lastInstanceHandle.
- */
- public InstanceHandle getLastPublicationHandle() {
- return lastPublicationHandle;
- }
-}
+package org.eclipse.osee.ote.messaging.dds.status; + +import org.eclipse.osee.ote.messaging.dds.InstanceHandle; + +/** + * Maintains counts of the number of {@link org.eclipse.osee.ote.messaging.dds.entity.DataWriter}'s that the {@link org.eclipse.osee.ote.messaging.dds.entity.DataReader} matched based upon <code>Topic</code> & Qos Policies. + * + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class SubscriptionMatchStatus extends CountedStatus { + private InstanceHandle lastPublicationHandle; + + /** + * @param totalCount The cumulative count of <code>DataWriter</code>'s whose Qos Policies match. + * @param totalCountChange The change in count since the last time the listener was called or the status was read. + * @param lastPublicationHandle The last <code>DataWriter</code> matching the <code>DataReader</code> causing the status to change. + */ + public SubscriptionMatchStatus(long totalCount, long totalCountChange, InstanceHandle lastPublicationHandle) { + super(totalCount, totalCountChange); + this.lastPublicationHandle = lastPublicationHandle; + } + + /** + * Gets a handle to the last <code>DataWriter</code> matching the DataWriter causing the status to change. + * + * @return Returns the lastInstanceHandle. + */ + public InstanceHandle getLastPublicationHandle() { + return lastPublicationHandle; + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/package.html index 5ddecf71453..b4590a3dfe7 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/status/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides classes necessary for tracking and reporting status.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides classes necessary for tracking and reporting status. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/Driver.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/Driver.java index 53a802e6fa5..a1e3fc469f6 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/Driver.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/Driver.java @@ -8,158 +8,158 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.test;
-import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
-import org.eclipse.osee.ote.messaging.dds.IDestination;
-import org.eclipse.osee.ote.messaging.dds.ISource;
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant;
-import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipantFactory;
-import org.eclipse.osee.ote.messaging.dds.entity.Publisher;
-import org.eclipse.osee.ote.messaging.dds.entity.Subscriber;
-import org.eclipse.osee.ote.messaging.dds.entity.Topic;
-import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener;
-import org.eclipse.osee.ote.messaging.dds.service.DomainId;
-import org.eclipse.osee.ote.messaging.dds.status.InconsistentTopicStatus;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessLostStatus;
-import org.eclipse.osee.ote.messaging.dds.status.OfferedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.OfferedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.PublicationMatchStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus;
-import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageReader;
-import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageTypeSupport;
-import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageWriter;
-import org.eclipse.osee.ote.messaging.dds.test.data.IntegerData;
-
-
-/**
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class Driver implements DomainParticipantListener{
- private DomainParticipant domainParticipant;
- private Publisher publisher;
- private Subscriber subscriber;
- private Publisher myMiddlewarePublisher;
-
- public Driver() {
- // Get a domain participant so that we can participate in DDS
- DomainParticipantFactory domainParticipantFactory = DomainParticipantFactory.getInstance();
- domainParticipant = domainParticipantFactory.createParticipant(new DomainId(12), this, false);
-
- // Get some publishers and subscribers
- subscriber = domainParticipant.createSubscriber(null);
- publisher = domainParticipant.createPublisher(this);
- myMiddlewarePublisher = domainParticipant.getMiddlewarePublisherInstance(this);
-
- // Register a type, and get some topics built from that type
- new IntMessageTypeSupport().registerType(domainParticipant, "IntMessage");
- Topic anIntTopic = domainParticipant.createTopic("Daves topic", "default", "IntMessage", this);
- Topic anotherIntTopic = domainParticipant.createTopic("Robs topic", "default", "IntMessage", this);
-
-
- // Get some readers and writers for communication via the generated topics
- IntMessageWriter davesWriter = (IntMessageWriter)publisher.createDataWriter(anIntTopic, this);
- IntMessageReader davesReader = (IntMessageReader)subscriber.createDataReader(anIntTopic, this);
- IntMessageWriter robsWriter = (IntMessageWriter)publisher.createDataWriter(anotherIntTopic, this);
- IntMessageReader robsReader = (IntMessageReader)subscriber.createDataReader(anotherIntTopic, this);
-
- // A reference for read data
- IntegerData readData;
-
- System.out.println("Write 8 to daves message from middleware");
- myMiddlewarePublisher.publishData(new IntegerData(8), anIntTopic.getName(), anIntTopic.getNamespace());
- readData = davesReader.takeNextSample();
- System.out.println("Daves reader sees: " + readData.getTheInt());
- System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt());
-
- System.out.println("\n");
- System.out.println("Write 54875 to daves message");
- davesWriter.write(5);
- readData = davesReader.takeNextSample();
- System.out.println("Daves reader sees: " + readData.getTheInt());
- System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt());
- System.out.println("Write 10 to daves message, but check the previous data is still 5");
- davesWriter.write(10);
- System.out.println("Daves previous data is: " + readData.getTheInt());
-
- System.out.println("\n");
- System.out.println("Write 12 to robs message");
- robsWriter.write(12);
- System.out.println("Daves reader sees: " + davesReader.takeNextSample().getTheInt());
- System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt());
-
- System.out.println("\n");
- System.out.println("Write 15 to robs message");
- robsWriter.write(15);
- System.out.println("Daves reader sees: " + davesReader.takeNextSample().getTheInt());
- System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt());
- }
-
- public static void main(String[] args) {
- System.out.println("Starting the driver ...");
- System.out.println("---------------------------------------------------");
- new Driver();
- System.out.println("---------------------------------------------------");
- System.out.println("Driver finished");
- }
-
- public void onInconsistentTopic(Topic theTopic, InconsistentTopicStatus status) {
- }
-
- public void onDataOnReaders(Subscriber theSubscriber) {
- System.out.println ("++onDataOnReaders was called");
- //theSubscriber.getDataReaders();
- }
-
- public void onDataAvailable(DataReader theReader) {
- System.out.println("**Data available from system: " + theReader.getTopicDescription().getName());
-
- }
-
- public void onSampleRejected(DataReader theReader, SampleRejectedStatus status) {
- }
-
- public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status) {
- }
-
- public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status) {
- }
-
- public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status) {
- }
-
- public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status) {
- }
-
- public void onSampleLost(DataReader theReader, SampleLostStatus status) {
- }
-
- public void onLivelinessLost(DataWriter theWriter, LivelinessLostStatus status) {
- }
-
- public void onOfferedDeadlineMissed(DataWriter theWriter, OfferedDeadlineMissedStatus status) {
- }
-
- public void onOfferedIncompatibleQos(DataWriter theWriter, OfferedIncompatibleQosStatus status) {
- }
-
- public void onPublicationMatch(DataWriter theWriter, PublicationMatchStatus status) {
- }
-
- public void onDataSentToMiddleware(DataWriter theWriter) {
- System.out.println("@@onDataTaken called");
-
- }
-
- public void onPublishNotifyMiddleware(IDestination destination, ISource source, DataStoreItem dataStoreItem) {
- System.out.println("--Middleware notified on publish of: " + dataStoreItem.getTheTopicDescription().getName() + "-" + dataStoreItem.getTheTopicDescription().getTypeName());
-
- }
-}
+package org.eclipse.osee.ote.messaging.dds.test; +import org.eclipse.osee.ote.messaging.dds.DataStoreItem; +import org.eclipse.osee.ote.messaging.dds.IDestination; +import org.eclipse.osee.ote.messaging.dds.ISource; +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipant; +import org.eclipse.osee.ote.messaging.dds.entity.DomainParticipantFactory; +import org.eclipse.osee.ote.messaging.dds.entity.Publisher; +import org.eclipse.osee.ote.messaging.dds.entity.Subscriber; +import org.eclipse.osee.ote.messaging.dds.entity.Topic; +import org.eclipse.osee.ote.messaging.dds.listener.DomainParticipantListener; +import org.eclipse.osee.ote.messaging.dds.service.DomainId; +import org.eclipse.osee.ote.messaging.dds.status.InconsistentTopicStatus; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessLostStatus; +import org.eclipse.osee.ote.messaging.dds.status.OfferedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.OfferedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.PublicationMatchStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus; +import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus; +import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageReader; +import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageTypeSupport; +import org.eclipse.osee.ote.messaging.dds.test.data.IntMessageWriter; +import org.eclipse.osee.ote.messaging.dds.test.data.IntegerData; + + +/** + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class Driver implements DomainParticipantListener{ + private DomainParticipant domainParticipant; + private Publisher publisher; + private Subscriber subscriber; + private Publisher myMiddlewarePublisher; + + public Driver() { + // Get a domain participant so that we can participate in DDS + DomainParticipantFactory domainParticipantFactory = DomainParticipantFactory.getInstance(); + domainParticipant = domainParticipantFactory.createParticipant(new DomainId(12), this, false); + + // Get some publishers and subscribers + subscriber = domainParticipant.createSubscriber(null); + publisher = domainParticipant.createPublisher(this); + myMiddlewarePublisher = domainParticipant.getMiddlewarePublisherInstance(this); + + // Register a type, and get some topics built from that type + new IntMessageTypeSupport().registerType(domainParticipant, "IntMessage"); + Topic anIntTopic = domainParticipant.createTopic("Daves topic", "default", "IntMessage", this); + Topic anotherIntTopic = domainParticipant.createTopic("Robs topic", "default", "IntMessage", this); + + + // Get some readers and writers for communication via the generated topics + IntMessageWriter davesWriter = (IntMessageWriter)publisher.createDataWriter(anIntTopic, this); + IntMessageReader davesReader = (IntMessageReader)subscriber.createDataReader(anIntTopic, this); + IntMessageWriter robsWriter = (IntMessageWriter)publisher.createDataWriter(anotherIntTopic, this); + IntMessageReader robsReader = (IntMessageReader)subscriber.createDataReader(anotherIntTopic, this); + + // A reference for read data + IntegerData readData; + + System.out.println("Write 8 to daves message from middleware"); + myMiddlewarePublisher.publishData(new IntegerData(8), anIntTopic.getName(), anIntTopic.getNamespace()); + readData = davesReader.takeNextSample(); + System.out.println("Daves reader sees: " + readData.getTheInt()); + System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt()); + + System.out.println("\n"); + System.out.println("Write 54875 to daves message"); + davesWriter.write(5); + readData = davesReader.takeNextSample(); + System.out.println("Daves reader sees: " + readData.getTheInt()); + System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt()); + System.out.println("Write 10 to daves message, but check the previous data is still 5"); + davesWriter.write(10); + System.out.println("Daves previous data is: " + readData.getTheInt()); + + System.out.println("\n"); + System.out.println("Write 12 to robs message"); + robsWriter.write(12); + System.out.println("Daves reader sees: " + davesReader.takeNextSample().getTheInt()); + System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt()); + + System.out.println("\n"); + System.out.println("Write 15 to robs message"); + robsWriter.write(15); + System.out.println("Daves reader sees: " + davesReader.takeNextSample().getTheInt()); + System.out.println("Robs reader sees: " + robsReader.takeNextSample().getTheInt()); + } + + public static void main(String[] args) { + System.out.println("Starting the driver ..."); + System.out.println("---------------------------------------------------"); + new Driver(); + System.out.println("---------------------------------------------------"); + System.out.println("Driver finished"); + } + + public void onInconsistentTopic(Topic theTopic, InconsistentTopicStatus status) { + } + + public void onDataOnReaders(Subscriber theSubscriber) { + System.out.println ("++onDataOnReaders was called"); + //theSubscriber.getDataReaders(); + } + + public void onDataAvailable(DataReader theReader) { + System.out.println("**Data available from system: " + theReader.getTopicDescription().getName()); + + } + + public void onSampleRejected(DataReader theReader, SampleRejectedStatus status) { + } + + public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status) { + } + + public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status) { + } + + public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status) { + } + + public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status) { + } + + public void onSampleLost(DataReader theReader, SampleLostStatus status) { + } + + public void onLivelinessLost(DataWriter theWriter, LivelinessLostStatus status) { + } + + public void onOfferedDeadlineMissed(DataWriter theWriter, OfferedDeadlineMissedStatus status) { + } + + public void onOfferedIncompatibleQos(DataWriter theWriter, OfferedIncompatibleQosStatus status) { + } + + public void onPublicationMatch(DataWriter theWriter, PublicationMatchStatus status) { + } + + public void onDataSentToMiddleware(DataWriter theWriter) { + System.out.println("@@onDataTaken called"); + + } + + public void onPublishNotifyMiddleware(IDestination destination, ISource source, DataStoreItem dataStoreItem) { + System.out.println("--Middleware notified on publish of: " + dataStoreItem.getTheTopicDescription().getName() + "-" + dataStoreItem.getTheTopicDescription().getTypeName()); + + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageReader.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageReader.java index 6602f0c0d31..991eb005078 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageReader.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageReader.java @@ -8,66 +8,66 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.test.data;
-import org.eclipse.osee.ote.messaging.dds.DataSample;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.entity.DataReader;
-import org.eclipse.osee.ote.messaging.dds.entity.EntityFactory;
-import org.eclipse.osee.ote.messaging.dds.entity.Subscriber;
-import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener;
-import org.eclipse.osee.ote.messaging.dds.service.TopicDescription;
-import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus;
-import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus;
-
-/**
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class IntMessageReader extends DataReader {
-
- DataSample dataSample;
- private IntMessage intMessage;
- /**
- * @param topicDescription
- * @param subscriber
- * @param enabled
- * @param listener
- * @param parentFactory
- */
- public IntMessageReader(TopicDescription topicDescription, Subscriber subscriber, Boolean enabled, DataReaderListener listener, EntityFactory parentFactory) {
- super(topicDescription, subscriber, enabled, listener, parentFactory);
-
- intMessage = new IntMessage();
- dataSample = new DataSample(intMessage);
- this.setListener(new IntMessageListener(), null);
- }
-
- public class IntMessageListener implements DataReaderListener {
-
- public synchronized void onDataAvailable(DataReader theReader) {
- System.out.println ("onDataAvailable Called for " + theReader.getTopicDescription().getName());
- }
- public void onSampleRejected(DataReader theReader, SampleRejectedStatus status) { }
- public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status) { }
- public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status) { }
- public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status) { }
- public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status) { }
- public void onSampleLost(DataReader theReader, SampleLostStatus status) { }
- }
-
- public IntegerData takeNextSample() {
- ReturnCode code = super.takeNextSample(dataSample);
-
- System.out.println("Result of take is: " + code.getDescription());
- if (dataSample.getData() != null) {
- IntegerData data = (IntegerData)dataSample.getData();
- return data;
- } else {
- return new IntegerData(-1);
- }
- }
-}
+package org.eclipse.osee.ote.messaging.dds.test.data; +import org.eclipse.osee.ote.messaging.dds.DataSample; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.entity.DataReader; +import org.eclipse.osee.ote.messaging.dds.entity.EntityFactory; +import org.eclipse.osee.ote.messaging.dds.entity.Subscriber; +import org.eclipse.osee.ote.messaging.dds.listener.DataReaderListener; +import org.eclipse.osee.ote.messaging.dds.service.TopicDescription; +import org.eclipse.osee.ote.messaging.dds.status.LivelinessChangedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedDeadlineMissedStatus; +import org.eclipse.osee.ote.messaging.dds.status.RequestedIncompatibleQosStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleLostStatus; +import org.eclipse.osee.ote.messaging.dds.status.SampleRejectedStatus; +import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus; + +/** + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class IntMessageReader extends DataReader { + + DataSample dataSample; + private IntMessage intMessage; + /** + * @param topicDescription + * @param subscriber + * @param enabled + * @param listener + * @param parentFactory + */ + public IntMessageReader(TopicDescription topicDescription, Subscriber subscriber, Boolean enabled, DataReaderListener listener, EntityFactory parentFactory) { + super(topicDescription, subscriber, enabled, listener, parentFactory); + + intMessage = new IntMessage(); + dataSample = new DataSample(intMessage); + this.setListener(new IntMessageListener(), null); + } + + public class IntMessageListener implements DataReaderListener { + + public synchronized void onDataAvailable(DataReader theReader) { + System.out.println ("onDataAvailable Called for " + theReader.getTopicDescription().getName()); + } + public void onSampleRejected(DataReader theReader, SampleRejectedStatus status) { } + public void onLivelinessChanged(DataReader theReader, LivelinessChangedStatus status) { } + public void onRequestedDeadlineMissed(DataReader theReader, RequestedDeadlineMissedStatus status) { } + public void onRequestedIncompatibleQos(DataReader theReader, RequestedIncompatibleQosStatus status) { } + public void onSubscriptionMatch(DataReader theReader, SubscriptionMatchStatus status) { } + public void onSampleLost(DataReader theReader, SampleLostStatus status) { } + } + + public IntegerData takeNextSample() { + ReturnCode code = super.takeNextSample(dataSample); + + System.out.println("Result of take is: " + code.getDescription()); + if (dataSample.getData() != null) { + IntegerData data = (IntegerData)dataSample.getData(); + return data; + } else { + return new IntegerData(-1); + } + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageTypeSupport.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageTypeSupport.java index 9064992b28c..dc786f48595 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageTypeSupport.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageTypeSupport.java @@ -8,30 +8,30 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.test.data;
-import org.eclipse.osee.ote.messaging.dds.service.Key;
-import org.eclipse.osee.ote.messaging.dds.service.TypeSupport;
-
-/**
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class IntMessageTypeSupport extends TypeSupport {
-
- protected int getTypeDataSize() {
- return Integer.SIZE/8;
- }
-
- protected Key getKey() {
- return null;
- }
-
- protected String getReaderName() {
- return IntMessageReader.class.getCanonicalName();
- }
-
- protected String getWriterName() {
- return IntMessageWriter.class.getCanonicalName();
- }
-
-}
+package org.eclipse.osee.ote.messaging.dds.test.data; +import org.eclipse.osee.ote.messaging.dds.service.Key; +import org.eclipse.osee.ote.messaging.dds.service.TypeSupport; + +/** + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class IntMessageTypeSupport extends TypeSupport { + + protected int getTypeDataSize() { + return Integer.SIZE/8; + } + + protected Key getKey() { + return null; + } + + protected String getReaderName() { + return IntMessageReader.class.getCanonicalName(); + } + + protected String getWriterName() { + return IntMessageWriter.class.getCanonicalName(); + } + +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageWriter.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageWriter.java index 563bc825182..2f401248761 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageWriter.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntMessageWriter.java @@ -8,34 +8,34 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.ote.messaging.dds.test.data;
-import org.eclipse.osee.ote.messaging.dds.ReturnCode;
-import org.eclipse.osee.ote.messaging.dds.entity.DataWriter;
-import org.eclipse.osee.ote.messaging.dds.entity.EntityFactory;
-import org.eclipse.osee.ote.messaging.dds.entity.Publisher;
-import org.eclipse.osee.ote.messaging.dds.entity.Topic;
-import org.eclipse.osee.ote.messaging.dds.listener.DataWriterListener;
-
-/**
- * @author Robert A. Fisher
- * @author David Diepenbrock
- */
-public class IntMessageWriter extends DataWriter {
- private IntegerData buffer;
- /**
- * @param topic
- * @param publisher
- * @param enabled
- * @param listener
- * @param parentFactory
- */
- public IntMessageWriter(Topic topic, Publisher publisher, Boolean enabled, DataWriterListener listener, EntityFactory parentFactory) {
- super(topic, publisher, enabled, listener, parentFactory);
- buffer = new IntegerData(0);
- }
-
- public ReturnCode write(int value) {
- buffer.setTheInt(value);
- return super.write(null, null, buffer, null);
- }
-}
+package org.eclipse.osee.ote.messaging.dds.test.data; +import org.eclipse.osee.ote.messaging.dds.ReturnCode; +import org.eclipse.osee.ote.messaging.dds.entity.DataWriter; +import org.eclipse.osee.ote.messaging.dds.entity.EntityFactory; +import org.eclipse.osee.ote.messaging.dds.entity.Publisher; +import org.eclipse.osee.ote.messaging.dds.entity.Topic; +import org.eclipse.osee.ote.messaging.dds.listener.DataWriterListener; + +/** + * @author Robert A. Fisher + * @author David Diepenbrock + */ +public class IntMessageWriter extends DataWriter { + private IntegerData buffer; + /** + * @param topic + * @param publisher + * @param enabled + * @param listener + * @param parentFactory + */ + public IntMessageWriter(Topic topic, Publisher publisher, Boolean enabled, DataWriterListener listener, EntityFactory parentFactory) { + super(topic, publisher, enabled, listener, parentFactory); + buffer = new IntegerData(0); + } + + public ReturnCode write(int value) { + buffer.setTheInt(value); + return super.write(null, null, buffer, null); + } +} diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntegerData.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntegerData.java index b84f7c06bd2..eb50c5e9557 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntegerData.java +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/IntegerData.java @@ -20,7 +20,7 @@ import org.eclipse.osee.ote.messaging.dds.Data; public class IntegerData implements Data { private int theInt; /** - *
+ * */ public IntegerData(int theInt) { super(); diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/package.html index b377ff77953..09212d235f3 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/data/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides the application specific classes necessary for the test driver.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides the application specific classes necessary for the test driver. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/package.html b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/package.html index 0726a37860f..5d7538307cf 100644 --- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/package.html +++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/test/package.html @@ -1,13 +1,13 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-
-Provides a basic test of the DDS System.
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body bgcolor="white"> + + +Provides a basic test of the DDS System. + +<!-- Put @see and @since tags down here. --> + +</body> </html>
\ No newline at end of file |