[savara-commits] savara SVN: r597 - in branches/experimental/2.0.x/bundles: org.savara.activity/schema and 12 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 19 16:23:23 EST 2011


Author: objectiser
Date: 2011-01-19 16:23:21 -0500 (Wed, 19 Jan 2011)
New Revision: 597

Added:
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityAnalyser.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManager.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManagerFactory.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidator.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/DefaultActivityValidationManager.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/validation/
   branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/validation/DefaultActivityValidationManagerTest.java
Modified:
   branches/experimental/2.0.x/bundles/org.savara.activity/.classpath
   branches/experimental/2.0.x/bundles/org.savara.activity/schema/Activity.xsd
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Activity.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Analysis.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/EndpointActivity.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Error.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceFinished.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceStarted.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/LifecycleActivity.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageActivity.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageReceived.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageSent.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ObjectFactory.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ProtocolAnalysis.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/package-info.java
   branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.monitor.sstore.rdbms/
Log:
Updates to activity model and addition of activity validation framework.

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/.classpath	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/.classpath	2011-01-19 21:23:21 UTC (rev 597)
@@ -1,11 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
-  <classpathentry kind="src" path="/org.savara.common"/>
-  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT-sources.jar"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-</classpath>
\ No newline at end of file
+	<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+	<classpathentry kind="src" path="/org.savara.common"/>
+	<classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/schema/Activity.xsd
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/schema/Activity.xsd	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/schema/Activity.xsd	2011-01-19 21:23:21 UTC (rev 597)
@@ -3,10 +3,13 @@
 
     <complexType name="Activity" abstract="true">
     	<sequence>
-    		<element name="analysis" type="tns:Analysis" minOccurs="0" maxOccurs="unbounded"></element>
+    		<element name="analysis" type="tns:Analysis" minOccurs="0"
+    			maxOccurs="unbounded">
+    		</element>
     	</sequence>
     	<attribute name="componentName" type="string"></attribute>
-    	<attribute name="instanceId" type="string"></attribute>
+    	<attribute name="componentInstanceId" type="string"></attribute>
+    	<attribute name="conversationInstanceId" type="string"></attribute>
     	<attribute name="timestamp" type="dateTime"></attribute>
     </complexType>
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Activity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Activity.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Activity.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 
@@ -32,7 +32,8 @@
  *         &lt;element name="analysis" type="{http://www.savara.org/activity}Analysis" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
  *       &lt;attribute name="componentName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="instanceId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="componentInstanceId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="conversationInstanceId" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;attribute name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
  *     &lt;/restriction>
  *   &lt;/complexContent>
@@ -55,8 +56,10 @@
     protected List<Analysis> analysis;
     @XmlAttribute(name = "componentName")
     protected String componentName;
-    @XmlAttribute(name = "instanceId")
-    protected String instanceId;
+    @XmlAttribute(name = "componentInstanceId")
+    protected String componentInstanceId;
+    @XmlAttribute(name = "conversationInstanceId")
+    protected String conversationInstanceId;
     @XmlAttribute(name = "timestamp")
     @XmlSchemaType(name = "dateTime")
     protected XMLGregorianCalendar timestamp;
@@ -115,30 +118,54 @@
     }
 
     /**
-     * Gets the value of the instanceId property.
+     * Gets the value of the componentInstanceId property.
      * 
      * @return
      *     possible object is
      *     {@link String }
      *     
      */
-    public String getInstanceId() {
-        return instanceId;
+    public String getComponentInstanceId() {
+        return componentInstanceId;
     }
 
     /**
-     * Sets the value of the instanceId property.
+     * Sets the value of the componentInstanceId property.
      * 
      * @param value
      *     allowed object is
      *     {@link String }
      *     
      */
-    public void setInstanceId(String value) {
-        this.instanceId = value;
+    public void setComponentInstanceId(String value) {
+        this.componentInstanceId = value;
     }
 
     /**
+     * Gets the value of the conversationInstanceId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getConversationInstanceId() {
+        return conversationInstanceId;
+    }
+
+    /**
+     * Sets the value of the conversationInstanceId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setConversationInstanceId(String value) {
+        this.conversationInstanceId = value;
+    }
+
+    /**
      * Gets the value of the timestamp property.
      * 
      * @return

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Analysis.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Analysis.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Analysis.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/EndpointActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/EndpointActivity.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/EndpointActivity.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Error.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Error.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/Error.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceFinished.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceFinished.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceFinished.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceStarted.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceStarted.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/InstanceStarted.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/LifecycleActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/LifecycleActivity.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/LifecycleActivity.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageActivity.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageActivity.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageActivity.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageReceived.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageReceived.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageReceived.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageSent.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageSent.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/MessageSent.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ObjectFactory.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ObjectFactory.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ObjectFactory.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 
@@ -37,6 +37,14 @@
     }
 
     /**
+     * Create an instance of {@link MessageReceived }
+     * 
+     */
+    public MessageReceived createMessageReceived() {
+        return new MessageReceived();
+    }
+
+    /**
      * Create an instance of {@link EndpointActivity }
      * 
      */
@@ -45,11 +53,11 @@
     }
 
     /**
-     * Create an instance of {@link MessageSent }
+     * Create an instance of {@link InstanceFinished }
      * 
      */
-    public MessageSent createMessageSent() {
-        return new MessageSent();
+    public InstanceFinished createInstanceFinished() {
+        return new InstanceFinished();
     }
 
     /**
@@ -61,22 +69,14 @@
     }
 
     /**
-     * Create an instance of {@link MessageReceived }
+     * Create an instance of {@link MessageSent }
      * 
      */
-    public MessageReceived createMessageReceived() {
-        return new MessageReceived();
+    public MessageSent createMessageSent() {
+        return new MessageSent();
     }
 
     /**
-     * Create an instance of {@link InstanceFinished }
-     * 
-     */
-    public InstanceFinished createInstanceFinished() {
-        return new InstanceFinished();
-    }
-
-    /**
      * Create an instance of {@link Error }
      * 
      */

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ProtocolAnalysis.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ProtocolAnalysis.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/ProtocolAnalysis.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/package-info.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/package-info.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/model/package-info.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -2,7 +2,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-146 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.01.18 at 05:58:36 PM GMT 
+// Generated on: 2011.01.19 at 06:07:44 PM GMT 
 //
 
 @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.savara.org/activity", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

Modified: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/osgi/Activator.java	2011-01-19 10:12:28 UTC (rev 596)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/osgi/Activator.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -1,12 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
 package org.savara.activity.osgi;
 
+import java.util.Properties;
+import java.util.logging.Logger;
+
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.savara.activity.validation.ActivityAnalyser;
+import org.savara.activity.validation.ActivityValidationManager;
+import org.savara.activity.validation.ActivityValidationManagerFactory;
+import org.savara.activity.validation.ActivityValidator;
 
 public class Activator implements BundleActivator {
 
 	private static BundleContext context;
 
+	private org.osgi.util.tracker.ServiceTracker m_activityAnalyserTracker=null;
+	private org.osgi.util.tracker.ServiceTracker m_activityValidatorTracker=null;
+
+	private static final Logger _log=Logger.getLogger(Activator.class.getName());
+
 	static BundleContext getContext() {
 		return context;
 	}
@@ -17,6 +48,48 @@
 	 */
 	public void start(BundleContext bundleContext) throws Exception {
 		Activator.context = bundleContext;
+
+        Properties props = new Properties();
+
+        // Register activity validation manager
+        final ActivityValidationManager avm=ActivityValidationManagerFactory.getActivityValidationManager();
+        
+        context.registerService(ActivityValidationManager.class.getName(), 
+        					avm, props);
+        
+        _log.fine("Registered Activity Validation Manager");
+        
+        m_activityValidatorTracker = new ServiceTracker(context,
+        					ActivityValidator.class.getName(), null) {
+        	
+			public Object addingService(ServiceReference ref) {
+				Object ret=super.addingService(ref);
+				
+				_log.fine("Activity validator has been added: "+ret);
+				
+				avm.addActivityValidator((ActivityValidator)ret);
+				
+				return(ret);
+			}
+        };
+        
+        m_activityValidatorTracker.open();
+        
+        m_activityAnalyserTracker = new ServiceTracker(context,
+							ActivityAnalyser.class.getName(), null) {
+
+			public Object addingService(ServiceReference ref) {
+				Object ret=super.addingService(ref);
+				
+				_log.fine("Activity analyser has been added: "+ret);
+				
+				avm.addActivityAnalyser((ActivityAnalyser)ret);
+				
+				return(ret);
+			}
+		};
+
+		m_activityAnalyserTracker.open();
 	}
 
 	/*

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityAnalyser.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityAnalyser.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityAnalyser.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+import org.savara.activity.model.Activity;
+
+/**
+ * This interface is used to provide activity analysis capabilities.
+ *
+ */
+public interface ActivityAnalyser {
+	
+	/**
+	 * This method analyses the supplied activity.
+	 * 
+	 * @param activity The activity to be analysed
+	 */
+	public void analyse(Activity activity);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManager.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManager.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManager.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+import org.savara.activity.model.Activity;
+
+/**
+ * This interface represents the activity validation manager
+ * responsible for managing a set of analysers and validators,
+ * and applying a supplied activity against them. The analysers
+ * are applied prior to the validators, to derived additional
+ * information that may be required during validation.
+ */
+public interface ActivityValidationManager {
+
+	/**
+	 * This method adds a new activity validator.
+	 * 
+	 * @param validator The validator
+	 */
+	public void addActivityValidator(ActivityValidator validator);
+	
+	/**
+	 * This method removes an existing activity validator.
+	 * 
+	 * @param validator The validator
+	 */
+	public void removeActivityValidator(ActivityValidator validator);
+	
+	/**
+	 * This method adds a new activity analyser.
+	 * 
+	 * @param analyser The analyser
+	 */
+	public void addActivityAnalyser(ActivityAnalyser analyser);
+	
+	/**
+	 * This method removes an existing activity analyser.
+	 * 
+	 * @param analyser The analyser
+	 */
+	public void removeActivityAnalyser(ActivityAnalyser analyser);
+	
+	/**
+	 * This method processes the supplied activity event against
+	 * any predefined analysers and validators.
+	 * 
+	 * @param activity The activity event to be processed
+	 */
+	public void process(Activity activity);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManagerFactory.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManagerFactory.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidationManagerFactory.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+/**
+ * This class provides a factory for the ActivityValidationManager
+ * component.
+ *
+ */
+public class ActivityValidationManagerFactory {
+
+	private static ActivityValidationManager m_instance=
+					new DefaultActivityValidationManager();
+	
+	/**
+	 * This method returns the activity validation manager.
+	 * 
+	 * @return The activity validation manager
+	 */
+	public static ActivityValidationManager getActivityValidationManager() {
+		return(m_instance);
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidator.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/ActivityValidator.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+import org.savara.activity.model.Activity;
+
+/**
+ * This interface is used to provide activity validation capabilities.
+ *
+ */
+public interface ActivityValidator {
+	
+	/**
+	 * This method validates the supplied activity.
+	 * 
+	 * @param activity The activity to be validated
+	 */
+	public void validate(Activity activity);
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/DefaultActivityValidationManager.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/DefaultActivityValidationManager.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/main/java/org/savara/activity/validation/DefaultActivityValidationManager.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+import org.savara.activity.model.Activity;
+
+/**
+ * This class implements a default activity validation manager
+ * responsible for managing a set of analysers and validators,
+ * and applying a supplied activity against them. The analysers
+ * are applied prior to the validators, to derived additional
+ * information that may be required during validation.
+ */
+public class DefaultActivityValidationManager implements ActivityValidationManager {
+
+	private java.util.List<ActivityValidator> m_validators=new java.util.Vector<ActivityValidator>();
+	private java.util.List<ActivityAnalyser> m_analysers=new java.util.Vector<ActivityAnalyser>();
+	
+	protected java.util.List<ActivityAnalyser> getAnalysers() {
+		return(m_analysers);
+	}
+	
+	protected java.util.List<ActivityValidator> getValidators() {
+		return(m_validators);
+	}
+	
+	/**
+	 * This method adds a new activity validator.
+	 * 
+	 * @param validator The validator
+	 */
+	public void addActivityValidator(ActivityValidator validator) {
+		m_validators.add(validator);
+	}
+	
+	/**
+	 * This method removes an existing activity validator.
+	 * 
+	 * @param validator The validator
+	 */
+	public void removeActivityValidator(ActivityValidator validator) {
+		m_validators.remove(validator);
+	}
+	
+	/**
+	 * This method adds a new activity analyser.
+	 * 
+	 * @param analyser The analyser
+	 */
+	public void addActivityAnalyser(ActivityAnalyser analyser) {
+		m_analysers.add(analyser);
+	}
+	
+	/**
+	 * This method removes an existing activity analyser.
+	 * 
+	 * @param analyser The analyser
+	 */
+	public void removeActivityAnalyser(ActivityAnalyser analyser) {
+		m_analysers.remove(analyser);
+	}
+	
+	/**
+	 * This method processes the supplied activity event against
+	 * any predefined analysers and validators.
+	 * 
+	 * @param activity The activity event to be processed
+	 */
+	public void process(Activity activity) {
+		for (ActivityAnalyser aa : m_analysers) {
+			aa.analyse(activity);
+		}
+		for (ActivityValidator av : m_validators) {
+			av.validate(activity);
+		}
+	}
+	
+}

Added: branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/validation/DefaultActivityValidationManagerTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/validation/DefaultActivityValidationManagerTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.activity/src/test/java/org/savara/activity/validation/DefaultActivityValidationManagerTest.java	2011-01-19 21:23:21 UTC (rev 597)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.activity.validation;
+
+import org.junit.Test;
+import org.savara.activity.model.Activity;
+import org.savara.activity.model.MessageSent;
+
+import static org.junit.Assert.*;
+
+public class DefaultActivityValidationManagerTest {
+
+	@Test
+	public void testAddRemoveAnalyser() {
+		DefaultActivityValidationManager avm=new DefaultActivityValidationManager();
+		
+		TestAnalyser ta=new TestAnalyser();		
+		avm.addActivityAnalyser(ta);
+		
+		if (avm.getAnalysers().contains(ta) == false) {
+			fail("Analyser not found");
+		}
+		
+		avm.removeActivityAnalyser(ta);
+		
+		if (avm.getAnalysers().contains(ta) == true) {
+			fail("Analyser not removed");
+		}
+	}
+		
+	@Test
+	public void testAddRemoveValidator() {
+		DefaultActivityValidationManager avm=new DefaultActivityValidationManager();
+		
+		TestValidator tv=new TestValidator();		
+		avm.addActivityValidator(tv);
+		
+		if (avm.getValidators().contains(tv) == false) {
+			fail("Validator not found");
+		}
+		
+		avm.removeActivityValidator(tv);
+		
+		if (avm.getValidators().contains(tv) == true) {
+			fail("Validator not removed");
+		}
+	}
+		
+	@Test
+	public void testAnalysisBeforeValidate() {
+		ActivityValidationManager avm=new DefaultActivityValidationManager();
+		
+		TestOrderAnalyserValidator tav=new TestOrderAnalyserValidator();
+		
+		avm.addActivityAnalyser(tav);
+		avm.addActivityValidator(tav);
+		
+		Activity act=new MessageSent();
+		
+		avm.process(act);
+	}
+	
+	public class TestAnalyser implements ActivityAnalyser {
+
+		private Activity m_activity=null;
+		
+		public Activity getActivity() {
+			return(m_activity);
+		}
+		
+		public void analyse(Activity activity) {
+			m_activity = activity;
+		}
+		
+	}
+
+	public class TestValidator implements ActivityValidator {
+
+		private Activity m_activity=null;
+		
+		public Activity getActivity() {
+			return(m_activity);
+		}
+		
+		public void validate(Activity activity) {
+			m_activity = activity;
+		}
+	}
+
+	public class TestOrderAnalyserValidator implements ActivityAnalyser, ActivityValidator {
+
+		private Activity m_activity=null;
+		
+		public void validate(Activity activity) {
+			if (m_activity != activity) {
+				// Should be activity that was analysed
+				fail("Activity did not match");
+			}
+		}
+
+		public void analyse(Activity activity) {
+			if (m_activity != null) {
+				fail("Activity should not be set");
+			}
+			m_activity = activity;
+		}
+		
+	}
+}


Property changes on: branches/experimental/2.0.x/bundles/org.savara.monitor.sstore.rdbms
___________________________________________________________________
Name: svn:ignore
   + bin
target




More information about the savara-commits mailing list