Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3981 - trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator

Subject: perfsonar development work

List archive

perfsonar: r3981 - trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3981 - trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
  • Date: Tue, 10 Jun 2008 07:28:43 -0400

Author: roman
Date: 2008-06-10 07:28:43 -0400 (Tue, 10 Jun 2008)
New Revision: 3981

Modified:

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
Log:

support of the parameter keyword in metadata queries



Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2008-06-10 11:26:53 UTC (rev 3980)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2008-06-10 11:28:43 UTC (rev 3981)
@@ -7,6 +7,7 @@

import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.Parameter;
import org.ggf.ns.nmwg.characteristic.discards.v2_0.Subject;
import org.ggf.ns.nmwg.topology.v2_0.Interface;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
@@ -74,6 +75,9 @@
// + "start getMetadataQuery");

String eventType = null;
+ String keyword = null;
+ String keywordType = null;
+
String ipAddress = null;
String hostName = null;
String ifName = null;
@@ -83,7 +87,6 @@
String ifIndex = null;
String type = null;
String direction = null;
- String authRealm = null;
String classOfService = null;
String capacity = null;

@@ -104,6 +107,20 @@


eventType = metadata.getEventType().getEventType().trim();
+
+ Parameter keywordParameter = metadata.getParameterByName("keyword");
+ String keywordQueryPart = "";
+ if (keywordParameter != null) {
+
+ keyword = keywordParameter.getParameterValue();
+ keywordType = keywordParameter.getParameterType();
+
+ if (!keyword.trim().equals("") && !keywordType.trim().equals(""))
+ keywordQueryPart = " and
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword' and functx:trim(@type)='" + keywordType + "') or
(functx:trim(@value)='" + keyword + "' and functx:trim(@name)='keyword' and
functx:trim(@type)='" + keywordType + "')] ";
+ else if (!keyword.trim().equals("") &&
keywordType.trim().equals(""))
+ keywordQueryPart = " and
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword') or (functx:trim(@value)='" + keyword + "' and
functx:trim(@name)='keyword')] ";
+ }
+
Subject subject = (Subject) metadata.getSubject();
if (subject != null) {
Interface interf = subject.getInterface();
@@ -116,7 +133,6 @@
ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : null);
type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : null);
direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : null);
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : null);
classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : null);
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

@@ -144,11 +160,11 @@
+ "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";
+ "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";


if (ipAddress == null &&
@@ -159,13 +175,13 @@
ifIndex == null &&
type == null &&
direction == null &&
- authRealm == null &&
classOfService == null &&
- capacity == null) {
+ capacity == null &&
+ keywordParameter == null) {

// getting all metadata

- xQuery +=
+ xQuery +=
"let $res :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where
\n"
@@ -180,7 +196,7 @@
+ "\n"
+ "return ($res, $datas) \n";

- return xQuery;
+ return xQuery;

}

@@ -190,79 +206,74 @@
+ " for $i in //nmwg:metadata \n"
+ " where 1 \n";

-
+
if (eventType != null)
- xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
+ xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] "
+ + keywordQueryPart;

if (ipAddress != null) {
- if (ipAddress.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ipAddress");
+ if (ipAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ipAddress");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ipAddress[functx:trim(text())='" +
ipAddress + "'] ";
}

if (hostName != null) {
- if (hostName.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong hostName");
+ if (hostName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong hostName");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:hostName[functx:trim(text())='" +
hostName + "'] ";
}

if (ifName != null) {
- if (ifName.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifName");
+ if (ifName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifName");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifName[functx:trim(text())='" +
ifName + "'] ";
}

if (ifDescription != null) {
- if (ifDescription.equals(""))
+ if (ifDescription.equals(""))
throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifDescription");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifDescription[functx:trim(text())='"
+ ifDescription + "'] ";
}

if (ifAddress != null) {
- if (ifAddress.equals("") && ifAddressType == null)
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.equals(""))
+ if (ifAddress.equals("") && ifAddressType == null)
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifAddress");
+ if (!ifAddress.equals(""))
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
}

if (ifIndex != null) {
- if (ifIndex.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifIndex");
+ if (ifIndex.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifIndex");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifIndex[functx:trim(text())='" +
ifIndex + "'] ";
}

if (type != null) {
- if (type.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong type");
+ if (type.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong type");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:type[functx:trim(text())='" + type
+ "'] ";
}

if (direction != null) {
- if (direction.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong direction");
+ if (direction.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong direction");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "'] ";
}

- if (authRealm != null) {
- if (authRealm.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong authRealm");
- xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:authRealm[functx:trim(text())='" +
authRealm + "'] ";
- }
-
if (classOfService != null) {
- if (classOfService.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong classOfService");
+ if (classOfService.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong classOfService");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:classOfService[functx:trim(text())='"
+ classOfService + "'] ";
}

if (capacity != null) {
- if (capacity.equals(""))
- throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong capacity");
+ if (capacity.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong capacity");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:capacity[functx:trim(text())='" +
capacity + "'] ";
}

if (ifAddressType != null) {
- xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(@type)='" +
ifAddressType + "'] ";
+ xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(@type)='" +
ifAddressType + "'] ";
}



Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2008-06-10 11:26:53 UTC (rev 3980)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2008-06-10 11:28:43 UTC (rev 3981)
@@ -7,6 +7,7 @@

import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.base.v2_0.Parameter;
import org.ggf.ns.nmwg.characteristic.errors.v2_0.Subject;
import org.ggf.ns.nmwg.topology.v2_0.Interface;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
@@ -74,6 +75,9 @@
// + "start getMetadataQuery");

String eventType = null;
+ String keyword = null;
+ String keywordType = null;
+
String ipAddress = null;
String hostName = null;
String ifName = null;
@@ -104,6 +108,20 @@


eventType = metadata.getEventType().getEventType().trim();
+
+ Parameter keywordParameter = metadata.getParameterByName("keyword");
+ String keywordQueryPart = "";
+ if (keywordParameter != null) {
+
+ keyword = keywordParameter.getParameterValue();
+ keywordType = keywordParameter.getParameterType();
+
+ if (!keyword.trim().equals("") && !keywordType.trim().equals(""))
+ keywordQueryPart = " and
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword' and functx:trim(@type)='" + keywordType + "') or
(functx:trim(@value)='" + keyword + "' and functx:trim(@name)='keyword' and
functx:trim(@type)='" + keywordType + "')] ";
+ else if (!keyword.trim().equals("") &&
keywordType.trim().equals(""))
+ keywordQueryPart = " and
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword') or (functx:trim(@value)='" + keyword + "' and
functx:trim(@name)='keyword')] ";
+ }
+
Subject subject = (Subject) metadata.getSubject();
if (subject != null) {
Interface interf = subject.getInterface();
@@ -116,7 +134,6 @@
ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : null);
type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : null);
direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : null);
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : null);
classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : null);
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

@@ -126,13 +143,13 @@
ifAddressType = null;
}
} else {
- throw new PerfSONARException(
+ throw new PerfSONARException(
"error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: "
+ "no interface element in metadata element");
}
} else {
- throw new PerfSONARException(
+ throw new PerfSONARException(
"error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: "
+ "no subject element in metadata element");
@@ -144,11 +161,11 @@
+ "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";
+ "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";

if (ipAddress == null &&
hostName == null &&
@@ -158,13 +175,13 @@
ifIndex == null &&
type == null &&
direction == null &&
- authRealm == null &&
classOfService == null &&
- capacity == null) {
+ capacity == null &&
+ keywordParameter == null) {

// getting all metadata
-
- xQuery +=
+
+ xQuery +=
"let $res :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where
\n"
@@ -182,8 +199,8 @@
return xQuery;

}
-

+
xQuery +=
" let $res := \n"
+ " for $i in //nmwg:metadata \n"
@@ -191,23 +208,24 @@


if (eventType != null)
- xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
+ xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] "
+ + keywordQueryPart;

if (ipAddress != null) {
- if (ipAddress.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ipAddress");
+ if (ipAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ipAddress");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ipAddress[functx:trim(text())='" +
ipAddress + "'] ";
}

if (hostName != null) {
- if (hostName.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong hostName");
+ if (hostName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong hostName");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:hostName[functx:trim(text())='" +
hostName + "'] ";
}

if (ifName != null) {
- if (ifName.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifName");
+ if (ifName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifName");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifName[functx:trim(text())='" +
ifName + "'] ";
}

@@ -218,50 +236,44 @@
}

if (ifAddress != null) {
- if (ifAddress.equals("") && ifAddressType == null)
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.equals(""))
- xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ if (ifAddress.equals("") && ifAddressType == null)
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifAddress");
+ if (!ifAddress.equals(""))
+ xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
}

if (ifIndex != null) {
- if (ifIndex.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifIndex");
+ if (ifIndex.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifIndex");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifIndex[functx:trim(text())='" +
ifIndex + "'] ";
}

if (type != null) {
- if (type.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong type");
+ if (type.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong type");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:type[functx:trim(text())='" + type +
"'] ";
}

if (direction != null) {
if (direction.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong direction");
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong direction");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "'] ";
}

- if (authRealm != null) {
- if (authRealm.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong authRealm");
- xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:authRealm[functx:trim(text())='" +
authRealm + "'] ";
- }
-
if (classOfService != null) {
- if (classOfService.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong classOfService");
+ if (classOfService.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong classOfService");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:classOfService[functx:trim(text())='"
+ classOfService + "'] ";
}

if (capacity != null) {
- if (capacity.equals(""))
- throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong capacity");
+ if (capacity.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong capacity");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:capacity[functx:trim(text())='" +
capacity + "'] ";
}

if (ifAddressType != null) {
- xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(@type)='" +
ifAddressType + "'] ";
+ xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(@type)='" +
ifAddressType + "'] ";
}



Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2008-06-10 11:26:53 UTC (rev 3980)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2008-06-10 11:28:43 UTC (rev 3981)
@@ -87,7 +87,6 @@
String ifIndex = null;
String type = null;
String direction = null;
- String authRealm = null;
String classOfService = null;
String capacity = null;

@@ -134,7 +133,6 @@
ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : null);
type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : null);
direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : null);
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : null);
classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : null);
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

@@ -177,9 +175,9 @@
ifIndex == null &&
type == null &&
direction == null &&
- authRealm == null &&
classOfService == null &&
- capacity == null) {
+ capacity == null &&
+ keywordParameter == null) {

// getting all metadata

@@ -187,12 +185,10 @@
"let $res :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where
\n"
- + " 1 and \n"
- + "
($i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='" + eventType + "'
and functx:trim(@name)='supportedEventType') \n"
+ + "
$i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='" + eventType + "'
and functx:trim(@name)='supportedEventType') \n"
+ " or (functx:trim(@value)='" + eventType + "' and
functx:trim(@name)='supportedEventType')] \n"
+ " or
\n"
- + " $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'])
\n"
- + keywordQueryPart
+ + " $i/nmwg:eventType[functx:trim(text())='" +
eventType + "']
\n"
+ " return $i
\n"
+ "\n"
+ "let $datas :=
\n"
@@ -218,8 +214,8 @@
if (eventType != null)
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')]) "
- + "or "
- + "($i/nmwg:eventType[functx:trim(text())='" +
eventType + "'])"
+ + "or "
+ + "($i/nmwg:eventType[functx:trim(text())='" +
eventType + "'])"
+ ") "
+ keywordQueryPart;

@@ -272,12 +268,6 @@
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "'] ";
}

- if (authRealm != null) {
- if (authRealm.equals(""))
- throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong authRealm");
- xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:authRealm[functx:trim(text())='" +
authRealm + "'] ";
- }
-
if (classOfService != null) {
if (classOfService.equals(""))
throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong classOfService");



  • perfsonar: r3981 - trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator, svnlog, 06/10/2008

Archive powered by MHonArc 2.6.16.

Top of Page