diff options
author | ddunne | 2010-04-01 23:31:30 +0000 |
---|---|---|
committer | ddunne | 2010-04-01 23:31:30 +0000 |
commit | 2d514bf25953f01100adf3bb0f7845ad7401ef97 (patch) | |
tree | 1fc790b3b8e6ac7c9da77812f77d27d194252772 /plugins/org.eclipse.osee.framework.messaging.event.res | |
parent | fedc6c6a5022b7e7af3aa83748c39d4f217484a7 (diff) | |
download | org.eclipse.osee-2d514bf25953f01100adf3bb0f7845ad7401ef97.tar.gz org.eclipse.osee-2d514bf25953f01100adf3bb0f7845ad7401ef97.tar.xz org.eclipse.osee-2d514bf25953f01100adf3bb0f7845ad7401ef97.zip |
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging.event.res')
34 files changed, 1568 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/.classpath b/plugins/org.eclipse.osee.framework.messaging.event.res/.classpath new file mode 100644 index 00000000000..8a8f1668cdc --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/.project b/plugins/org.eclipse.osee.framework.messaging.event.res/.project new file mode 100644 index 00000000000..3c7ec36f308 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.framework.messaging.event.res</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.osee.framework.messaging.event.res/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..a8020f2dc2e --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Fri Mar 28 14:00:57 GMT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..eff86635f02 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Framework Event Service (Incubation) +Bundle-SymbolicName: org.eclipse.osee.framework.messaging.event.res;singleton:=true +Bundle-Version: 0.9.4.qualifier +Eclipse-ExtensibleAPI: true +Bundle-Activator: org.eclipse.osee.framework.messaging.event.res.Activator +Require-Bundle: org.eclipse.core.runtime, + net.jini, + org.eclipse.osee.framework.jdk.core, + org.eclipse.osee.framework.jini, + org.eclipse.osee.framework.plugin.core, + org.eclipse.ui +Bundle-ActivationPolicy: lazy +Bundle-Description: Skynet Event Service - Skynet Cache Network Manager +Bundle-Vendor: Eclipse.org +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: org.eclipse.osee.framework.core.enums, + org.eclipse.osee.framework.logging diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/build.properties b/plugins/org.eclipse.osee.framework.messaging.event.res/build.properties new file mode 100644 index 00000000000..5797176f58f --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/build.properties @@ -0,0 +1,5 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ plugin.xml,\
+ .
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/plugin.xml b/plugins/org.eclipse.osee.framework.messaging.event.res/plugin.xml new file mode 100644 index 00000000000..c5431f46039 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.osee.framework.jini.JiniInterface">
+ <Interface classname="org.eclipse.osee.framework.messaging.event.res.ISkynetEventService"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.res.IFrameworkEvent"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.res.IFrameworkEventListener"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.res.event.AttributeChange"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.jini.JiniInterface">
+ <RegisterBundle/>
+ </extension>
+ <extension
+ id="EventService"
+ name="EventService"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.osee.framework.messaging.event.framework.service.SkynetEventServicePlatformRunnable"/>
+ </application>
+ </extension>
+ <extension
+ id="EventServiceProd"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.eclipse.osee.framework.messaging.event.skynet.EventService"
+ name="EventServiceProd"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/Activator.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/Activator.java new file mode 100644 index 00000000000..ecf0694211b --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/Activator.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.framework.messaging.event.res; + +import org.eclipse.osee.framework.plugin.core.OseeActivator; + +/** + * @author Donald G. Dunne + */ +public class Activator extends OseeActivator { + + private static Activator pluginInstance; + public static final String PLUGIN_ID = "org.eclipse.osee.framework.messaging.event.res"; + + public Activator() { + super(); + pluginInstance = this; + } + + /** + * Returns the shared instance. + */ + public static Activator getInstance() { + return pluginInstance; + } +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/FrameworkEventListener.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/FrameworkEventListener.java new file mode 100644 index 00000000000..206d10600a2 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/FrameworkEventListener.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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.framework.messaging.event.res; + +import java.rmi.RemoteException; + +/** + * Client call back + * + * @author Donald G. Dunne + */ +public abstract class FrameworkEventListener implements IFrameworkEventListener { + + private static final long serialVersionUID = -3051021974908944273L; + private final Long uid; + + public FrameworkEventListener() { + this.uid = (long) (Math.random() * Long.MAX_VALUE); + } + + /** + * Since the listeners are hashed on the service side, it is necessary to force the equals and hashcode operators to + * work in a particular manner. + */ + @Override + public final boolean equals(Object obj) { + if (obj instanceof FrameworkEventListener) { + return ((FrameworkEventListener) obj).uid.equals(this.uid); + } + return false; + } + + @Override + public final int hashCode() { + return uid.hashCode(); + } + + /** + * Callback for the client + */ + public abstract void onEvent(IFrameworkEvent[] events) throws RemoteException; + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkArtifactEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkArtifactEvent.java new file mode 100644 index 00000000000..1da133aaa5b --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkArtifactEvent.java @@ -0,0 +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.framework.messaging.event.res; + +/** + * @author Donald G. Dunne + */ +public interface IFrameworkArtifactEvent extends IFrameworkEvent { + + public String getFactoryName(); + + public String getBranchGuid(); + + public String getArtGuid(); + + public int getArtId(); + + public String getArtTypeGuid(); + + public int getArtTypeId(); +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEvent.java new file mode 100644 index 00000000000..19becda22cf --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEvent.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * 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.framework.messaging.event.res; + +import org.eclipse.osee.framework.messaging.event.res.event.NetworkSender; + +/** + * @author Donald G. Dunne + */ +public interface IFrameworkEvent { + public NetworkSender getNetworkSender(); + + public void toXml(StringBuffer sb); + + public void fromXml(String xml); + + public String getEventGuid(); +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEventListener.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEventListener.java new file mode 100644 index 00000000000..35d1220b328 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkEventListener.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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.framework.messaging.event.res; + +import java.io.Serializable; +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * @author Donald G. Dunne + */ +public interface IFrameworkEventListener extends Remote, Serializable { + + public abstract void onEvent(IFrameworkEvent[] events) throws RemoteException; + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkRelationLinkEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkRelationLinkEvent.java new file mode 100644 index 00000000000..f29caee1458 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/IFrameworkRelationLinkEvent.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * 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.framework.messaging.event.res; + +/** + * @author Donald G. Dunne + */ +public interface IFrameworkRelationLinkEvent extends IFrameworkEvent { + + public int getArtAId(); + + public int getArtATypeId(); + + public int getArtBId(); + + public int getArtBTypeId(); + + public Integer getRelId(); + + public Integer getGammaId(); + + public int getRelTypeId(); + + public int getId(); +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeChange.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeChange.java new file mode 100644 index 00000000000..be67a7b609b --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeChange.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import org.eclipse.osee.framework.core.enums.ModificationType; +import org.eclipse.osee.framework.jdk.core.util.AXml; + +/** + * @author Donald G. Dunne + */ +public class AttributeChange { + private String attrTypeGuid; + private String modificationGuid; + private int attributeId; + private int gammaId; + private Object[] value; + + public AttributeChange(String typeGuid, Object[] value, ModificationType modificationType, int attributeId, int gammaId) { + super(); + this.attrTypeGuid = typeGuid; + this.value = value; + this.modificationGuid = AttributeEventModificationType.getType(modificationType).getGuid(); + this.attributeId = attributeId; + this.gammaId = gammaId; + } + + public AttributeChange(String xml) { + fromXml(xml); + } + + public String toXml() { + StringBuffer sb = new StringBuffer(); + sb.append(AXml.addTagData("aTypeGuid", "" + attrTypeGuid)); + sb.append(AXml.addTagData("modGuid", "" + modificationGuid)); + sb.append(AXml.addTagData("attrId", "" + attributeId)); + sb.append(AXml.addTagData("gammaId", "" + gammaId)); + sb.append(AXml.addTagData("value", "" + value)); + return sb.toString(); + } + + private void fromXml(String xml) { + this.attrTypeGuid = AXml.getTagData(xml, "aTypeGuid"); + this.modificationGuid = AXml.getTagData(xml, "modGuid"); + this.attributeId = AXml.getTagIntegerData(xml, "attrId"); + this.gammaId = AXml.getTagIntegerData(xml, "gammaId"); + System.err.println("AttributeChange: how transmit value"); + // this.value = AXml.getTagData(xml, "value"); + } + + @Override + public String toString() { + return attrTypeGuid + "(" + attributeId + ")" + " => " + value; + } + + public String getAttributeTypeGuid() { + return attrTypeGuid; + } + + public Object[] getData() { + return value; + } + + public int getAttributeId() { + return attributeId; + } + + public int getGammaId() { + return gammaId; + } + + public ModificationType getModificationType() { + return AttributeEventModificationType.getType(modificationGuid).getModificationType(); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeEventModificationType.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeEventModificationType.java new file mode 100644 index 00000000000..b2032983488 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/AttributeEventModificationType.java @@ -0,0 +1,70 @@ +/*
+ * Created on Mar 31, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.messaging.event.res.event;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+
+/**
+ * This class maps attribute modification types to event guids.<br>
+ * <br>
+ * TODO Should probably replace Modification Type or integrate guids in, but can't do cause ModificationType is
+ * serializeable and can't change till 0.9.5
+ *
+ * @author Donald G. Dunne
+ */
+public class AttributeEventModificationType {
+
+ private final ModificationType modificationType;
+ private final String guid;
+ private static Map<ModificationType, AttributeEventModificationType> modTypeToEventType =
+ new HashMap<ModificationType, AttributeEventModificationType>(15);
+ private static Map<String, AttributeEventModificationType> guidToEventType =
+ new HashMap<String, AttributeEventModificationType>(15);
+ public static AttributeEventModificationType Modified =
+ new AttributeEventModificationType(ModificationType.MODIFIED, "AYsmVz6VujxZxW3ByjgA");
+ public static AttributeEventModificationType Artifact_Deleted =
+ new AttributeEventModificationType(ModificationType.ARTIFACT_DELETED, "AYsmWPvkJyoo4ynjAbgA");
+ public static AttributeEventModificationType Deleted =
+ new AttributeEventModificationType(ModificationType.DELETED, "AYsmWPxw7mAFrGVGf2AA");
+ public static AttributeEventModificationType Introduced =
+ new AttributeEventModificationType(ModificationType.INTRODUCED, "AYsmWPzUPCGfOdH5w3wA");
+ public static AttributeEventModificationType Merged =
+ new AttributeEventModificationType(ModificationType.MERGED, "AYsmWP0Gb1y5V6G9tRwA");
+ public static AttributeEventModificationType New =
+ new AttributeEventModificationType(ModificationType.NEW, "AYsmWP05uX1Dl6q2pIwA");
+ public static AttributeEventModificationType Undeleted =
+ new AttributeEventModificationType(ModificationType.UNDELETED, "AYsmWP1q1B2bK1kj0ugA");
+
+ public AttributeEventModificationType(ModificationType modificationType, String guid) {
+ this.modificationType = modificationType;
+ this.guid = guid;
+ modTypeToEventType.put(this.modificationType, this);
+ guidToEventType.put(guid, this);
+ }
+
+ public static Collection<AttributeEventModificationType> getTypes() {
+ return modTypeToEventType.values();
+ }
+
+ public static AttributeEventModificationType getType(ModificationType modificationType) {
+ return modTypeToEventType.get(modificationType);
+ }
+
+ public static AttributeEventModificationType getType(String guid) {
+ return guidToEventType.get(guid);
+ }
+
+ public ModificationType getModificationType() {
+ return modificationType;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/BranchEventModificationType.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/BranchEventModificationType.java new file mode 100644 index 00000000000..4ae2277db13 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/BranchEventModificationType.java @@ -0,0 +1,44 @@ +/*
+ * Created on Mar 31, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.messaging.event.res.event;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class BranchEventModificationType {
+
+ private final String guid;
+ private static Map<String, BranchEventModificationType> guidToEventType =
+ new HashMap<String, BranchEventModificationType>(15);
+ public static BranchEventModificationType New = new BranchEventModificationType("AbMBZMtQ304V3L3zdlgA");
+ public static BranchEventModificationType Committed = new BranchEventModificationType("AbMBZDMIWATP9NaK0bAA");
+ public static BranchEventModificationType Deleted = new BranchEventModificationType("AbMBZE3UESatk0iX0RgA");
+ public static BranchEventModificationType MergeBranchConflictResolved =
+ new BranchEventModificationType("AbMBZGShRVVx8IaAI3QA");
+ public static BranchEventModificationType Purged = new BranchEventModificationType("AbMBZIfAPkGsNG26uZAA");
+ public static BranchEventModificationType Renamed = new BranchEventModificationType("AbMBZKjRORW0CB45LVgA");
+
+ public BranchEventModificationType(String guid) {
+ this.guid = guid;
+ guidToEventType.put(guid, this);
+ }
+
+ public static Collection<BranchEventModificationType> getTypes() {
+ return guidToEventType.values();
+ }
+
+ public static BranchEventModificationType getType(String guid) {
+ return guidToEventType.get(guid);
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/FrameworkEventBase.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/FrameworkEventBase.java new file mode 100644 index 00000000000..f9ec91418ce --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/FrameworkEventBase.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import org.eclipse.osee.framework.jdk.core.util.AXml; +import org.eclipse.osee.framework.messaging.event.res.IFrameworkEvent; + +/** + * @author Donald G. Dunne + */ +public class FrameworkEventBase implements IFrameworkEvent { + + private NetworkSender networkSender; + private String eventGuid; + + public FrameworkEventBase(NetworkSender networkSender, String eventGuid) { + this.networkSender = networkSender; + this.eventGuid = eventGuid; + } + + public FrameworkEventBase(String xml) { + fromXml(xml); + } + + public NetworkSender getNetworkSender() { + return networkSender; + } + + public String getEventGuid() { + return eventGuid; + } + + public void toXml(StringBuffer sb) { + sb.append(AXml.addTagData("eventGuid", eventGuid)); + this.networkSender.toXml(sb); + } + + public void fromXml(String xml) { + this.eventGuid = AXml.getTagData(xml, "eventGuid"); + this.networkSender = new NetworkSender(xml); + } + + public String toXml() { + StringBuffer sb = new StringBuffer(); + toXml(sb); + return sb.toString(); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkAccessControlArtifactsEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkAccessControlArtifactsEvent.java new file mode 100644 index 00000000000..dd8c9e2b3e8 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkAccessControlArtifactsEvent.java @@ -0,0 +1,35 @@ +/*******************************************************************************
+ * 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.framework.messaging.event.res.event;
+
+import java.util.Collection;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkAccessControlArtifactsEvent extends SkynetArtifactsEventBase {
+ private static final long serialVersionUID = -4325821466558180270L;
+ private final String accessControlModType;
+
+ public String getAccessControlModTypeName() {
+ return accessControlModType;
+ }
+
+ public NetworkAccessControlArtifactsEvent(String accessControlModType, int branchId, Collection<Integer> artifactIds, Collection<String> artifactGuids, Collection<Integer> artifactTypeIds, NetworkSender networkSender) {
+ super(branchId, artifactIds, artifactGuids, artifactTypeIds, networkSender);
+ this.accessControlModType = accessControlModType;
+ }
+
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactAddedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactAddedEvent.java new file mode 100644 index 00000000000..9b34e704bf9 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactAddedEvent.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +/** + * @author Robert A. Fisher + * @author Donald G. Dunne + */ +public class NetworkArtifactAddedEvent extends SkynetArtifactEventBase { + private static final long serialVersionUID = -4325821466558180270L; + + public NetworkArtifactAddedEvent(int branchId, String branchGuid, int transactionId, int artId, String artGuid, int artTypeId, String artTypeGuid, String factoryName, NetworkSender networkSender) { + super(branchId, branchGuid, transactionId, artId, artGuid, artTypeId, artTypeGuid, factoryName, networkSender); + } + + public NetworkArtifactAddedEvent(SkynetArtifactEventBase base) { + super(base); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NetworkArtifactAddedEvent) { + return getArtId() == ((NetworkArtifactAddedEvent) obj).getArtId(); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + return getArtId(); + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactChangeTypeEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactChangeTypeEvent.java new file mode 100644 index 00000000000..d90747fad12 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactChangeTypeEvent.java @@ -0,0 +1,42 @@ +/*******************************************************************************
+ * 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.framework.messaging.event.res.event;
+
+import java.util.Collection;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkArtifactChangeTypeEvent extends SkynetArtifactsEventBase {
+ private static final long serialVersionUID = -4325821466558180270L;
+
+ private final int toArtifactTypeId;
+ private final String toArtifactTypeGuid;
+
+ public int getToArtifactTypeId() {
+ return toArtifactTypeId;
+ }
+
+ public NetworkArtifactChangeTypeEvent(int branchId, Collection<Integer> artifactIds, Collection<String> artifactGuids, Collection<Integer> artifactTypeIds, int toArtifactTypeId, String toArtifactTypeGuid, NetworkSender networkSender) {
+ super(branchId, artifactIds, artifactGuids, artifactTypeIds, networkSender);
+ this.toArtifactTypeId = toArtifactTypeId;
+ this.toArtifactTypeGuid = toArtifactTypeGuid;
+ }
+
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+
+ public String getToArtifactTypeGuid() {
+ return toArtifactTypeGuid;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactDeletedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactDeletedEvent.java new file mode 100644 index 00000000000..a23711cedcd --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactDeletedEvent.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +/** + * @author Robert A. Fisher + * @author Donald G. Dunne + */ +public class NetworkArtifactDeletedEvent extends SkynetArtifactEventBase { + private static final long serialVersionUID = 568951803773151575L; + + public NetworkArtifactDeletedEvent(int branchId, String branchGuid, int transactionId, int artId, String artGuid, int artTypeId, String artTypeGuid, String factoryName, NetworkSender networkSender) { + super(branchId, branchGuid, transactionId, artId, artGuid, artTypeId, artTypeGuid, factoryName, networkSender); + } + + public NetworkArtifactDeletedEvent(SkynetArtifactEventBase base) { + super(base); + } +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactModifiedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactModifiedEvent.java new file mode 100644 index 00000000000..438778e64ec --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactModifiedEvent.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import java.util.Collection; + +/** + * @author Robert A. Fisher + * @author Donald G. Dunne + */ +public class NetworkArtifactModifiedEvent extends SkynetArtifactEventBase { + private static final long serialVersionUID = -4325821466558180270L; + private final Collection<AttributeChange> attributeValues; + + public NetworkArtifactModifiedEvent(int branchId, String branchGuid, int transactionId, int artId, String artGuid, int artTypeId, String artTypeGuid, String factoryName, NetworkSender networkSender, Collection<AttributeChange> attributeValues) { + super(branchId, branchGuid, transactionId, artId, artGuid, artTypeId, artTypeGuid, factoryName, networkSender); + + this.attributeValues = attributeValues; + } + + public NetworkArtifactModifiedEvent(SkynetArtifactEventBase base, Collection<AttributeChange> attributeValues) { + super(base); + + this.attributeValues = attributeValues; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NetworkArtifactModifiedEvent) { + return getArtId() == ((NetworkArtifactModifiedEvent) obj).getArtId(); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + return getArtId(); + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public Collection<AttributeChange> getAttributeChanges() { + return attributeValues; + } +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactPurgeEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactPurgeEvent.java new file mode 100644 index 00000000000..8a90e69bc05 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkArtifactPurgeEvent.java @@ -0,0 +1,32 @@ +/*******************************************************************************
+ * 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.framework.messaging.event.res.event;
+
+import java.util.Collection;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkArtifactPurgeEvent extends SkynetArtifactsEventBase {
+ private static final long serialVersionUID = -4325821466558180270L;
+
+ public NetworkArtifactPurgeEvent(int branchId, Collection<Integer> artifactIds, Collection<String> artifactGuids, Collection<Integer> artifactTypeIds, NetworkSender networkSender) {
+ super(branchId, artifactIds, artifactGuids, artifactTypeIds, networkSender);
+ }
+
+ /**
+ * @return Returns the serialVersionUID.
+ */
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEvent.java new file mode 100644 index 00000000000..8e40b88eeef --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEvent.java @@ -0,0 +1,42 @@ +/*
+ * Created on Mar 31, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.messaging.event.res.event;
+
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkBranchEvent extends NetworkBranchEventBase {
+
+ private BranchEventModificationType branchEventModificationType;
+
+ public NetworkBranchEvent(BranchEventModificationType branchEventModificationType, String branchGuid, NetworkSender networkSender) {
+ super(branchGuid, branchEventModificationType.getGuid(), networkSender);
+ this.branchEventModificationType = branchEventModificationType;
+ }
+
+ public NetworkBranchEvent(String xml) {
+ super(xml);
+ }
+
+ public BranchEventModificationType getModType() {
+ return branchEventModificationType;
+ }
+
+ @Override
+ public void fromXml(String xml) {
+ super.fromXml(xml);
+ this.branchEventModificationType = BranchEventModificationType.getType(AXml.getTagData(xml, "modTypeGuid"));
+ }
+
+ @Override
+ public void toXml(StringBuffer sb) {
+ super.toXml(sb);
+ sb.append(AXml.addTagData("modTypeGuid", branchEventModificationType.getGuid()));
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEventBase.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEventBase.java new file mode 100644 index 00000000000..d38d8ffcff2 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchEventBase.java @@ -0,0 +1,42 @@ +/*
+ * Created on Mar 31, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.messaging.event.res.event;
+
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class NetworkBranchEventBase extends FrameworkEventBase {
+
+ private String branchGuid;
+
+ public NetworkBranchEventBase(String branchGuid, String eventGuid, NetworkSender networkSender) {
+ super(networkSender, eventGuid);
+ this.branchGuid = branchGuid;
+ }
+
+ public NetworkBranchEventBase(String xml) {
+ super(xml);
+ }
+
+ @Override
+ public void fromXml(String xml) {
+ super.fromXml(xml);
+ this.branchGuid = AXml.getTagData(xml, "branchGuid");
+ }
+
+ @Override
+ public void toXml(StringBuffer sb) {
+ super.toXml(sb);
+ sb.append(AXml.addTagData("branchGuid", branchGuid));
+ }
+
+ public String getBranchGuid() {
+ return branchGuid;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchRenameEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchRenameEvent.java new file mode 100644 index 00000000000..b4c70a99a82 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBranchRenameEvent.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import org.eclipse.osee.framework.jdk.core.util.AXml; + +/** + * @author Donald G. Dunne + */ +public class NetworkBranchRenameEvent extends NetworkBranchEvent { + private String branchName; + private String shortName; + + public NetworkBranchRenameEvent(String branchGuid, String branchName, String shortName, NetworkSender networkSender) { + super(BranchEventModificationType.Renamed, branchGuid, networkSender); + this.branchName = branchName; + this.shortName = shortName; + } + + public NetworkBranchRenameEvent(String xml) { + super(xml); + } + + public String getBranchName() { + return branchName; + } + + public void setBranchName(String branchName) { + this.branchName = branchName; + } + + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + @Override + public void fromXml(String xml) { + super.fromXml(xml); + this.branchName = AXml.getTagData(xml, "branchName"); + this.shortName = AXml.getTagData(xml, "shortName"); + } + + @Override + public void toXml(StringBuffer sb) { + super.toXml(sb); + sb.append(AXml.addTagData("branchName", branchName)); + sb.append(AXml.addTagData("shortName", shortName)); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBroadcastEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBroadcastEvent.java new file mode 100644 index 00000000000..c6aa97640f1 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkBroadcastEvent.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import java.util.ArrayList; +import java.util.Collection; +import org.eclipse.osee.framework.jdk.core.util.AXml; +import org.eclipse.osee.framework.jdk.core.util.Collections; + +/** + * @author Donald G. Dunne + */ +public class NetworkBroadcastEvent extends FrameworkEventBase { + + public static String GUID = "AYxiaIdXukmXPJlYWbQA"; + private String message; + private String broadcastEventType; + private Collection<String> userIds; + + public NetworkBroadcastEvent(String broadcastEventType, String message, Collection<String> userIds, NetworkSender networkSender) { + super(networkSender, GUID); + this.broadcastEventType = broadcastEventType; + this.message = message; + if (userIds == null) { + this.userIds = java.util.Collections.emptyList(); + } else { + this.userIds = userIds; + } + } + + public NetworkBroadcastEvent(String broadcastEventType, String message, NetworkSender networkSender) { + this(broadcastEventType, message, null, networkSender); + } + + public NetworkBroadcastEvent(String xml) { + super(xml); + } + + @Override + public void fromXml(String xml) { + super.fromXml(xml); + this.userIds = new ArrayList<String>(); + this.userIds.addAll(Collections.fromString(AXml.getTagData(xml, "bcUserId"), ";")); + this.broadcastEventType = AXml.getTagData(xml, "bcEventType"); + this.message = AXml.getTagData(xml, "msg"); + } + + @Override + public void toXml(StringBuffer sb) { + super.toXml(sb); + sb.append(AXml.addTagData("bcUserId", Collections.toString(";", userIds))); + sb.append(AXml.addTagData("bcEventType", broadcastEventType)); + sb.append(AXml.addTagData("msg", message)); + } + + public Collection<String> getUserIds() { + return userIds; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getBroadcastEventTypeName() { + return broadcastEventType; + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkCreatedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkCreatedEvent.java new file mode 100644 index 00000000000..b2596937b5d --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkCreatedEvent.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +/** + * @author Donald G. Dunne + * @author Jeff C. Phillips + */ +public class NetworkRelationLinkCreatedEvent extends SkynetRelationLinkEventBase { + + private static final long serialVersionUID = -519877422249674503L; + + private final String rationale; + private final String descriptorName; + + public NetworkRelationLinkCreatedEvent(int gammaId, int branchId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, int relTypeId, NetworkSender networkSender, String rationale, String descriptorName) { + super(gammaId, branchId, relId, artAId, artATypeId, artBId, artBTypeId, relTypeId, networkSender); + + this.rationale = rationale; + this.descriptorName = descriptorName; + } + + public NetworkRelationLinkCreatedEvent(SkynetRelationLinkEventBase base, String rationale, String descriptorName) { + super(base); + + this.rationale = rationale; + this.descriptorName = descriptorName; + } + + public String getRationale() { + return rationale; + } + + public String getDescriptorName() { + return descriptorName; + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkDeletedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkDeletedEvent.java new file mode 100644 index 00000000000..6d4804378cf --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkDeletedEvent.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +/** + * @author Donald G. Dunne + * @author Robert A. Fisher + */ +public class NetworkRelationLinkDeletedEvent extends SkynetRelationLinkEventBase { + private static final long serialVersionUID = -1451567913757261791L; + + public NetworkRelationLinkDeletedEvent(int gammaId, int branchId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, int relTypeId, NetworkSender networkSender) { + super(gammaId, branchId, relId, artAId, artATypeId, artBId, artBTypeId, relTypeId, networkSender); + } + + public NetworkRelationLinkDeletedEvent(SkynetRelationLinkEventBase base) { + super(base); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkRationalModifiedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkRationalModifiedEvent.java new file mode 100644 index 00000000000..12a7643a588 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkRelationLinkRationalModifiedEvent.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +/** + * @author Donald G. Dunne + * @author Robert A. Fisher + */ +public class NetworkRelationLinkRationalModifiedEvent extends SkynetRelationLinkEventBase { + private static final long serialVersionUID = 548299278567054333L; + + private final String rationale; + + public NetworkRelationLinkRationalModifiedEvent(int gammaId, int branchId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, int relTypeId, NetworkSender networkSender, String rationale) { + super(gammaId, branchId, relId, artAId, artATypeId, artBId, artBTypeId, relTypeId, networkSender); + + this.rationale = rationale; + } + + public NetworkRelationLinkRationalModifiedEvent(SkynetRelationLinkEventBase base, String rationale) { + super(base); + + this.rationale = rationale; + } + + public String getRationale() { + return rationale; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NetworkRelationLinkRationalModifiedEvent) { + return getRelId() == ((NetworkRelationLinkRationalModifiedEvent) obj).getRelId(); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + return getRelId(); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkSender.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkSender.java new file mode 100644 index 00000000000..6478ddc3e4b --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkSender.java @@ -0,0 +1,140 @@ +/*******************************************************************************
+ * 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.framework.messaging.event.res.event;
+
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkSender {
+
+ private String sourceObject;
+ private String sessionId;
+ private String machineName;
+ private String userId;
+ private String machineIp;
+ private String clientVersion;
+ private String port;
+
+ public NetworkSender(String sourceObject, String sessionId, String machineName, String userId, String machineIp, String port, String clientVersion) {
+ this.sessionId = sessionId;
+ this.sourceObject = sourceObject;
+ this.machineName = machineName;
+ this.userId = userId;
+ this.machineIp = machineIp;
+ this.port = port;
+ this.clientVersion = clientVersion;
+ }
+
+ public NetworkSender(String xml) {
+ fromXml(xml);
+ }
+
+ public String toXml() {
+ StringBuffer sb = new StringBuffer();
+ toXml(sb);
+ return sb.toString();
+ }
+
+ public void toXml(StringBuffer sb) {
+ sb.append(AXml.addTagData("obj", "" + sourceObject));
+ sb.append(AXml.addTagData("sId", "" + sessionId));
+ sb.append(AXml.addTagData("macName", "" + machineName));
+ sb.append(AXml.addTagData("userId", "" + userId));
+ sb.append(AXml.addTagData("macIp", "" + machineIp));
+ sb.append(AXml.addTagData("port", "" + port));
+ sb.append(AXml.addTagData("cVer", "" + clientVersion));
+ }
+
+ private void fromXml(String xml) {
+ this.sourceObject = AXml.getTagData(xml, "obj");
+ this.sessionId = AXml.getTagData(xml, "sId");
+ this.machineName = AXml.getTagData(xml, "macName");
+ this.userId = AXml.getTagData(xml, "userId");
+ this.machineIp = AXml.getTagData(xml, "macIp");
+ this.port = AXml.getTagData(xml, "port");
+ this.clientVersion = AXml.getTagData(xml, "cVer");
+ }
+
+ public String getSourceObject() {
+ return sourceObject;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public String getMachineName() {
+ return machineName;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public String getMachineIp() {
+ return machineIp;
+ }
+
+ public String getClientVersion() {
+ return clientVersion;
+ }
+
+ public String getPort() {
+ return port;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((clientVersion == null) ? 0 : clientVersion.hashCode());
+ result = prime * result + ((machineIp == null) ? 0 : machineIp.hashCode());
+ result = prime * result + ((machineName == null) ? 0 : machineName.hashCode());
+ result = prime * result + ((port == null) ? 0 : port.hashCode());
+ result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
+ result = prime * result + ((sourceObject == null) ? 0 : sourceObject.hashCode());
+ result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ NetworkSender other = (NetworkSender) obj;
+ if (clientVersion == null) {
+ if (other.clientVersion != null) return false;
+ } else if (!clientVersion.equals(other.clientVersion)) return false;
+ if (machineIp == null) {
+ if (other.machineIp != null) return false;
+ } else if (!machineIp.equals(other.machineIp)) return false;
+ if (machineName == null) {
+ if (other.machineName != null) return false;
+ } else if (!machineName.equals(other.machineName)) return false;
+ if (port == null) {
+ if (other.port != null) return false;
+ } else if (!port.equals(other.port)) return false;
+ if (sessionId == null) {
+ if (other.sessionId != null) return false;
+ } else if (!sessionId.equals(other.sessionId)) return false;
+ if (sourceObject == null) {
+ if (other.sourceObject != null) return false;
+ } else if (!sourceObject.equals(other.sourceObject)) return false;
+ if (userId == null) {
+ if (other.userId != null) return false;
+ } else if (!userId.equals(other.userId)) return false;
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkTransactionDeletedEvent.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkTransactionDeletedEvent.java new file mode 100644 index 00000000000..fa1293e63ea --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/NetworkTransactionDeletedEvent.java @@ -0,0 +1,49 @@ +/*******************************************************************************
+ * 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.framework.messaging.event.res.event;
+
+import java.util.List;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NetworkTransactionDeletedEvent extends FrameworkEventBase {
+
+ private List<Integer> transactionIds;
+ public static String GUID = "AYxiaIb0axwYCE5wXiAA";
+
+ public List<Integer> getTransactionIds() {
+ return transactionIds;
+ }
+
+ public NetworkTransactionDeletedEvent(NetworkSender networkSender, List<Integer> transactionIds) {
+ super(networkSender, GUID);
+ this.transactionIds = transactionIds;
+ }
+
+ public NetworkTransactionDeletedEvent(String xml) {
+ super(xml);
+ }
+
+ @Override
+ public void fromXml(String xml) {
+ super.fromXml(xml);
+ this.transactionIds = AXml.getTagIntegerDataArray(xml, "transId", ";");
+ }
+
+ @Override
+ public void toXml(StringBuffer sb) {
+ super.toXml(sb);
+ sb.append(AXml.addTagData("transId", transactionIds, ";"));
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactEventBase.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactEventBase.java new file mode 100644 index 00000000000..ca288570ea4 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactEventBase.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import org.eclipse.osee.framework.messaging.event.res.IFrameworkArtifactEvent; + +/** + * @author Robert A. Fisher + * @author Donald G. Dunne + */ +public class SkynetArtifactEventBase extends FrameworkEventBase implements IFrameworkArtifactEvent { + private static final long serialVersionUID = 7923550763258313718L; + + private final int artId; + private final int artTypeId; + private final String factoryName; + private final int transactionId; + private final int branchId; + private final String branchGuid; + private final String artGuid; + private final String artTypeGuid; + + public SkynetArtifactEventBase(int branchId, String branchGuid, int transactionId, int artId, String artGuid, int artTypeId, String artTypeGuid, String factoryName, NetworkSender networkSender) { + super(networkSender); + this.branchId = branchId; + this.branchGuid = branchGuid; + this.artId = artId; + this.artGuid = artGuid; + this.artTypeId = artTypeId; + this.artTypeGuid = artTypeGuid; + this.factoryName = factoryName; + this.transactionId = transactionId; + } + + public SkynetArtifactEventBase(SkynetArtifactEventBase base) { + super(base.getNetworkSender()); + this.branchId = base.branchId; + this.branchGuid = base.branchGuid; + this.artId = base.artId; + this.artGuid = base.artGuid; + this.artTypeId = base.artTypeId; + this.artTypeGuid = base.artTypeGuid; + this.factoryName = base.factoryName; + this.transactionId = base.transactionId; + } + + public int getBranchId() { + return branchId; + } + + public int getTransactionId() { + return transactionId; + } + + public int getArtId() { + return artId; + } + + public int getArtTypeId() { + return artTypeId; + } + + public String getFactoryName() { + return factoryName; + } + + @Override + public String getArtGuid() { + return artGuid; + } + + @Override + public String getArtTypeGuid() { + return artTypeGuid; + } + + @Override + public String getBranchGuid() { + return branchGuid; + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactsEventBase.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactsEventBase.java new file mode 100644 index 00000000000..f552427759c --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetArtifactsEventBase.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import java.util.Collection; +import org.eclipse.osee.framework.messaging.event.res.IFrameworkEvent; + +/** + * @author Donald G. Dunne + */ +public abstract class SkynetArtifactsEventBase extends FrameworkEventBase implements IFrameworkEvent { + private static final long serialVersionUID = 7923550763258313718L; + + private final Collection<Integer> artifactTypeIds; + private final Collection<Integer> artifactIds; + private final int branchId; + private final Collection<String> artifactGuids; + + public Collection<String> getArtifactGuids() { + return artifactGuids; + } + + public SkynetArtifactsEventBase(int branchId, Collection<Integer> artifactIds, Collection<String> artifactGuids, Collection<Integer> artifactTypeIds, NetworkSender networkSender) { + super(networkSender); + this.branchId = branchId; + this.artifactIds = artifactIds; + this.artifactTypeIds = artifactTypeIds; + this.artifactGuids = artifactGuids; + } + + public int getId() { + return branchId; + } + + public Collection<Integer> getArtifactTypeIds() { + return artifactTypeIds; + } + + public Collection<Integer> getArtifactIds() { + return artifactIds; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NetworkArtifactPurgeEvent) { + return artifactIds.hashCode() == ((NetworkArtifactPurgeEvent) obj).getArtifactIds().hashCode() && artifactTypeIds.hashCode() == ((NetworkArtifactPurgeEvent) obj).getArtifactTypeIds().hashCode(); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + return artifactIds.hashCode() + artifactTypeIds.hashCode(); + } + +} diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetRelationLinkEventBase.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetRelationLinkEventBase.java new file mode 100644 index 00000000000..eef1794124b --- /dev/null +++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src/org/eclipse/osee/framework/messaging/event/res/event/SkynetRelationLinkEventBase.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * 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.framework.messaging.event.res.event; + +import org.eclipse.osee.framework.messaging.event.res.IFrameworkRelationLinkEvent; + +/** + * @author Robert A. Fisher + */ +public class SkynetRelationLinkEventBase extends FrameworkEventBase implements IFrameworkRelationLinkEvent { + private static final long serialVersionUID = 154870900652138769L; + + private final Integer relId; + private final int relTypeId; + private final int artAId; + private final int artATypeId; + private final int artBId; + private final int artBTypeId; + private final int gammaId; + private final int branchId; + + public SkynetRelationLinkEventBase(int gammaId, int branchId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, int relTypeId, NetworkSender networkSender) { + super(networkSender); + this.branchId = branchId; + this.relId = relId; + this.artAId = artAId; + this.artATypeId = artATypeId; + this.artBId = artBId; + this.gammaId = gammaId; + this.relTypeId = relTypeId; + this.artBTypeId = artBTypeId; + } + + public SkynetRelationLinkEventBase(SkynetRelationLinkEventBase base) { + super(base.getNetworkSender()); + this.branchId = base.branchId; + this.relId = base.relId; + this.artAId = base.artAId; + this.artATypeId = base.artATypeId; + this.artBId = base.artBId; + this.gammaId = base.gammaId; + this.relTypeId = base.relTypeId; + this.artBTypeId = base.artBTypeId; + } + + public int getId() { + return branchId; + } + + public int getArtATypeId() { + return artATypeId; + } + + public int getArtBTypeId() { + return artBTypeId; + } + + public int getArtAId() { + return artAId; + } + + public int getArtBId() { + return artBId; + } + + public Integer getRelId() { + return relId; + } + + public Integer getGammaId() { + return gammaId; + } + + public int getRelTypeId() { + return relTypeId; + } +} |