perfsonar-dev - perfsonar: r2273 - in branches/JAVA-RRD-MA-STABLE: doc/ma/rrdTypeMA src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Subject: perfsonar development work
List archive
perfsonar: r2273 - in branches/JAVA-RRD-MA-STABLE: doc/ma/rrdTypeMA src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2273 - in branches/JAVA-RRD-MA-STABLE: doc/ma/rrdTypeMA src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
- Date: Thu, 22 Mar 2007 10:11:28 -0400
Author: roman
Date: 2007-03-22 10:11:24 -0400 (Thu, 22 Mar 2007)
New Revision: 2273
Added:
branches/JAVA-RRD-MA-STABLE/doc/ma/rrdTypeMA/ChangeLog.txt
Modified:
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
Log:
merging
svn merge -r 2265:2271
https://svn.perfsonar.net/svn/perfsonar/trunk/perfsonar
Copied: branches/JAVA-RRD-MA-STABLE/doc/ma/rrdTypeMA/ChangeLog.txt (from rev
2271, trunk/perfsonar/doc/ma/rrdTypeMA/ChangeLog.txt)
Modified:
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
===================================================================
---
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2007-03-22 14:06:38 UTC (rev 2272)
+++
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2007-03-22 14:11:24 UTC (rev 2273)
@@ -98,11 +98,17 @@
String xQuery = "";
String ns = "\n"
- + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; \n"
+ + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/';
\n"
+ "declare namespace
nmwgtopo3='http://ggf.org/ns/nmwg/topology/base/3.0/'; \n"
- + "declare namespace
nmtl2='http://ggf.org/ns/nmwg/topology/l2/3.0/'; \n\n";
+ + "declare namespace
nmtl2='http://ggf.org/ns/nmwg/topology/l2/3.0/'; \n\n"
+ + "declare namespace functx = 'http://www.functx.com';
\n"
+ + "declare function functx:trim
\n"
+ + " ( $arg as xs:string? ) as xs:string {
\n"
+ + " replace(replace($arg,'\\s+$',''),'^\\s+','')
\n"
+ + "};
\n\n";
+
Subject subject = (Subject) metadata.getSubject();
// situation when only eventType is provided in the request
@@ -116,8 +122,8 @@
+ "
\n"
+ " let $linkMetadata :=
\n"
+ " for $k in //nmwg:metadata
\n"
- + " where
$k/nmwg:parameters/nmwg:parameter[(text()='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and @name='supportedEventType') \n"
- + " or
(@value='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
@name='supportedEventType')] \n"
+ + " where
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ "
\n"
+ " let $metaids :=
\n"
@@ -165,9 +171,9 @@
+ " let $linkMetadata :=
\n"
+ " if ($globalName != '') then
\n"
+ " for $m in //nmwg:metadata
\n"
- + " where
fn:lower-case($m/nmwg:subject/nmtl2:link/nmtl2:globalName) =
fn:lower-case($globalName) \n"
- + " and
$m/nmwg:parameters/nmwg:parameter[(text()='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and @name='supportedEventType') \n"
- + " or
(@value='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
@name='supportedEventType')] \n"
+ + " where
functx:trim(fn:lower-case($m/nmwg:subject/nmtl2:link/nmtl2:globalName)) =
functx:trim(fn:lower-case($globalName)) \n"
+ + " and
$m/nmwg:parameters/nmwg:parameter[(functx:trim(text())='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $m
\n"
+ " else
\n"
+ " ''
\n"
@@ -251,10 +257,10 @@
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
- + (node1Name != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node1Name + "') \n" : "")
- + (node1Country != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node1Country + "') \n" : "")
- + (node1City != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node1City + "') \n" : "")
- + (node1Institution != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node1Institution + "') \n" : "")
+ + (node1Name != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node1Name + "') \n" : "")
+ + (node1Country != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node1Country + "') \n" : "")
+ + (node1City != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node1City + "') \n" : "")
+ + (node1Institution != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + node1Institution + "') \n" : "")
+ " return $i
\n"
+ "
\n"
+ " let $node1_id :=
\n"
@@ -272,10 +278,10 @@
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\n"
- + (node2Name != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node2Name + "') \n" : "")
- + (node2Country != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node2Country + "') \n" : "")
- + (node2City != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node2City + "') \n" : "")
- + (node2Institution != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node2Institution + "') \n" : "")
+ + (node2Name != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node2Name + "') \n" : "")
+ + (node2Country != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node2Country + "') \n" : "")
+ + (node2City != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node2City + "') \n" : "")
+ + (node2Institution != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + node2Institution + "') \n" : "")
+ " return $j
\n"
+ "
\n"
+ " let $node2_id :=
\n"
@@ -295,8 +301,8 @@
+ " for $k in //nmwg:metadata
\n"
+ " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node1_id
\n"
+ " and
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node2_id
\n"
- + " and
$k/nmwg:parameters/nmwg:parameter[(text()='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and @name='supportedEventType') \n"
- + " or
(@value='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
@name='supportedEventType')] \n"
+ + " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ " else
\n"
+ " ''
\n"
@@ -345,15 +351,15 @@
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
- + (nodeName != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + nodeName + "') \n" : "")
- + (nodeCountry != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + nodeCountry + "') \n" : "")
- + (nodeCity != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + nodeCity + "') \n" : "")
- + (nodeInstitution != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + nodeInstitution + "') \n" : "")
+ + (nodeName != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + nodeName + "') \n" : "")
+ + (nodeCountry != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + nodeCountry + "') \n" : "")
+ + (nodeCity != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + nodeCity + "') \n" : "")
+ + (nodeInstitution != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + nodeInstitution + "') \n" : "")
+ " return $i
\n"
+ "
\n"
+ " let $node_id :=
\n"
+ " if ($node_metadata) then
\n"
- + "
fn:data($node_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ + "
fn:data($node_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
xQuery = "
\n "
@@ -364,8 +370,8 @@
+ " if ($node_id != '') then
\n"
+ " for $k in //nmwg:metadata
\n"
+ " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node_id
\n"
- + " and
$k/nmwg:parameters/nmwg:parameter[(text()='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and @name='supportedEventType') \n"
- + " or
(@value='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
@name='supportedEventType')] \n"
+ + " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status'
and functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='http://ggf.org/ns/nmwg/topology/l2/3.0/link/status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ " else
\n"
+ " ''
\n"
Modified:
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
===================================================================
---
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
2007-03-22 14:06:38 UTC (rev 2272)
+++
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
2007-03-22 14:11:24 UTC (rev 2273)
@@ -101,11 +101,17 @@
String xQuery = "";
String ns = "\n"
- + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; \n"
+ + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/';
\n"
+ "declare namespace
nmwgtopo3='http://ggf.org/ns/nmwg/topology/base/3.0/'; \n"
- + "declare namespace
nmtl2='http://ggf.org/ns/nmwg/topology/l2/3.0/'; \n\n";
+ + "declare namespace
nmtl2='http://ggf.org/ns/nmwg/topology/l2/3.0/'; \n\n"
+ + "declare namespace functx = 'http://www.functx.com';
\n"
+ + "declare function functx:trim
\n"
+ + " ( $arg as xs:string? ) as xs:string {
\n"
+ + " replace(replace($arg,'\\s+$',''),'^\\s+','')
\n"
+ + "};
\n\n";
+
Subject subject = (Subject) metadata.getSubject();
// situation when only eventType is provided in the request
@@ -119,8 +125,8 @@
+ "
\n"
+ " let $linkMetadata :=
\n"
+ " for $k in //nmwg:metadata
\n"
- + " where
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
- + " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ + " where
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='Path.Status' and
functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='Path.Status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ "
\n"
+ " let $metaids :=
\n"
@@ -168,9 +174,9 @@
+ " let $linkMetadata :=
\n"
+ " if ($globalName != '') then
\n"
+ " for $m in //nmwg:metadata
\n"
- + " where
fn:lower-case($m/nmwg:subject/nmtl2:link/nmtl2:globalName) =
fn:lower-case($globalName) \n"
- + " and
$m/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
- + " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ + " where
functx:trim(fn:lower-case($m/nmwg:subject/nmtl2:link/nmtl2:globalName)) =
functx:trim(fn:lower-case($globalName)) \n"
+ + " and
$m/nmwg:parameters/nmwg:parameter[(functx:trim(text())='Path.Status' and
functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='Path.Status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $m
\n"
+ " else
\n"
+ " ''
\n"
@@ -254,10 +260,10 @@
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
- + (node1Name != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node1Name + "') \n" : "")
- + (node1Country != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node1Country + "') \n" : "")
- + (node1City != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node1City + "') \n" : "")
- + (node1Institution != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node1Institution + "') \n" : "")
+ + (node1Name != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node1Name + "') \n" : "")
+ + (node1Country != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node1Country + "') \n" : "")
+ + (node1City != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node1City + "') \n" : "")
+ + (node1Institution != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + node1Institution + "') \n" : "")
+ " return $i
\n"
+ "
\n"
+ " let $node1_id :=
\n"
@@ -275,10 +281,10 @@
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\n"
- + (node2Name != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node2Name + "') \n" : "")
- + (node2Country != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node2Country + "') \n" : "")
- + (node2City != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node2City + "') \n" : "")
- + (node2Institution != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node2Institution + "') \n" : "")
+ + (node2Name != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node2Name + "') \n" : "")
+ + (node2Country != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node2Country + "') \n" : "")
+ + (node2City != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node2City + "') \n" : "")
+ + (node2Institution != "" ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + node2Institution + "') \n" : "")
+ " return $j
\n"
+ "
\n"
+ " let $node2_id :=
\n"
@@ -298,8 +304,8 @@
+ " for $k in //nmwg:metadata
\n"
+ " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node1_id
\n"
+ " and
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node2_id
\n"
- + " and
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
- + " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ + " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='Path.Status' and
functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='Path.Status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ " else
\n"
+ " ''
\n"
@@ -348,10 +354,10 @@
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
- + (nodeName != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + nodeName + "') \n" : "")
- + (nodeCountry != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + nodeCountry + "') \n" : "")
- + (nodeCity != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + nodeCity + "') \n" : "")
- + (nodeInstitution != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + nodeInstitution + "') \n" : "")
+ + (nodeName != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + nodeName + "') \n" : "")
+ + (nodeCountry != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + nodeCountry + "') \n" : "")
+ + (nodeCity != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + nodeCity + "') \n" : "")
+ + (nodeInstitution != "" ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution))
= fn:lower-case('" + nodeInstitution + "') \n" : "")
+ " return $i
\n"
+ "
\n"
+ " let $node_id :=
\n"
@@ -367,8 +373,8 @@
+ " if ($node_id != '') then
\n"
+ " for $k in //nmwg:metadata
\n"
+ " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node_id
\n"
- + " and
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
- + " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ + " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='Path.Status' and
functx:trim(@name)='supportedEventType') \n"
+ + " or
(functx:trim(@value)='Path.Status' and
functx:trim(@name)='supportedEventType')] \n"
+ " return $k
\n"
+ " else
\n"
+ " ''
\n"
Modified:
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
===================================================================
---
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-03-22 14:06:38 UTC (rev 2272)
+++
branches/JAVA-RRD-MA-STABLE/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-03-22 14:11:24 UTC (rev 2273)
@@ -127,10 +127,17 @@
}
String xQuery = "\n"
- + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/'; "
- + "declare namespace
netutil='http://ggf.org/ns/nmwg/characteristic/utilization/2.0/'; "
- + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
+ + "declare namespace nmwg='http://ggf.org/ns/nmwg/base/2.0/';
\n"
+ + "declare namespace
netutil='http://ggf.org/ns/nmwg/characteristic/utilization/2.0/';\n"
+ + "declare namespace
nmwgt='http://ggf.org/ns/nmwg/topology/2.0/'; \n\n";
+ xQuery +=
+ "declare namespace functx = 'http://www.functx.com';\n"
+ + "declare function functx:trim \n"
+ + " ( $arg as xs:string? ) as xs:string { \n"
+ + " replace(replace($arg,'\\s+$',''),'^\\s+','') \n"
+ + "}; \n\n";
+
xQuery +=
" let $res := \n"
+ " for $i in //nmwg:metadata \n"
@@ -138,59 +145,59 @@
if (eventType != "")
- xQuery += "and $i/nmwg:parameters/nmwg:parameter[(text()='" +
eventType + "' and @name='supportedEventType') "
- + "or (@value='" + eventType + "' and
@name='supportedEventType')]";
+ xQuery += "and
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='" + eventType + "'
and functx:trim(@name)='supportedEventType') "
+ + "or (functx:trim(@value)='" + eventType + "' and
functx:trim(@name)='supportedEventType')]";
if (ipAddress != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ipAddress[text()='" + ipAddress +
"']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ipAddress[functx:trim(text())='" +
ipAddress + "']";
if (hostName != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:hostName[text()='" + hostName + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:hostName[functx:trim(text())='" +
hostName + "']";
if (ifName != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifName[text()='" + ifName + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifName[functx:trim(text())='" +
ifName + "']";
if (ifDescription != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifDescription[text()='" +
ifDescription + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifDescription[functx:trim(text())='"
+ ifDescription + "']";
if (ifAddress != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifAddress[text()='" + ifAddress +
"']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "']";
if (ifIndex != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifIndex[text()='" + ifIndex + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifIndex[functx:trim(text())='" +
ifIndex + "']";
if (type != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:type[text()='" + type + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:type[functx:trim(text())='" + type +
"']";
if (direction != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:direction[text()='" + direction +
"']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "']";
if (authRealm != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:authRealm[text()='" + authRealm +
"']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:authRealm[functx:trim(text())='" +
authRealm + "']";
if (classOfService != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:classOfService[text()='" +
classOfService + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:classOfService[functx:trim(text())='"
+ classOfService + "']";
if (capacity != "")
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:capacity[text()='" + capacity + "']";
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:capacity[functx:trim(text())='" +
capacity + "']";
xQuery += "\n"
- + " return $i \n"
- + " \n"
- + " let $metaids := \n"
- + " for $j in $res \n"
- + " return fn:data($j/@id) \n"
- + " \n"
- + " let $datas := \n"
- + " for $k in $metaids \n"
- + " let $d := \n"
- + " for $l in //nmwg:data \n"
- + " where fn:data($l/@metadataIdRef) = $k \n"
- + " return $l \n"
- + " return $d \n"
- + " \n"
- + " return ($res, $datas) \n";
+ + " return $i
\n"
+ + "
\n"
+ + " let $metaids :=
\n"
+ + " for $j in $res
\n"
+ + " return fn:data($j/@id)
\n"
+ + "
\n"
+ + " let $datas :=
\n"
+ + " for $k in $metaids
\n"
+ + " let $d :=
\n"
+ + " for $l in //nmwg:data
\n"
+ + " where fn:data($l/@metadataIdRef) = $k
\n"
+ + " return $l
\n"
+ + " return $d
\n"
+ + "
\n"
+ + " return ($res, $datas)
\n";
//logger.debug(
- perfsonar: r2273 - in branches/JAVA-RRD-MA-STABLE: doc/ma/rrdTypeMA src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator, svnlog, 03/22/2007
Archive powered by MHonArc 2.6.16.