Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-01-03 15:20:34 +0000
committerafinkbein2008-01-03 15:20:34 +0000
commitffca7d330867e8288117ad8b69f9e8a245438817 (patch)
tree6fe1f585bbbc550df2193b5a727bc773e95dfbab
parentfda0c76718a223150302d543af75c99837d9af0b (diff)
downloadorg.eclipse.osee-ffca7d330867e8288117ad8b69f9e8a245438817.tar.gz
org.eclipse.osee-ffca7d330867e8288117ad8b69f9e8a245438817.tar.xz
org.eclipse.osee-ffca7d330867e8288117ad8b69f9e8a245438817.zip
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.classpath7
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.project28
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/META-INF/MANIFEST.MF22
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/build.properties6
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/plugin.xml31
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ASkynetEventListener.java53
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetArtifactEvent.java23
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEvent.java29
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventListener.java20
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventService.java42
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetRelationLinkEvent.java29
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteCommitBranchEvent.java57
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteDeletedBranchEvent.java49
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteNewBranchEvent.java49
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteRenameBranchEvent.java89
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/Sample.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/SkynetEventPlugin.java34
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/ConfigurationModifiedEvent.java27
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactDeletedEvent.java30
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactModifiedEvent.java61
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteBroadcastEvent.java38
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteNewRelationLinkEvent.java118
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkDeletedEvent.java33
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkModifiedEvent.java76
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetArtifactEventBase.java57
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetAttributeChange.java63
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetChange.java20
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetDisconnectClientsEvent.java32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetEventBase.java67
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetRelationLinkEventBase.java104
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchArtTypeFilter.java48
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchFilter.java36
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/IEventFilter.java28
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventService.java214
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventServicePlatformRunnable.java65
35 files changed, 1782 insertions, 0 deletions
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.classpath b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.classpath
new file mode 100644
index 00000000000..02159672985
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.project b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.project
new file mode 100644
index 00000000000..978f420c584
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.framework.messaging.event.skynet</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/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/META-INF/MANIFEST.MF b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..275b6babf80
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Skynet Event Service (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.framework.messaging.event.skynet;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.osee.framework.messaging.event.skynet.SkynetEventPlugin
+Require-Bundle: org.eclipse.core.runtime,
+ net.jini,
+ org.eclipse.osee.framework.jdk.core,
+ org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.osee.framework.jini,
+ org.eclipse.osee.framework.plugin.core,
+ org.eclipse.osee.framework.ui.plugin
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.osee.framework.messaging.event.skynet,
+ org.eclipse.osee.framework.messaging.event.skynet.event,
+ org.eclipse.osee.framework.messaging.event.skynet.filter,
+ org.eclipse.osee.framework.messaging.event.skynet.service
+Bundle-Description: Skynet Event Service - Skynet Cache Network Manager
+Bundle-Vendor: Eclipse.org
+Bundle-ClassPath: skynetEvent.jar
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/build.properties b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/build.properties
new file mode 100644
index 00000000000..afc89d080b3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/build.properties
@@ -0,0 +1,6 @@
+source.skynetEvent.jar = src/
+output.skynetEvent.jar = bin/
+bin.includes = META-INF/,\
+ skynetEvent.jar,\
+ plugin.xml,\
+ src/
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/plugin.xml b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/plugin.xml
new file mode 100644
index 00000000000..b37257d9042
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/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.skynet.ISkynetEventService"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.skynet.ISkynetEventListener"/>
+ <Interface classname="org.eclipse.osee.framework.messaging.event.skynet.event.SkynetAttributeChange"/>
+ </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.skynet.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/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ASkynetEventListener.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ASkynetEventListener.java
new file mode 100644
index 00000000000..193ee3ae62d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ASkynetEventListener.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.skynet;
+
+import java.rmi.RemoteException;
+
+/**
+ * Client callback base class.
+ *
+ * @author Robert A. Fisher
+ */
+public abstract class ASkynetEventListener implements ISkynetEventListener {
+
+ private final Long uid;
+
+ public ASkynetEventListener() {
+ 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 ASkynetEventListener) {
+ return ((ASkynetEventListener) obj).uid.equals(this.uid);
+ }
+ return false;
+ }
+
+ @Override
+ public final int hashCode() {
+ return uid.hashCode();
+ }
+
+ /**
+ * Callback for the client to process remote skynet events. The array will contain a list of events to which this
+ * listener is subscribed.
+ *
+ * @throws RemoteException
+ */
+ public abstract void onEvent(ISkynetEvent[] events) throws RemoteException;
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetArtifactEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetArtifactEvent.java
new file mode 100644
index 00000000000..01821d4e967
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetArtifactEvent.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.skynet;
+
+/**
+ * @author Robert A. Fisher
+ */
+public interface ISkynetArtifactEvent extends ISkynetEvent {
+
+ public String getFactoryName();
+
+ public int getArtId();
+
+ public int getArtTypeId();
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEvent.java
new file mode 100644
index 00000000000..d5dff3022c8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEvent.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.skynet;
+
+import java.io.Serializable;
+
+/**
+ * All Skynet events implement this interface.
+ *
+ * @author Robert A. Fisher
+ */
+@SuppressWarnings("unchecked")
+public interface ISkynetEvent extends Serializable, Comparable {
+ public static final ISkynetEvent[] EMPTY_ARRAY = new ISkynetEvent[0];
+
+ public int getTransactionId();
+
+ public int getBranchId();
+
+ public int getAuthor();
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventListener.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventListener.java
new file mode 100644
index 00000000000..7bfa3648914
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventListener.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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.skynet;
+
+import java.io.Serializable;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface ISkynetEventListener extends Remote, Serializable {
+
+ public abstract void onEvent(ISkynetEvent[] events) throws RemoteException;
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventService.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventService.java
new file mode 100644
index 00000000000..f19328a13ca
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetEventService.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.skynet;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import org.eclipse.osee.framework.messaging.event.skynet.filter.IEventFilter;
+
+public interface ISkynetEventService extends Remote {
+
+ // TODO all calls to the server go here
+ /**
+ * Register to receive events based on filters.
+ *
+ * @param filters TODO
+ */
+ public void register(ISkynetEventListener listener, IEventFilter... filters) throws RemoteException;
+
+ /**
+ * Deregister to receive events based on filters.
+ *
+ * @param filters TODO
+ */
+ public void deregister(ISkynetEventListener listener, IEventFilter... filters) throws RemoteException;
+
+ /**
+ * Pass events to the service to be disemminated.
+ *
+ * @param events
+ */
+ public void kick(ISkynetEvent[] events, ISkynetEventListener... except) throws RemoteException;
+
+ public boolean isAlive() throws RemoteException;
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetRelationLinkEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetRelationLinkEvent.java
new file mode 100644
index 00000000000..db45608e60d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/ISkynetRelationLinkEvent.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.skynet;
+
+/**
+ * @author Robert A. Fisher
+ */
+public interface ISkynetRelationLinkEvent extends ISkynetEvent {
+
+ public int getArtAId();
+
+ public int getArtBId();
+
+ public int getArtATypeId();
+
+ public int getArtBTypeId();
+
+ public Integer getRelId();
+
+ public Integer getGammaId();
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteCommitBranchEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteCommitBranchEvent.java
new file mode 100644
index 00000000000..1c139689349
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteCommitBranchEvent.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.skynet;
+
+/**
+ * Skynet messaging event; Should not be subscribed to by OSEE applications.
+ *
+ * @author Donald G. Dunne
+ */
+public class RemoteCommitBranchEvent implements ISkynetEvent {
+ private static final long serialVersionUID = 8339596149601667894L;
+ private int branchId;
+ private int author;
+
+ /**
+ * @param branchId
+ * @param author
+ */
+ public RemoteCommitBranchEvent(int branchId, int author) {
+ this.branchId = branchId;
+ this.author = author;
+ }
+
+ public int getBranchId() {
+ return branchId;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object o) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getAuthor()
+ */
+ public int getAuthor() {
+ return author;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getTransactionId()
+ */
+ public int getTransactionId() {
+ return 0;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteDeletedBranchEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteDeletedBranchEvent.java
new file mode 100644
index 00000000000..b2adef448eb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteDeletedBranchEvent.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.skynet;
+
+/**
+ * Skynet messaging event; Should not be subscribed to by OSEE applications.
+ *
+ * @author Jeff C. Phillips
+ */
+public class RemoteDeletedBranchEvent implements ISkynetEvent {
+ private static final long serialVersionUID = 4651718722048388742L;
+ private int branchId;
+ private int author;
+
+ public RemoteDeletedBranchEvent(int branchId, int author) {
+ this.branchId = branchId;
+ this.author = author;
+ }
+
+ public int getTransactionId() {
+ return 0;
+ }
+
+ public int getBranchId() {
+ return branchId;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object o) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getAuthor()
+ */
+ public int getAuthor() {
+ return author;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteNewBranchEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteNewBranchEvent.java
new file mode 100644
index 00000000000..4e5d7a1a8d3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteNewBranchEvent.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.skynet;
+
+/**
+ * Skynet messaging event; Should not be subscribed to by OSEE applications.
+ *
+ * @author Jeff C. Phillips
+ */
+public class RemoteNewBranchEvent implements ISkynetEvent {
+ private static final long serialVersionUID = 8339596149601337894L;
+ private int branchId;
+ private int author;
+
+ public RemoteNewBranchEvent(int branchId, int author) {
+ this.branchId = branchId;
+ this.author = author;
+ }
+
+ public int getTransactionId() {
+ return 0;
+ }
+
+ public int getBranchId() {
+ return branchId;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object o) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getAuthor()
+ */
+ public int getAuthor() {
+ return author;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteRenameBranchEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteRenameBranchEvent.java
new file mode 100644
index 00000000000..edf77d725d1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/RemoteRenameBranchEvent.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * 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.skynet;
+
+/**
+ * Skynet messaging event; Should not be subscribed to by OSEE applications.
+ *
+ * @author Donald G. Dunne
+ */
+public class RemoteRenameBranchEvent implements ISkynetEvent {
+ private static final long serialVersionUID = 8339596149601997894L;
+ private int branchId;
+ private String branchName;
+ private String shortName;
+ private final int author;
+
+ public RemoteRenameBranchEvent(int branchId, int author, String branchName, String shortName) {
+ this.branchId = branchId;
+ this.author = author;
+ this.branchName = branchName;
+ this.shortName = shortName;
+ }
+
+ public int getTransactionId() {
+ return 0;
+ }
+
+ public int getBranchId() {
+ return branchId;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object o) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getAuthor()
+ */
+ public int getAuthor() {
+ return author;
+ }
+
+ /**
+ * @return the branchName
+ */
+ public String getBranchName() {
+ return branchName;
+ }
+
+ /**
+ * @param branchName the branchName to set
+ */
+ public void setBranchName(String branchName) {
+ this.branchName = branchName;
+ }
+
+ /**
+ * @return the shortName
+ */
+ public String getShortName() {
+ return shortName;
+ }
+
+ /**
+ * @param shortName the shortName to set
+ */
+ public void setShortName(String shortName) {
+ this.shortName = shortName;
+ }
+
+ /**
+ * @param branchId the branchId to set
+ */
+ public void setBranchId(int branchId) {
+ this.branchId = branchId;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/Sample.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/Sample.java
new file mode 100644
index 00000000000..a789cab3771
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/Sample.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * 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.skynet;
+
+import java.io.Serializable;
+import java.rmi.RemoteException;
+import java.util.Date;
+import org.eclipse.osee.framework.jini.discovery.IServiceLookupListener;
+import org.eclipse.osee.framework.jini.discovery.ServiceDataStore;
+import org.eclipse.osee.framework.jini.util.OseeJini;
+import net.jini.core.lookup.ServiceItem;
+
+public class Sample implements IServiceLookupListener, Serializable {
+ private static final long serialVersionUID = 8195127334711471268L;
+
+ private ISkynetEventService ses;
+ private ASkynetEventListener listener;
+
+ public Sample() {
+ super();
+
+ listener = new EventEchoer();
+
+ // TODO this may take a very long time ... like FOREVER ... perform timeout ~5s if it is an absolutely necessary service
+ // ServiceDataStore.getEclipseInstance(EclipseJiniClassloader.getInstance()).addListener(this, ISkynetEventService.class);
+ ServiceDataStore.getNonEclipseInstance().addListener(this, ISkynetEventService.class);
+
+ for (;;) {
+ try {
+ Thread.sleep(5000);
+ System.out.print(new Date() + ":");
+ if (ses == null) {
+ System.out.println("Service not connected");
+ } else {
+ System.out.println("kick");
+ try {
+ // ses.kick(new ISkynetEvent[]{new RemoteArtifactModifiedEvent(1, 2, 3, 4, "bob")}, listener);
+ } catch (Exception e) {
+ e.printStackTrace();
+ ses = null;
+ }
+ }
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+ }
+
+ public void serviceAdded(ServiceItem serviceItem) {
+ ses = (ISkynetEventService) serviceItem.service;
+ try {
+ ses.register((ISkynetEventListener) OseeJini.getRemoteReference(listener));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void serviceChanged(ServiceItem serviceItem) {
+ // like when the Entry[] changes
+ System.out.println("***Service changed");
+ serviceAdded(serviceItem);
+ }
+
+ public void serviceRemoved(ServiceItem serviceItem) {
+ // Ensure the lookup server didn't just lose contact
+ // try {
+ // ses.someStupidCallLikeGetId();
+ // } catch(RemoteException ex) {
+ ses = null;
+ // }
+
+ }
+
+ public static void main(String[] args) {
+ new Sample();
+ }
+
+ private class EventEchoer extends ASkynetEventListener {
+ private static final long serialVersionUID = 2251382843127874925L;
+
+ @Override
+ public void onEvent(ISkynetEvent[] events) throws RemoteException {
+ System.out.println("Events received at " + new Date());
+
+ for (ISkynetEvent event : events)
+ System.out.println("\t" + event);
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/SkynetEventPlugin.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/SkynetEventPlugin.java
new file mode 100644
index 00000000000..beb86505c74
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/SkynetEventPlugin.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.skynet;
+
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class SkynetEventPlugin extends OseeUiActivator {
+
+ private static SkynetEventPlugin pluginInstance; // The shared instance.
+ public static final String PLUGIN_ID = "org.eclipse.osee.framework.messaging.event.skynet";
+
+ public SkynetEventPlugin() {
+ super();
+ pluginInstance = this;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static SkynetEventPlugin getInstance() {
+ return pluginInstance;
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/ConfigurationModifiedEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/ConfigurationModifiedEvent.java
new file mode 100644
index 00000000000..784e8bb4862
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/ConfigurationModifiedEvent.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.skynet.event;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class ConfigurationModifiedEvent extends SkynetEventBase {
+ private static final long serialVersionUID = 4199206743701390599L;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param author TODO
+ */
+ public ConfigurationModifiedEvent(int branchId, int transactionId, int author) {
+ super(branchId, transactionId, author);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactDeletedEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactDeletedEvent.java
new file mode 100644
index 00000000000..2f6e8781ce7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactDeletedEvent.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class RemoteArtifactDeletedEvent extends SkynetArtifactEventBase {
+ private static final long serialVersionUID = 568951803773151575L;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param artId
+ * @param artTypeId
+ * @param author TODO
+ */
+ public RemoteArtifactDeletedEvent(int branchId, int transactionId, int artId, int artTypeId, String factoryName, int author) {
+ super(branchId, transactionId, artId, artTypeId, factoryName, author);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactModifiedEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactModifiedEvent.java
new file mode 100644
index 00000000000..1c76ad57600
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteArtifactModifiedEvent.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+import java.util.Collection;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class RemoteArtifactModifiedEvent extends SkynetArtifactEventBase {
+ private static final long serialVersionUID = -4325821466558180270L;
+ private Collection<SkynetAttributeChange> attributeValues;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param artId
+ * @param artTypeId
+ * @param author TODO
+ */
+ public RemoteArtifactModifiedEvent(int branchId, int transactionId, int artId, int artTypeId, String factoryName, Collection<SkynetAttributeChange> attributeValues, int author) {
+ super(branchId, transactionId, artId, artTypeId, factoryName, author);
+
+ this.attributeValues = attributeValues;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof RemoteArtifactModifiedEvent) {
+ return (getArtId() == (((RemoteArtifactModifiedEvent) obj).getArtId()));
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return getArtId();
+ }
+
+ /**
+ * @return Returns the serialVersionUID.
+ */
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+
+ /**
+ * @return Returns the attributeValues.
+ */
+ public Collection<SkynetAttributeChange> getAttributeChanges() {
+ return attributeValues;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteBroadcastEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteBroadcastEvent.java
new file mode 100644
index 00000000000..2b9b357a6d2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteBroadcastEvent.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class RemoteBroadcastEvent extends SkynetEventBase {
+
+ private static final long serialVersionUID = 4199206432501390599L;
+ private String message;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param author TODO
+ */
+ public RemoteBroadcastEvent(int branchId, int transactionId, String message, int author) {
+ super(branchId, transactionId, author);
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteNewRelationLinkEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteNewRelationLinkEvent.java
new file mode 100644
index 00000000000..63b0739b3e7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteNewRelationLinkEvent.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class RemoteNewRelationLinkEvent extends SkynetRelationLinkEventBase {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -519877422249674503L;
+
+ private String rationale;
+ private String aGuid;
+ private String aHumanId;
+ private String bHumanId;
+ private String bGuid;
+ private String descriptorName;
+ private int aOrder;
+ private int bOrder;
+ private int relTypeId;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param relId
+ * @param artAId
+ * @param artATypeId
+ * @param artBId
+ * @param artBTypeId
+ * @param author TODO
+ */
+ public RemoteNewRelationLinkEvent(int gammaId, int branchId, int transactionId, Integer relId, int artAId, int artATypeId, int artBId, int artBTypeId, String rationale, int aOrder, int bOrder, int relTypeId, String aFactoryName, String bFactoryName, String aGuid, String bGuid, String aHuamnId, String bHuamnId, String descriptorName, int author) {
+ super(gammaId, branchId, transactionId, relId, artAId, artATypeId, artBId, artBTypeId, aFactoryName,
+ bFactoryName, author);
+
+ this.rationale = rationale;
+ this.aOrder = aOrder;
+ this.bOrder = bOrder;
+ this.relTypeId = relTypeId;
+ this.aGuid = aGuid;
+ this.bGuid = bGuid;
+ this.aHumanId = aHuamnId;
+ this.bHumanId = bHuamnId;
+ this.descriptorName = descriptorName;
+ }
+
+ /**
+ * @return Returns the aOrder.
+ */
+ public int getAOrder() {
+ return aOrder;
+ }
+
+ /**
+ * @return Returns the bOrder.
+ */
+ public int getBOrder() {
+ return bOrder;
+ }
+
+ /**
+ * @return Returns the rationale.
+ */
+ public String getRationale() {
+ return rationale;
+ }
+
+ /**
+ * @return Returns the relTypeId.
+ */
+ public int getRelTypeId() {
+ return relTypeId;
+ }
+
+ /**
+ * @return Returns the aGuid.
+ */
+ public String getAGuid() {
+ return aGuid;
+ }
+
+ /**
+ * @return Returns the bGuid.
+ */
+ public String getBGuid() {
+ return bGuid;
+ }
+
+ /**
+ * @return Returns the aHuamnId.
+ */
+ public String getAHumanId() {
+ return aHumanId;
+ }
+
+ /**
+ * @return Returns the bHumanId.
+ */
+ public String getBHumanId() {
+ return bHumanId;
+ }
+
+ public String getDescriptorName() {
+ return descriptorName;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkDeletedEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkDeletedEvent.java
new file mode 100644
index 00000000000..f432c7dfede
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkDeletedEvent.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.skynet.event;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class RemoteRelationLinkDeletedEvent extends SkynetRelationLinkEventBase {
+ private static final long serialVersionUID = -1451567913757261791L;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param relId
+ * @param artAId
+ * @param artATypeId
+ * @param artBId
+ * @param artBTypeId
+ * @param author TODO
+ */
+ public RemoteRelationLinkDeletedEvent(int gammaId, int branchId, int transactionId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, String aFactoryName, String bFactoryName, int author) {
+ super(gammaId, branchId, transactionId, relId, artAId, artATypeId, artBId, artBTypeId, aFactoryName,
+ bFactoryName, author);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkModifiedEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkModifiedEvent.java
new file mode 100644
index 00000000000..214952e3a7d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/RemoteRelationLinkModifiedEvent.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class RemoteRelationLinkModifiedEvent extends SkynetRelationLinkEventBase {
+ private static final long serialVersionUID = 548299278567054333L;
+
+ private String rationale;
+ int aOrder;
+ int bOrder;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param relId
+ * @param artAId
+ * @param artATypeId
+ * @param artBId
+ * @param artBTypeId
+ * @param author TODO
+ */
+ public RemoteRelationLinkModifiedEvent(int gammaId, int branchId, int transactionId, int relId, int artAId, int artATypeId, int artBId, int artBTypeId, String rationale, int aOrder, int bOrder, String aFactoryName, String bFactoryName, int author) {
+ super(gammaId, branchId, transactionId, relId, artAId, artATypeId, artBId, artBTypeId, aFactoryName,
+ bFactoryName, author);
+
+ this.rationale = rationale;
+ this.aOrder = aOrder;
+ this.bOrder = bOrder;
+ }
+
+ /**
+ * @return Returns the aOrder.
+ */
+ public int getAOrder() {
+ return aOrder;
+ }
+
+ /**
+ * @return Returns the bOrder.
+ */
+ public int getBOrder() {
+ return bOrder;
+ }
+
+ /**
+ * @return Returns the rationale.
+ */
+ public String getRationale() {
+ return rationale;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof RemoteRelationLinkModifiedEvent) {
+ return (getRelId() == (((RemoteRelationLinkModifiedEvent) obj).getRelId()));
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return getRelId();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetArtifactEventBase.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetArtifactEventBase.java
new file mode 100644
index 00000000000..aba6b9b1283
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetArtifactEventBase.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.skynet.event;
+
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetArtifactEvent;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class SkynetArtifactEventBase extends SkynetEventBase implements ISkynetArtifactEvent {
+ private static final long serialVersionUID = 7923550763258313718L;
+
+ private final int artId;
+ private final int artTypeId;
+ private final String factoryName;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param artId
+ * @param artTypeId
+ * @param author TODO
+ */
+ public SkynetArtifactEventBase(int branchId, int transactionId, int artId, int artTypeId, String factoryName, int author) {
+ super(branchId, transactionId, author);
+
+ this.artId = artId;
+ this.artTypeId = artTypeId;
+ this.factoryName = factoryName;
+ }
+
+ /**
+ * @return Returns the artId.
+ */
+ public int getArtId() {
+ return artId;
+ }
+
+ /**
+ * @return Returns the artTypeId.
+ */
+ public int getArtTypeId() {
+ return artTypeId;
+ }
+
+ public String getFactoryName() {
+ return factoryName;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetAttributeChange.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetAttributeChange.java
new file mode 100644
index 00000000000..b1164b12cc6
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetAttributeChange.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class SkynetAttributeChange implements SkynetChange {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7269483275150734396L;
+ private final String name;
+ private final int attributeId;
+ private final int gammaId;
+ private final String value;
+
+ /**
+ * @param name
+ * @param value
+ */
+ public SkynetAttributeChange(String name, String value, int attributeId, int gammaId) {
+ super();
+ this.name = name;
+ this.value = value;
+ this.attributeId = attributeId;
+ this.gammaId = gammaId;
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return Returns the value.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public int getAttributeId() {
+ return attributeId;
+ }
+
+ /**
+ * @return Returns the gammaId.
+ */
+ public int getGammaId() {
+ return gammaId;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetChange.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetChange.java
new file mode 100644
index 00000000000..9491277abbe
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetChange.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+import java.io.Serializable;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public interface SkynetChange extends Serializable {
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetDisconnectClientsEvent.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetDisconnectClientsEvent.java
new file mode 100644
index 00000000000..eebae7cdd4b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetDisconnectClientsEvent.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.skynet.event;
+
+/**
+ * This message will be issued by the skynet event service to all clients in order to disconnect them from the network.
+ * This message should only be issued by administrators.
+ *
+ * @author Roberto E. Escobar
+ */
+public class SkynetDisconnectClientsEvent extends RemoteBroadcastEvent {
+
+ private static final long serialVersionUID = -3159755675253937318L;
+ private String[] userIds;
+
+ public SkynetDisconnectClientsEvent(String[] userIds, int branchId, int transactionId, String reason, int author) {
+ super(branchId, transactionId, reason, author);
+ this.userIds = userIds;
+ }
+
+ public String[] getUserIds() {
+ return userIds;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetEventBase.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetEventBase.java
new file mode 100644
index 00000000000..3f168ff5d99
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetEventBase.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class SkynetEventBase implements ISkynetEvent {
+ private static final long serialVersionUID = -5381855085551886510L;
+
+ private final int branchId;
+ private final int transactionId;
+ private final int author;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param author TODO
+ */
+ public SkynetEventBase(int branchId, int transactionId, int author) {
+ this.branchId = branchId;
+ this.transactionId = transactionId;
+ this.author = author;
+ }
+
+ /**
+ * @return Returns the branchId.
+ */
+ public int getBranchId() {
+ return branchId;
+ }
+
+ /**
+ * @return Returns the transactionId.
+ */
+ public int getTransactionId() {
+ return transactionId;
+ }
+
+ public int compareTo(Object o) {
+
+ if (o instanceof RemoteArtifactDeletedEvent) {
+ return 1;
+ } else if (o instanceof SkynetArtifactEventBase) {
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent#getAuthor()
+ */
+ public int getAuthor() {
+ return author;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetRelationLinkEventBase.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetRelationLinkEventBase.java
new file mode 100644
index 00000000000..79bc683a906
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/event/SkynetRelationLinkEventBase.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.skynet.event;
+
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetRelationLinkEvent;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class SkynetRelationLinkEventBase extends SkynetEventBase implements ISkynetRelationLinkEvent {
+ private static final long serialVersionUID = 154870900652138769L;
+
+ private final Integer relId;
+ private final int artAId;
+ private final int artATypeId;
+ private final int artBId;
+ private final int artBTypeId;
+ private final String aFactoryName;
+ private final String bFactoryName;
+ private int gammaId;
+
+ /**
+ * @param branchId
+ * @param transactionId
+ * @param relId
+ * @param artAId
+ * @param artATypeId
+ * @param artBId
+ * @param artBTypeId
+ * @param author TODO
+ */
+ public SkynetRelationLinkEventBase(int gammaId, int branchId, int transactionId, Integer relId, int artAId, int artATypeId, int artBId, int artBTypeId, String aFactoryName, String bFactoryName, int author) {
+ super(branchId, transactionId, author);
+ this.relId = relId;
+ this.artAId = artAId;
+ this.artATypeId = artATypeId;
+ this.artBId = artBId;
+ this.artBTypeId = artBTypeId;
+ this.aFactoryName = aFactoryName;
+ this.bFactoryName = bFactoryName;
+ this.gammaId = gammaId;
+ }
+
+ /**
+ * @return Returns the artAId.
+ */
+ public int getArtAId() {
+ return artAId;
+ }
+
+ /**
+ * @return Returns the artATypeId.
+ */
+ public int getArtATypeId() {
+ return artATypeId;
+ }
+
+ /**
+ * @return Returns the artBId.
+ */
+ public int getArtBId() {
+ return artBId;
+ }
+
+ /**
+ * @return Returns the artBTypeId.
+ */
+ public int getArtBTypeId() {
+ return artBTypeId;
+ }
+
+ /**
+ * @return Returns the relId.
+ */
+ public Integer getRelId() {
+ return relId;
+ }
+
+ /**
+ * @return Returns the aFactoryName.
+ */
+ public String getAFactoryName() {
+ return aFactoryName;
+ }
+
+ /**
+ * @return Returns the bFactoryName.
+ */
+ public String getBFactoryName() {
+ return bFactoryName;
+ }
+
+ public Integer getGammaId() {
+ return gammaId;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchArtTypeFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchArtTypeFilter.java
new file mode 100644
index 00000000000..bec4bb2b342
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchArtTypeFilter.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.skynet.filter;
+
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetArtifactEvent;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetRelationLinkEvent;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class BranchArtTypeFilter extends BranchFilter {
+ private static final long serialVersionUID = 1951625401943195730L;
+
+ private final int artTypeId;
+
+ /**
+ * @param branchId
+ */
+ public BranchArtTypeFilter(int branchId, int artTypeId) {
+ super(branchId);
+
+ this.artTypeId = artTypeId;
+ }
+
+ @Override
+ public boolean accepts(ISkynetEvent event) {
+ boolean accept = super.accepts(event);
+
+ // If the event has artifact type information, then include it
+ if (event instanceof ISkynetArtifactEvent) {
+ accept &= ((ISkynetArtifactEvent) event).getArtTypeId() == artTypeId;
+ } else if (event instanceof ISkynetRelationLinkEvent) {
+ ISkynetRelationLinkEvent relEvent = (ISkynetRelationLinkEvent) event;
+ accept &= relEvent.getArtATypeId() == artTypeId || relEvent.getArtBTypeId() == artTypeId;
+ }
+
+ return accept;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchFilter.java
new file mode 100644
index 00000000000..50caa4af19e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/BranchFilter.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.skynet.filter;
+
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;
+
+/**
+ * Filter Skynet events based on the branch they are associated with.
+ *
+ * @author Robert A. Fisher
+ */
+public class BranchFilter implements IEventFilter {
+ private static final long serialVersionUID = 6810368802224101971L;
+
+ private final int branchId;
+
+ /**
+ * @param branchId
+ */
+ public BranchFilter(int branchId) {
+ this.branchId = branchId;
+ }
+
+ public boolean accepts(ISkynetEvent event) {
+ return event.getBranchId() == branchId;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/IEventFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/IEventFilter.java
new file mode 100644
index 00000000000..015de98fca4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/filter/IEventFilter.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.skynet.filter;
+
+import java.io.Serializable;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;
+
+/**
+ * @author Robert A. Fisher
+ */
+public interface IEventFilter extends Serializable {
+
+ /**
+ * Determine if the event meets the requirement of this filter.
+ *
+ * @param event The event to inspect.
+ * @return boolean
+ */
+ public boolean accepts(ISkynetEvent event);
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventService.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventService.java
new file mode 100644
index 00000000000..e2ccb61e3ca
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventService.java
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * 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.skynet.service;
+
+import java.rmi.RemoteException;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.jini.core.entry.Entry;
+import net.jini.lookup.entry.Comment;
+import net.jini.lookup.entry.Name;
+import net.jini.lookup.entry.ServiceInfo;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jini.JiniClassServer;
+import org.eclipse.osee.framework.jini.service.core.JiniService;
+import org.eclipse.osee.framework.jini.service.core.SimpleFormattedEntry;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEventListener;
+import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEventService;
+import org.eclipse.osee.framework.messaging.event.skynet.SkynetEventPlugin;
+import org.eclipse.osee.framework.messaging.event.skynet.filter.IEventFilter;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.plugin.core.server.BundleResourceFinder;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+
+/**
+ * Skynet Event Service handles event distribution to provide network assisted cache consistency for Skynet.
+ *
+ * @author Robert A. Fisher
+ */
+public class SkynetEventService extends JiniService implements ISkynetEventService {
+ private static final Logger logger = ConfigUtil.getConfigFactory().getLogger(SkynetEventService.class);
+
+ private final HashCollection<IEventFilter, ISkynetEventListener> filteredListeners;
+ private final ReadWriteLock filteredListenersLock;
+ private final Collection<ISkynetEventListener> nonfilteredListeners;
+ private final ReadWriteLock nonfilteredListenersLock;
+ private static JiniClassServer jiniClassServer;
+
+ protected SkynetEventService(String dbConfig) {
+ this.filteredListeners = new HashCollection<IEventFilter, ISkynetEventListener>();
+ this.nonfilteredListeners = new LinkedList<ISkynetEventListener>();
+ this.filteredListenersLock = new ReentrantReadWriteLock();
+ this.nonfilteredListenersLock = new ReentrantReadWriteLock();
+ try {
+ registerWithJini(dbConfig);
+ } catch (Exception ex) {
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void registerWithJini(String dbConfig) throws Exception {
+ jiniClassServer = JiniClassServer.getInstance();
+ jiniClassServer.addResourceFinder(new BundleResourceFinder(new String[] {
+ "org.eclipse.osee.framework.messaging.event.skynet", "org.eclipse.osee.framework.jdk.core"}));
+
+ Dictionary dictionary = null;
+ String name = "Skynet Event Service";
+ String manufacturer = "Eclipse.org";
+ String vendor = "Eclipse.org";
+ String version = "0.0";
+ String model = "SES";
+ String serialNumber = "0.0";
+ String description = "Skynet Event Service - Skynet Cache Network Manager";
+
+ OseeUiActivator plugin = SkynetEventPlugin.getInstance();
+ if (plugin != null) {
+ dictionary = plugin.getBundle().getHeaders();
+ }
+
+ this.registerService(new Entry[] {new SimpleFormattedEntry("db", dbConfig),
+ new ServiceInfo(name, manufacturer, vendor, version, model, serialNumber), new Name(name),
+ new Comment(description)}, dictionary);
+
+ System.out.println("....................Skynet Event Service(" + dbConfig + ") is Alive....................");
+ this.stayAlive();
+ }
+
+ public void register(ISkynetEventListener listener, IEventFilter... filters) throws RemoteException {
+
+ if (listener == null) {
+ System.out.println("the listener is null");
+ return;
+ }
+
+ if (filters.length == 0) {
+ nonfilteredListenersLock.writeLock().lock();
+ try {
+ nonfilteredListeners.add(listener);
+ } finally {
+ nonfilteredListenersLock.writeLock().unlock();
+ }
+ } else {
+ filteredListenersLock.writeLock().lock();
+ try {
+ for (IEventFilter filter : filters) {
+ filteredListeners.put(filter, listener);
+ }
+ } finally {
+ filteredListenersLock.writeLock().unlock();
+ }
+ }
+ }
+
+ public void deregister(ISkynetEventListener listener, IEventFilter... filters) throws RemoteException {
+ if (filters.length == 0) {
+ nonfilteredListenersLock.writeLock().lock();
+ try {
+ nonfilteredListeners.remove(listener);
+ } finally {
+ nonfilteredListenersLock.writeLock().unlock();
+ }
+ } else {
+ filteredListenersLock.writeLock().lock();
+ try {
+ for (IEventFilter filter : filters) {
+ filteredListeners.removeValue(filter, listener);
+ }
+ } finally {
+ filteredListenersLock.writeLock().unlock();
+ }
+ }
+ }
+
+ // TODO thread pool this guy
+ public void kick(final ISkynetEvent[] events, final ISkynetEventListener... except) throws RemoteException {
+ Thread thread = new Thread("kicker") {
+
+ @Override
+ public void run() {
+ HashCollection<ISkynetEventListener, ISkynetEvent> eventSets =
+ new HashCollection<ISkynetEventListener, ISkynetEvent>(false, HashSet.class);
+ HashSet<ISkynetEventListener> exceptList =
+ new HashSet<ISkynetEventListener>((int) (except.length / .75f) + 1, .75f);
+ for (ISkynetEventListener listener : except)
+ exceptList.add(listener);
+
+ nonfilteredListenersLock.readLock().lock();
+ try {
+ // The non-filtered listeners will receive all events by definition
+ for (ISkynetEventListener listener : nonfilteredListeners)
+ for (ISkynetEvent event : events)
+ if (!exceptList.contains(listener)) eventSets.put(listener, event);
+ } finally {
+ nonfilteredListenersLock.readLock().unlock();
+ }
+
+ // Build sets according to the filters that the event matches
+
+ filteredListenersLock.readLock().lock();
+ try {
+ // Iterate all of the filters that have mappings to listeners
+ for (IEventFilter filter : filteredListeners.keySet())
+ // Check each event against a particular filter
+ for (ISkynetEvent event : events)
+ if (filter.accepts(event))
+ // When a filter accepts an event, the event to everyone listening for it
+ for (ISkynetEventListener listener : filteredListeners.getValues(filter))
+ if (!exceptList.contains(listener)) eventSets.put(listener, event);
+ } finally {
+ filteredListenersLock.readLock().unlock();
+ }
+
+ // Kick all of the listeners with their set of events
+ for (ISkynetEventListener listener : eventSets.keySet())
+ try {
+
+ if (listener != null) listener.onEvent(eventSets.getValues(listener).toArray(ISkynetEvent.EMPTY_ARRAY));
+
+ } catch (Exception ex) {
+
+ // TODO Remove from filteredListeners
+
+ nonfilteredListeners.remove(listener);
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ }
+ }
+
+ };
+
+ thread.setPriority(Thread.MAX_PRIORITY);
+ thread.start();
+ }
+
+ public static void main(String[] args) {
+ if (args.length != 2) throw new IllegalArgumentException(
+ "Must supply the db name for the service, such as \"dbinstance:schema\"");
+
+ new SkynetEventService(args[1]);
+ }
+
+ public void kill() throws RemoteException {
+ this.deregisterService();
+ this.commitSuicide();
+ }
+
+ public boolean isAlive() throws RemoteException {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventServicePlatformRunnable.java b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventServicePlatformRunnable.java
new file mode 100644
index 00000000000..cf763c99412
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.framework.messaging.event.skynet/src/org/eclipse/osee/framework/messaging/event/skynet/service/SkynetEventServicePlatformRunnable.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.skynet.service;
+
+import java.rmi.RemoteException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.osee.framework.jdk.core.util.CmdLineArgs;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.plugin.core.config.HeadlessEclipseConfigurationFactory;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class SkynetEventServicePlatformRunnable implements IApplication {
+
+ private static final Logger logger =
+ ConfigUtil.getConfigFactory().getLogger(SkynetEventServicePlatformRunnable.class);
+ private SkynetEventService skynetEventService;
+
+ public SkynetEventServicePlatformRunnable() {
+ super();
+ skynetEventService = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+ */
+ public Object start(IApplicationContext context) throws Exception {
+ System.setProperty(OseeProperties.OSEE_CONFIG_FACTORY, HeadlessEclipseConfigurationFactory.class.getName());
+
+ CmdLineArgs commandArgs = new CmdLineArgs(Platform.getApplicationArgs());
+
+ String database = commandArgs.get("-database");
+ skynetEventService = new SkynetEventService(database);
+ return EXIT_OK;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.equinox.app.IApplication#stop()
+ */
+ public void stop() {
+ try {
+ skynetEventService.kill();
+ } catch (RemoteException ex) {
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ }
+ }
+}

Back to the top