diff options
author | kaguilar | 2013-12-10 22:25:26 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2013-12-12 20:04:36 +0000 |
commit | 87a523053ccb578d1d9fbfc3d36fa308b2100b47 (patch) | |
tree | 75aa30acca7c9e6e236112fc637715f44fd2c4a5 | |
parent | f1ad4dff2520c690e499e9b26405d5f21d8376ac (diff) | |
download | org.eclipse.osee-87a523053ccb578d1d9fbfc3d36fa308b2100b47.tar.gz org.eclipse.osee-87a523053ccb578d1d9fbfc3d36fa308b2100b47.tar.xz org.eclipse.osee-87a523053ccb578d1d9fbfc3d36fa308b2100b47.zip |
feature: Add support for restoring element values and data type state
Change-Id: If774b4b0eff24621c3773053433b34c69aeca6f7
8 files changed, 262 insertions, 142 deletions
diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/IOteMessageService.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/IOteMessageService.java index 583f34655f4..8ba1114b9fd 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/IOteMessageService.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/IOteMessageService.java @@ -13,9 +13,12 @@ package org.eclipse.osee.ote.client.msg; import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; + import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; import org.eclipse.osee.ote.message.commands.RecordCommand; +import org.eclipse.osee.ote.message.enums.DataType; import org.eclipse.osee.ote.message.tool.IFileTransferHandle; +import org.eclipse.osee.ote.message.tool.MessageMode; /** * @author Ken J. Aguilar @@ -23,6 +26,12 @@ import org.eclipse.osee.ote.message.tool.IFileTransferHandle; public interface IOteMessageService { IMessageSubscription subscribe(String name); + IMessageSubscription subscribe(String name, MessageMode mode); + + IMessageSubscription subscribe(String name, DataType dataType, MessageMode mode); + + IMessageSubscription subscribe(String name, String dataType, MessageMode mode); + IFileTransferHandle startRecording(String fileName, List<RecordCommand.MessageRecordDetails> list) throws FileNotFoundException, IOException; void stopRecording() throws Exception; diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/IMessageSubscription.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/IMessageSubscription.java index 178057df486..cfd34421a8d 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/IMessageSubscription.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/IMessageSubscription.java @@ -12,6 +12,7 @@ package org.eclipse.osee.ote.client.msg.core; import java.util.List; import java.util.Set; + import org.eclipse.osee.ote.message.Message; import org.eclipse.osee.ote.message.enums.DataType; import org.eclipse.osee.ote.message.tool.MessageMode; @@ -45,7 +46,7 @@ public interface IMessageSubscription { void send() throws Exception; void setElementValue(List<Object> path, String value) throws Exception; - + void setElementValueNoSend(List<Object> path, String value) throws Exception; void zeroize(List<Object> path) throws Exception; void changeMessageMode(MessageMode mode); diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/AbstractMessageDataBase.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/AbstractMessageDataBase.java index 35965f75267..0345b45bd05 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/AbstractMessageDataBase.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/AbstractMessageDataBase.java @@ -13,6 +13,7 @@ package org.eclipse.osee.ote.client.msg.core.db; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; @@ -33,130 +34,160 @@ import org.eclipse.osee.ote.messaging.dds.entity.EntityFactory; */ public abstract class AbstractMessageDataBase { - private final HashMap<MessageReference, MessageInstance> referenceToMsgMap = - new HashMap<MessageReference, MessageInstance>(); - private final ConcurrentHashMap<Integer, MessageInstance> idToMsgMap = - new ConcurrentHashMap<Integer, MessageInstance>(); - - private IMsgToolServiceClient client; - private IRemoteMessageService service; - private final DataReader reader = new DataReader(null, null, true, null, new EntityFactory() { - - @Override - public boolean isEnabled() { - return true; - } - - }); - - protected AbstractMessageDataBase() { - - } - - public MessageInstance findInstance(String name, MessageMode mode, DataType type) { - MessageReference reference = new MessageReference(type, mode, name); - return referenceToMsgMap.get(reference); - } - - public MessageInstance acquireInstance(String name) throws Exception { - return acquireInstance(name, MessageMode.READER, null); - } - - public MessageInstance acquireInstance(String name, MessageMode mode, DataType type) throws Exception { - if (type == null) { - Class<? extends Message> msgClass = ExportClassLoader.getInstance().loadClass(name).asSubclass(Message.class); - Message msg = createMessage(msgClass); - for (ArrayList<MessageData> dataList : (Collection<ArrayList<MessageData>>) msg.getAllData()) { - for (MessageData data : dataList) { - data.setReader(reader); - } - } - type = msg.getDefaultMessageData().getType(); - } - MessageReference reference = new MessageReference(type, mode, name); - MessageInstance instance = referenceToMsgMap.get(reference); - if (instance == null) { - Class<? extends Message> msgClass = ExportClassLoader.getInstance().loadClass(name).asSubclass(Message.class); - Message msg = createMessage(msgClass); - for (ArrayList<MessageData> dataList : (Collection<ArrayList<MessageData>>) msg.getAllData()) { - for (MessageData data : dataList) { - data.setReader(reader); - } - } - msg.setMemSource(type); - instance = new MessageInstance(msg, mode, type); - referenceToMsgMap.put(reference, instance); - } - instance.incrementReferenceCount(); - if (service != null && !instance.isAttached()) { - doInstanceAttach(instance, service); - } - return instance; - } - - public void releaseInstance(MessageInstance instance) throws Exception { - instance.decrementReferenceCount(); - if (!instance.hasReferences()) { - if (instance.isAttached()) { - doInstanceDetach(instance, service); - } - MessageReference reference = - new MessageReference(instance.getType(), instance.getMode(), instance.getMessage().getClass().getName()); - referenceToMsgMap.remove(reference); - destroyMessage(instance.getMessage()); - } - - } - - protected abstract Message createMessage(Class<? extends Message> msgClass) throws Exception; - - protected abstract void destroyMessage(Message message) throws Exception; - - public void attachToService(IRemoteMessageService service, IMsgToolServiceClient client) { - this.service = service; - this.client = client; - for (MessageInstance instance : referenceToMsgMap.values()) { - try { - doInstanceAttach(instance, service); - } catch (Exception e) { - OseeLog.log(AbstractMessageDataBase.class, Level.SEVERE, - "could not attach instance for " + instance.toString(), e); - } - } - } - - public void detachService(IRemoteMessageService service) { - for (MessageInstance instance : referenceToMsgMap.values()) { - doInstanceDetach(instance, service); - } - this.service = null; - this.client = null; - } - - public MessageInstance findById(int id) { - return idToMsgMap.get(id); - } - - private boolean doInstanceAttach(MessageInstance instance, IRemoteMessageService service) throws Exception { - Integer id = instance.attachToService(service, client); - if (id == null) { - // can't subscribe because environment does not support this type - return false; - } - idToMsgMap.put(id, instance); - return true; - } - - private void doInstanceDetach(MessageInstance instance, IRemoteMessageService service) { - try { - Integer id = instance.getId(); - if (id != null) { - idToMsgMap.remove(id); - } - instance.detachService(service, client); - } catch (Exception e) { - e.printStackTrace(); - } - } - + private final HashMap<MessageReference, MessageInstance> referenceToMsgMap = + new HashMap<MessageReference, MessageInstance>(); + private final ConcurrentHashMap<Integer, MessageInstance> idToMsgMap = + new ConcurrentHashMap<Integer, MessageInstance>(); + + private IMsgToolServiceClient client; + private IRemoteMessageService service; + private final DataReader reader = new DataReader(null, null, true, null, new EntityFactory() { + + @Override + public boolean isEnabled() { + return true; + } + + }); + + protected AbstractMessageDataBase() { + + } + + public MessageInstance findInstance(String name, MessageMode mode, DataType type) { + MessageReference reference = new MessageReference(type, mode, name); + return referenceToMsgMap.get(reference); + } + + public MessageInstance acquireInstance(String name) throws Exception { + return acquireInstance(name, MessageMode.READER, (DataType) null); + } + + public MessageInstance acquireInstance(String name, MessageMode mode, DataType type) throws Exception { + if (type == null) { + Class<? extends Message> msgClass = ExportClassLoader.getInstance().loadClass(name).asSubclass(Message.class); + + type = msgClass.newInstance().getDefaultMessageData().getType(); + } + MessageReference reference = new MessageReference(type, mode, name); + MessageInstance instance = referenceToMsgMap.get(reference); + if (instance == null) { + Class<? extends Message> msgClass = ExportClassLoader.getInstance().loadClass(name).asSubclass(Message.class); + Message msg = createMessage(msgClass); + for (ArrayList<MessageData> dataList : (Collection<ArrayList<MessageData>>) msg.getAllData()) { + for (MessageData data : dataList) { + data.setReader(reader); + } + } + msg.setMemSource(type); + instance = new MessageInstance(msg, mode, type); + referenceToMsgMap.put(reference, instance); + } + instance.incrementReferenceCount(); + if (service != null && !instance.isAttached()) { + doInstanceAttach(instance, service); + } + return instance; + } + + public MessageInstance acquireInstance(String name, MessageMode mode, String dataType) throws Exception { + Class<? extends Message> msgClass = ExportClassLoader.getInstance().loadClass(name).asSubclass(Message.class); + Message msg = msgClass.newInstance(); + + //Set<DataType> available = msg.getAvailableMemTypes(); + Set<DataType> available = msg.getAssociatedMessages().keySet(); + DataType requestDataType = msg.getDefaultMessageData().getType(); + for (DataType type : available) { + if (type.name().equals(dataType)) { + requestDataType = type; + break; + } + + } + MessageReference reference = new MessageReference(requestDataType, mode, name); + MessageInstance instance = referenceToMsgMap.get(reference); + if (instance == null) { + msg = createMessage(msgClass); + msg.setMemSource(requestDataType); + for (ArrayList<MessageData> dataList : (Collection<ArrayList<MessageData>>) msg.getAllData()) { + for (MessageData data : dataList) { + data.setReader(reader); + } + } + instance = new MessageInstance(msg, mode, requestDataType); + referenceToMsgMap.put(reference, instance); + } + instance.incrementReferenceCount(); + if (service != null && !instance.isAttached()) { + doInstanceAttach(instance, service); + } + return instance; + } + + + public void releaseInstance(MessageInstance instance) throws Exception { + instance.decrementReferenceCount(); + if (!instance.hasReferences()) { + if (instance.isAttached()) { + doInstanceDetach(instance, service); + } + MessageReference reference = + new MessageReference(instance.getType(), instance.getMode(), instance.getMessage().getClass().getName()); + referenceToMsgMap.remove(reference); + destroyMessage(instance.getMessage()); + } + + } + + protected abstract Message createMessage(Class<? extends Message> msgClass) throws Exception; + + protected abstract void destroyMessage(Message message) throws Exception; + + public void attachToService(IRemoteMessageService service, IMsgToolServiceClient client) { + this.service = service; + this.client = client; + for (MessageInstance instance : referenceToMsgMap.values()) { + try { + doInstanceAttach(instance, service); + } catch (Exception e) { + OseeLog.log(AbstractMessageDataBase.class, Level.SEVERE, + "could not attach instance for " + instance.toString(), e); + } + } + } + + public void detachService(IRemoteMessageService service) { + for (MessageInstance instance : referenceToMsgMap.values()) { + doInstanceDetach(instance, service); + } + this.service = null; + this.client = null; + } + + public MessageInstance findById(int id) { + return idToMsgMap.get(id); + } + + private boolean doInstanceAttach(MessageInstance instance, IRemoteMessageService service) throws Exception { + Integer id = instance.attachToService(service, client); + if (id == null) { + // can't subscribe because environment does not support this type + return false; + } + idToMsgMap.put(id, instance); + return true; + } + + private void doInstanceDetach(MessageInstance instance, IRemoteMessageService service) { + try { + Integer id = instance.getId(); + if (id != null) { + idToMsgMap.remove(id); + } + instance.detachService(service, client); + } catch (Exception e) { + e.printStackTrace(); + } + } + } diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/MessageInstance.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/MessageInstance.java index 13c2b60c48f..f71576d9be4 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/MessageInstance.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/db/MessageInstance.java @@ -35,7 +35,7 @@ public class MessageInstance { private SubscriptionKey serverSubscriptionKey = null; private int refcount = 0; private boolean supported = true; - private IRemoteMessageService service; + private volatile IRemoteMessageService service; public MessageInstance(Message msg, MessageMode mode, DataType type) { this.msg = msg; @@ -111,7 +111,7 @@ public class MessageInstance { if(service != null){ try { Set<? extends DataType> envSet = service.getAvailablePhysicalTypes(); - Set<DataType> available = msg.getAvailableMemTypes(); + Set<DataType> available = msg.getAssociatedMessages().keySet(); for(DataType type : available.toArray(new DataType[available.size()])){ if(envSet.contains(type)){ set.add(type); diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java index 22f687e1551..eb51401c93b 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscription.java @@ -10,9 +10,10 @@ *******************************************************************************/ package org.eclipse.osee.ote.client.msg.core.internal; -import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; + import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; import org.eclipse.osee.ote.client.msg.core.ISubscriptionListener; import org.eclipse.osee.ote.client.msg.core.db.AbstractMessageDataBase; @@ -32,8 +33,11 @@ public class MessageSubscription implements IMessageSubscription { private ISubscriptionState currentState = null; private final MessageSubscriptionService msgService; - private final HashSet<ISubscriptionListener> listeners = new HashSet<ISubscriptionListener>(); + private final CopyOnWriteArraySet<ISubscriptionListener> listeners = new CopyOnWriteArraySet<ISubscriptionListener>(); + private String requestedDataType; + + /** * creates a subscription with no reference to a message */ @@ -42,13 +46,18 @@ public class MessageSubscription implements IMessageSubscription { } public synchronized void bind(String name) { - bind(name, null, MessageMode.READER); + bind(name, (DataType)null, MessageMode.READER); } - private void bind(String name, DataType type, MessageMode mode) { + public synchronized void bind(String name, DataType type, MessageMode mode) { currentState = new UnresolvedState(name, this, type, mode); } + public synchronized void bind(String name, String type, MessageMode mode) { + requestedDataType = type; + currentState = new UnresolvedState(name, this, null, mode); + } + @Override public synchronized boolean isActive() { return currentState != null ? currentState.isActive() : false; @@ -156,13 +165,20 @@ public class MessageSubscription implements IMessageSubscription { @Override public void setElementValue(List<Object> path, String value) throws Exception { - final SetElementValue cmd = new SetElementValue(getMessageClassName(), getMemType(), path, value); + final SetElementValue cmd = new SetElementValue(getMessageClassName(), getMemType(), path, value, true); msgService.getService().setElementValue(cmd); } @Override + public void setElementValueNoSend(List<Object> path, String value) + throws Exception { + final SetElementValue cmd = new SetElementValue(getMessageClassName(), getMemType(), path, value, false); + msgService.getService().setElementValue(cmd); + } + + @Override public void send() throws Exception { - final SetElementValue cmd = new SetElementValue(getMessageClassName(), getMemType(), null, null); + final SetElementValue cmd = new SetElementValue(getMessageClassName(), getMemType(), null, null, true); msgService.getService().setElementValue(cmd); } @@ -229,4 +245,14 @@ public class MessageSubscription implements IMessageSubscription { public boolean removeSubscriptionListener(ISubscriptionListener listener) { return listeners.remove(listener); } + + public String getRequestedDataType() { + return requestedDataType; + } + + public void setRequestedDataType(String requestedDataType) { + this.requestedDataType = requestedDataType; + } + + } diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java index 605b8a33707..c440a74074f 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java @@ -42,6 +42,7 @@ import org.eclipse.osee.ote.message.interfaces.IMsgToolServiceClient; import org.eclipse.osee.ote.message.interfaces.IRemoteMessageService; import org.eclipse.osee.ote.message.interfaces.ITestEnvironmentMessageSystem; import org.eclipse.osee.ote.message.tool.IFileTransferHandle; +import org.eclipse.osee.ote.message.tool.MessageMode; import org.eclipse.osee.ote.message.tool.TransferConfig; import org.eclipse.osee.ote.message.tool.UdpFileTransferHandler; import org.eclipse.osee.ote.service.ConnectionEvent; @@ -61,7 +62,7 @@ public class MessageSubscriptionService implements IOteMessageService, ITestConn private final InetAddress localAddress; private final List<MessageSubscription> subscriptions = new CopyOnWriteArrayList<MessageSubscription>(); private IMsgToolServiceClient exportedThis = null; - private AbstractMessageDataBase msgDatabase; + private volatile AbstractMessageDataBase msgDatabase; private UdpFileTransferHandler fileTransferHandler; private final ExecutorService threadPool = Executors.newFixedThreadPool(MAX_CONCURRENT_WORKER_THREADS, @@ -82,9 +83,9 @@ public class MessageSubscriptionService implements IOteMessageService, ITestConn * Monitors a set of channels for message updates and dispatches the updates to worker threads */ private UpdateDispatcher dispatcher = null; - private IRemoteMessageService service; + private volatile IRemoteMessageService service; - private IOteClientService clientService; + private volatile IOteClientService clientService; public void start(){ clientService.addConnectionListener(this); @@ -122,6 +123,41 @@ public class MessageSubscriptionService implements IOteMessageService, ITestConn subscriptions.add(subscription); return subscription; } + + @Override + public IMessageSubscription subscribe(String name, MessageMode mode) { + return subscribe(name, (DataType)null, mode); + } + + @Override + public IMessageSubscription subscribe(String name, DataType dataType, + MessageMode mode) { + MessageSubscription subscription = new MessageSubscription(this); + subscription.bind(name, dataType, mode); + if (msgDatabase != null) { + subscription.attachMessageDb(msgDatabase); + if (service != null) { + subscription.attachService(service); + } + } + subscriptions.add(subscription); + return subscription; + } + + @Override + public IMessageSubscription subscribe(String name, String dataType, + MessageMode mode) { + MessageSubscription subscription = new MessageSubscription(this); + subscription.bind(name, dataType, mode); + if (msgDatabase != null) { + subscription.attachMessageDb(msgDatabase); + if (service != null) { + subscription.attachService(service); + } + } + subscriptions.add(subscription); + return subscription; + } /** * Shuts down the client message service. All worker threads will be terminated and all IO resources will be closed. @@ -345,4 +381,5 @@ public class MessageSubscriptionService implements IOteMessageService, ITestConn public void removeSubscription(MessageSubscription subscription) { subscriptions.remove(subscription); } + } diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/state/UnresolvedState.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/state/UnresolvedState.java index fbd807d6545..dc99a6b3ce2 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/state/UnresolvedState.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/state/UnresolvedState.java @@ -12,7 +12,9 @@ package org.eclipse.osee.ote.client.msg.core.internal.state; import java.util.HashSet; import java.util.Set; +import java.util.logging.Level; +import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.ote.client.msg.core.db.AbstractMessageDataBase; import org.eclipse.osee.ote.client.msg.core.db.MessageInstance; import org.eclipse.osee.ote.client.msg.core.internal.MessageSubscription; @@ -54,12 +56,19 @@ public class UnresolvedState extends AbstractSubscriptionState { @Override public ISubscriptionState onMessageDbFound(AbstractMessageDataBase msgDB) { try { - instance = msgDB.acquireInstance(msgClassName, getMode(), getMemType()); + DataType requestedType = getMemType(); + if (requestedType == null && getSubscription().getRequestedDataType() != null) { + instance = msgDB.acquireInstance(msgClassName, getMode(), getSubscription().getRequestedDataType()); + } else { + instance = msgDB.acquireInstance(msgClassName, getMode(), requestedType); + } + this.type = instance.getType(); getSubscription().notifyResolved(); return new InactiveState(instance, msgDB, this); } catch (Exception e) { -// OseeLog.log(UnresolvedState.class, Level.SEVERE, "problems acquring instance for " + getMsgClassName(), e); should we be logging this? + // Yes we do need to log this + OseeLog.log(UnresolvedState.class, Level.SEVERE, "problems acquring instance for " + getMsgClassName()); getSubscription().notifyInvalidated(); return this; } diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/commands/SetElementValue.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/commands/SetElementValue.java index b89cb4a4f81..bf974128695 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/commands/SetElementValue.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/message/commands/SetElementValue.java @@ -12,6 +12,7 @@ package org.eclipse.osee.ote.message.commands; import java.io.Serializable; import java.util.List; + import org.eclipse.osee.ote.message.enums.DataType; /** @@ -19,20 +20,22 @@ import org.eclipse.osee.ote.message.enums.DataType; * @author Andrew M. Finkbeiner * @author Ken J. Aguilar */ -public class SetElementValue implements Serializable { +public final class SetElementValue implements Serializable { private static final long serialVersionUID = -6696340729803635664L; private final String message; private final List<Object> element; private final String value; private final DataType type; + private final boolean shouldSend; - public SetElementValue(String message, DataType type, List<Object> elementPath, String value) { + public SetElementValue(String message, DataType type, List<Object> elementPath, String value, boolean shouldSend) { super(); this.message = message; this.type = type; this.element = elementPath; this.value = value; + this.shouldSend = shouldSend; } /** @@ -56,4 +59,8 @@ public class SetElementValue implements Serializable { public DataType getMemType() { return type; } + + public boolean shouldSend() { + return shouldSend; + } } |