perfsonar-dev - perfsonar: r2704 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Subject: perfsonar development work
List archive
perfsonar: r2704 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2704 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
- Date: Wed, 22 Aug 2007 09:47:21 -0400
Author: roman
Date: 2007-08-22 09:47:21 -0400 (Wed, 22 Aug 2007)
New Revision: 2704
Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
Log:
exception handling improved (in case of empty strings in elements belonging
to interface block)
Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2007-08-22 13:39:08 UTC (rev 2703)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2007-08-22 13:47:21 UTC (rev 2704)
@@ -74,18 +74,18 @@
//logger.debug("DiscardsQueryGenerator.getMetadataQuery: "
// + "start getMetadataQuery");
- String eventType = "";
- String ipAddress = "";
- String hostName = "";
- String ifName = "";
- String ifDescription = "";
- String ifAddress = "";
- String ifIndex = "";
- String type = "";
- String direction = "";
- String authRealm = "";
- String classOfService = "";
- String capacity = "";
+ String eventType = null;
+ String ipAddress = null;
+ String hostName = null;
+ String ifName = null;
+ String ifDescription = null;
+ String ifAddress = null;
+ String ifIndex = null;
+ String type = null;
+ String direction = null;
+ String authRealm = null;
+ String classOfService = null;
+ String capacity = null;
Metadata metadata = null;
try {
@@ -108,17 +108,17 @@
if (subject != null) {
Interface interf = subject.getInterface();
if (interf != null) {
- ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : "");
- hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : "");
- ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : "");
- ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : "");
- ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : "");
- ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : "");
- type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : "");
- direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : "");
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : "");
- classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : "");
- capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : "");
+ ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : null);
+ hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : null);
+ ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : null);
+ ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : null);
+ ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : null);
+ 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);
} else {
throw new PerfSONARException(
"error.ma.query",
@@ -151,41 +151,74 @@
+ " where 1 \n";
- if (eventType != "")
+ if (eventType != null)
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
- if (ipAddress != "")
+ if (ipAddress != null) {
+ 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 != "")
+ if (hostName != null) {
+ 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 != "")
+ if (ifName != null) {
+ 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 != "")
+ if (ifDescription != null) {
+ 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 != "")
+ if (ifAddress != null) {
+ if (ifAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifAddress");
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
- if (ifIndex != "")
+ if (ifIndex != null) {
+ 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 != "")
+ if (type != null) {
+ 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 != "")
+ if (direction != null) {
+ 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 != "")
+ 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 != "")
+ if (classOfService != null) {
+ 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 != "")
+ if (capacity != null) {
+ 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 + "'] ";
+ }
xQuery += "\n"
Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2007-08-22 13:39:08 UTC (rev 2703)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2007-08-22 13:47:21 UTC (rev 2704)
@@ -74,18 +74,18 @@
//logger.debug("UtilizationQueryGenerator.getMetadataQuery: "
// + "start getMetadataQuery");
- String eventType = "";
- String ipAddress = "";
- String hostName = "";
- String ifName = "";
- String ifDescription = "";
- String ifAddress = "";
- String ifIndex = "";
- String type = "";
- String direction = "";
- String authRealm = "";
- String classOfService = "";
- String capacity = "";
+ String eventType = null;
+ String ipAddress = null;
+ String hostName = null;
+ String ifName = null;
+ String ifDescription = null;
+ String ifAddress = null;
+ String ifIndex = null;
+ String type = null;
+ String direction = null;
+ String authRealm = null;
+ String classOfService = null;
+ String capacity = null;
Metadata metadata = null;
try {
@@ -108,17 +108,17 @@
if (subject != null) {
Interface interf = subject.getInterface();
if (interf != null) {
- ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : "");
- hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : "");
- ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : "");
- ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : "");
- ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : "");
- ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : "");
- type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : "");
- direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : "");
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : "");
- classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : "");
- capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : "");
+ ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : null);
+ hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : null);
+ ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : null);
+ ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : null);
+ ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : null);
+ 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);
} else {
throw new PerfSONARException(
"error.ma.query",
@@ -151,41 +151,74 @@
+ " where 1 \n";
- if (eventType != "")
+ if (eventType != null)
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
- if (ipAddress != "")
+ if (ipAddress != null) {
+ 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 != "")
+ if (hostName != null) {
+ 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 != "")
+ if (ifName != null) {
+ 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 + "'] ";
+ }
- if (ifDescription != "")
+ if (ifDescription != null) {
+ if (ifDescription.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifDescription");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifDescription[functx:trim(text())='"
+ ifDescription + "'] ";
+ }
- if (ifAddress != "")
+ if (ifAddress != null) {
+ if (ifAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifAddress");
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
- if (ifIndex != "")
+ if (ifIndex != null) {
+ 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 != "")
+ if (type != null) {
+ 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 != "")
+ if (direction != null) {
+ if (direction.equals(""))
+ 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 != "")
+ 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 != "")
+ if (classOfService != null) {
+ 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 != "")
+ if (capacity != null) {
+ 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 + "'] ";
+ }
xQuery += "\n"
Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-08-22 13:39:08 UTC (rev 2703)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-08-22 13:47:21 UTC (rev 2704)
@@ -74,18 +74,18 @@
//logger.debug("UtilizationQueryGenerator.getMetadataQuery: "
// + "start getMetadataQuery");
- String eventType = "";
- String ipAddress = "";
- String hostName = "";
- String ifName = "";
- String ifDescription = "";
- String ifAddress = "";
- String ifIndex = "";
- String type = "";
- String direction = "";
- String authRealm = "";
- String classOfService = "";
- String capacity = "";
+ String eventType = null;
+ String ipAddress = null;
+ String hostName = null;
+ String ifName = null;
+ String ifDescription = null;
+ String ifAddress = null;
+ String ifIndex = null;
+ String type = null;
+ String direction = null;
+ String authRealm = null;
+ String classOfService = null;
+ String capacity = null;
Metadata metadata = null;
try {
@@ -108,17 +108,17 @@
if (subject != null) {
Interface interf = subject.getInterface();
if (interf != null) {
- ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : "");
- hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : "");
- ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : "");
- ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : "");
- ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : "");
- ifIndex = (interf.getIfIndexElement() != null
? interf.getIfIndexElement().getIfIndex().trim() : "");
- type = (interf.getTypeElement() != null
? interf.getTypeElement().getType().trim() : "");
- direction = (interf.getDirectionElement() != null
? interf.getDirectionElement().getDirection().trim() : "");
- authRealm = (interf.getAuthRealmElement() != null
? interf.getAuthRealmElement().getAuthRealm().trim() : "");
- classOfService = (interf.getClassOfServiceElement() != null
? interf.getClassOfServiceElement().getClassOfService().trim() : "");
- capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : "");
+ ipAddress = (interf.getIpAddressElement() != null
? interf.getIpAddressElement().getIpAddress().trim() : null);
+ hostName = (interf.getHostNameElement() != null
? interf.getHostNameElement().getHostName().trim() : null);
+ ifName = (interf.getIfNameElement() != null
? interf.getIfNameElement().getIfName().trim() : null);
+ ifDescription = (interf.getIfDescriptionElement() != null
? interf.getIfDescriptionElement().getIfDescription().trim() : null);
+ ifAddress = (interf.getIfAddressElement() != null
? interf.getIfAddressElement().getIfAddress().trim() : null);
+ 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);
} else {
throw new PerfSONARException(
"error.ma.query",
@@ -151,41 +151,74 @@
+ " where 1 \n";
- if (eventType != "")
+ if (eventType != null)
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
- if (ipAddress != "")
+ if (ipAddress != null) {
+ if (ipAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong 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[functx:trim(text())='" +
hostName + "'] ";
+ if (hostName != null) {
+ if (hostName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong hostName");
+ xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:hostName[functx:trim(text())='" +
hostName + "'] ";
+ }
- if (ifName != "")
+ if (ifName != null) {
+ if (ifName.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifName");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifName[functx:trim(text())='" +
ifName + "'] ";
+ }
- if (ifDescription != "")
+ if (ifDescription != null) {
+ if (ifDescription.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifDescription");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifDescription[functx:trim(text())='"
+ ifDescription + "'] ";
+ }
- if (ifAddress != "")
+ if (ifAddress != null) {
+ if (ifAddress.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifAddress");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
- if (ifIndex != "")
+ if (ifIndex != null) {
+ if (ifIndex.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifIndex");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifIndex[functx:trim(text())='" +
ifIndex + "'] ";
+ }
- if (type != "")
+ if (type != null) {
+ if (type.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong type");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:type[functx:trim(text())='" + type +
"'] ";
+ }
- if (direction != "")
+ if (direction != null) {
+ if (direction.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong direction");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "'] ";
+ }
- if (authRealm != "")
+ 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 != "")
+ if (classOfService != null) {
+ if (classOfService.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong classOfService");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:classOfService[functx:trim(text())='"
+ classOfService + "'] ";
+ }
- if (capacity != "")
+ if (capacity != null) {
+ if (capacity.equals(""))
+ throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong capacity");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:capacity[functx:trim(text())='" +
capacity + "'] ";
+ }
xQuery += "\n"
- perfsonar: r2704 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator, svnlog, 08/22/2007
Archive powered by MHonArc 2.6.16.