Skip to Content.
Sympa Menu

perfsonar-dev - r2022 - in trunk/functional-testing/sqlma: common l2/SetupDataRequest

Subject: perfsonar development work

List archive

r2022 - in trunk/functional-testing/sqlma: common l2/SetupDataRequest


Chronological Thread 
  • From:
  • To:
  • Subject: r2022 - in trunk/functional-testing/sqlma: common l2/SetupDataRequest
  • Date: Thu, 1 Feb 2007 09:41:32 -0500

Author: michalis
Date: 2007-02-01 09:41:28 -0500 (Thu, 01 Feb 2007)
New Revision: 2022

Added:
trunk/functional-testing/sqlma/l2/SetupDataRequest/SetupDataRequests.java
Modified:
trunk/functional-testing/sqlma/common/SQLMAFunctionalTestsUtilities.java
Log:
Some additions for the Setup Data request

Modified:
trunk/functional-testing/sqlma/common/SQLMAFunctionalTestsUtilities.java
===================================================================
--- trunk/functional-testing/sqlma/common/SQLMAFunctionalTestsUtilities.java
2007-02-01 14:19:49 UTC (rev 2021)
+++ trunk/functional-testing/sqlma/common/SQLMAFunctionalTestsUtilities.java
2007-02-01 14:41:28 UTC (rev 2022)
@@ -1,5 +1,6 @@
package sqlma.common;

+import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
@@ -74,6 +75,28 @@

}

+ /**
+ * Constructor of the class
+ */
+ public SQLMAFunctionalTestsUtilities() {
+
+ nmwg = Namespace.getNamespace("nmwg",
+ "http://ggf.org/ns/nmwg/base/2.0/";);
+
+ nmtl2 = Namespace.getNamespace("nmtl2",
+ "http://ggf.org/ns/nmwg/topology/l2/3.0/";);
+
+ nmwgtopo3 = Namespace.getNamespace("nmwgtopo3",
+ "http://ggf.org/ns/nmwg/topology/base/3.0/";);
+
+ select = Namespace.getNamespace("select",
+ "http://ggf.org/ns/nmwg/ops/select/2.0/";);
+
+ ifevt = Namespace.getNamespace("ifevt",
+
"http://ggf.org/ns/nmwg/event/status/base/2.0/";);
+
+ }
+
//
-----------------------------------------------------------------------
// public methods

@@ -103,6 +126,112 @@
}

/**
+ * Method for creating metadata elements containing a key
+ * @param pathId
+ * The pathId of the link
+ * @param ibatis
+ * The ibatis config file
+ * @param eventType
+ * the event Type
+ * @return
+ * A hashtable containing the key elements
+ */
+ public Hashtable createKeyElements(String pathId, String ibatis,
+ String eventType) {
+ Hashtable keyElements = new Hashtable();
+
+ Element path = new Element("parameter", nmwg);
+ path.setAttribute("name", "pathId");
+ path.setText(pathId);
+ keyElements.put("pathId", path);
+
+ Element ibatisConfig = new Element("parameter", nmwg);
+ ibatisConfig.setAttribute("name", "ibatisConfig");
+ ibatisConfig.setText(ibatis);
+ keyElements.put("ibatis", ibatisConfig);
+
+ Element event = new Element("parameter", nmwg);
+ event.setAttribute("name", "eventType");
+ event.setText(eventType);
+ keyElements.put("eventType", event);
+
+ return keyElements;
+
+ }
+
+ /**
+ * Method for creating metadata elements containing a key
+ * @param pathId
+ * The pathId of the link
+ * @param ibatis
+ * The ibatis config file
+ * @param eventType
+ * the event Type
+ * @param timeSettings
+ * A string array containing the time settings
+ * @return
+ */
+
+ public Hashtable createKeyElements(String pathId, String ibatis,
+ String eventType, String[] timeSettings) {
+ Hashtable keyElements = new Hashtable();
+
+ if (timeSettings.length < 3) {
+ Element path = new Element("parameter", nmwg);
+ path.setAttribute("name", "pathId");
+ path.setText(pathId);
+ keyElements.put("pathId", path);
+
+ Element ibatisConfig = new Element("parameter", nmwg);
+ ibatisConfig.setAttribute("name", "ibatisConfig");
+ ibatisConfig.setText(ibatis);
+ keyElements.put("ibatis", ibatisConfig);
+
+ Element event = new Element("parameter", nmwg);
+ event.setAttribute("name", "eventType");
+ event.setText(eventType);
+ keyElements.put("eventType", event);
+
+ Element time = new Element("parameter", nmwg);
+ time.setAttribute("name", timeSettings[0]);
+ time.setText(timeSettings[1]);
+ keyElements.put("time", time);
+
+
+ } else if (timeSettings.length >= 4) {
+
+ Element path = new Element("parameter", nmwg);
+ path.setAttribute("name", "pathId");
+ path.setText(pathId);
+ keyElements.put("pathId", path);
+
+ Element ibatisConfig = new Element("parameter", nmwg);
+ ibatisConfig.setAttribute("name", "ibatisConfig");
+ ibatisConfig.setText(ibatis);
+ keyElements.put("ibatis", ibatisConfig);
+
+ Element event = new Element("parameter", nmwg);
+ event.setAttribute("name", "eventType");
+ event.setText(eventType);
+ keyElements.put("eventType", event);
+
+ Element startTime = new Element("parameter", nmwg);
+ startTime.setAttribute("name", timeSettings[0]);
+ startTime.setText(timeSettings[1]);
+ keyElements.put("startTime", startTime);
+
+ Element endTime = new Element("parameter", nmwg);
+ endTime.setAttribute("name", timeSettings[2]);
+ endTime.setText(timeSettings[3]);
+ keyElements.put("endTime", endTime);
+
+ }
+
+ return keyElements;
+
+ }
+
+ /**
* Method for creating the metadata elements when a link is going to
be
* given as an input to the SQL MA
*
@@ -149,6 +278,28 @@
}

/**
+ * @param id
+ * @param elements
+ * @return
+ */
+ public Element createKeyMetadata(String id, Hashtable elements) {
+ Element metadata = new Element("metadata", nmwg);
+ metadata.setAttribute("id", id);
+ Element key = new Element("key", nmwg);
+ Element parameters = new Element("parameters", nmwg);
+ Enumeration en = elements.elements();
+ while (en.hasMoreElements()) {
+ parameters.addContent((Element) en.nextElement());
+ }
+
+ key.addContent(parameters);
+ metadata.addContent(key);
+
+ return metadata;
+
+ }
+
+ /**
* Method for creating metadata elements in the case where a node set
is
* going to be given as input to the SQL MA
*

Added:
trunk/functional-testing/sqlma/l2/SetupDataRequest/SetupDataRequests.java


Property changes on:
trunk/functional-testing/sqlma/l2/SetupDataRequest/SetupDataRequests.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native



  • r2022 - in trunk/functional-testing/sqlma: common l2/SetupDataRequest, svnlog, 02/01/2007

Archive powered by MHonArc 2.6.16.

Top of Page