Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6002 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar-java-sql- ma/src/main/java/org/perfsonar/service/measurementArchive/ sqlType/fetch perfsonar-java-sql-ma/src/main/java/org/perf sonar/service/measurementArchive/sqlType/nmwg perfsonar-ja va-sql-ma/src/main/java/org/perfsonar/service/measurementA rchive/sqlType/store perfsonar_base/src/main/java/org/pe rfsonar/base/auxiliary perfsonar_base/src/main/java/org/ perfsonar/base/auxiliary/components/authn perfsonar_base /src/main/java/org/perfsonar/base/auxiliary/components/aut hn/wssec perfsonar_base/src/main/java/org/perfsonar/base /auxiliary/components/scheduler perfsonar_base/src/main/ java/org/perfsonar/base/nmwg/owamp perfsonar_base/src/ma in/java/org/perfsonar/client/base/authn/saslca perfsonar _base/src/main/java/org/perfsonar/client/base/requests/l ookupService perfsonar_base/src/main/java/org/perfsonar/ client/base/xquery/lookupService per fsonar_base/src/mai n/java/org/perfsonar/service/base/messages perfsonar_bas e/src/main/java/org/perfsonar/service/base/registration pe rfsonar_base/src/main/java/org/perfsonar/service/base/st orage/xmldb/exist/rest perfsonar_base/src/main/java/org/ perfsonar/service/measurementArchive/metadataConfig perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/keyGenerator perfsonar_base/src/m ain/java/org/perfsonar/service/measurementArchive/metadata Config/queryGenerator perfsonar_base/src/main/java/org/p erfsonar/service/measurementArchive/register

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6002 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar-java-sql- ma/src/main/java/org/perfsonar/service/measurementArchive/ sqlType/fetch perfsonar-java-sql-ma/src/main/java/org/perf sonar/service/measurementArchive/sqlType/nmwg perfsonar-ja va-sql-ma/src/main/java/org/perfsonar/service/measurementA rchive/sqlType/store perfsonar_base/src/main/java/org/pe rfsonar/base/auxiliary perfsonar_base/src/main/java/org/ perfsonar/base/auxiliary/components/authn perfsonar_base /src/main/java/org/perfsonar/base/auxiliary/components/aut hn/wssec perfsonar_base/src/main/java/org/perfsonar/base /auxiliary/components/scheduler perfsonar_base/src/main/ java/org/perfsonar/base/nmwg/owamp perfsonar_base/src/ma in/java/org/perfsonar/client/base/authn/saslca perfsonar _base/src/main/java/org/perfsonar/client/base/requests/l ookupService perfsonar_base/src/main/java/org/perfsonar/ client/base/xquery/lookupService per fsonar_base/src/mai n/java/org/perfsonar/service/base/messages perfsonar_bas e/src/main/java/org/perfsonar/service/base/registration pe rfsonar_base/src/main/java/org/perfsonar/service/base/st orage/xmldb/exist/rest perfsonar_base/src/main/java/org/ perfsonar/service/measurementArchive/metadataConfig perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/keyGenerator perfsonar_base/src/m ain/java/org/perfsonar/service/measurementArchive/metadata Config/queryGenerator perfsonar_base/src/main/java/org/p erfsonar/service/measurementArchive/register


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6002 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar-java-sql- ma/src/main/java/org/perfsonar/service/measurementArchive/ sqlType/fetch perfsonar-java-sql-ma/src/main/java/org/perf sonar/service/measurementArchive/sqlType/nmwg perfsonar-ja va-sql-ma/src/main/java/org/perfsonar/service/measurementA rchive/sqlType/store perfsonar_base/src/main/java/org/pe rfsonar/base/auxiliary perfsonar_base/src/main/java/org/ perfsonar/base/auxiliary/components/authn perfsonar_base /src/main/java/org/perfsonar/base/auxiliary/components/aut hn/wssec perfsonar_base/src/main/java/org/perfsonar/base /auxiliary/components/scheduler perfsonar_base/src/main/ java/org/perfsonar/base/nmwg/owamp perfsonar_base/src/ma in/java/org/perfsonar/client/base/authn/saslca perfsonar _base/src/main/java/org/perfsonar/client/base/requests/l ookupService perfsonar_base/src/main/java/org/perfsonar/ client/base/xquery/lookupService per fsonar_base/src/mai n/java/org/perfsonar/service/base/messages perfsonar_bas e/src/main/java/org/perfsonar/service/base/registration pe rfsonar_base/src/main/java/org/perfsonar/service/base/st orage/xmldb/exist/rest perfsonar_base/src/main/java/org/ perfsonar/service/measurementArchive/metadataConfig perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/keyGenerator perfsonar_base/src/m ain/java/org/perfsonar/service/measurementArchive/metadata Config/queryGenerator perfsonar_base/src/main/java/org/p erfsonar/service/measurementArchive/register
  • Date: Tue, 11 Sep 2012 08:41:42 +0100 (BST)

Author: nordunet.behrmann
Date: 2012-09-11 08:41:42 +0100 (Tue, 11 Sep 2012)
New Revision: 6002

Modified:

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ResponseGeneratorFactory.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/IperfStoreRequestProcess.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/L2PathStatusStoreRequestProcess.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcessFactory.java

trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentsConfigurationReader.java

trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java

trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java

trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java

trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java

trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java

trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/LSRegisterRequestGenerator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/xquery/lookupService/GenericXQueryExpression.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/BaseChaining.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/EchoRequest.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LookupInfoRequest.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/GenericServiceLSRegistrator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSListAddresses.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSRegistrationComponent.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHTTPAccess.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/HTTPAccess.java

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

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/MetadataKeyGeneratorFactory.java

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

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/IperfQueryGenerator.java

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

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

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

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

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

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

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
Log:
Use Java 5 style string operations

Also use equals() rather than == for string comparison.

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -34,7 +34,7 @@

String mergerName = aMergerNamesArray.trim();

- if (mergerName.equals(""))
+ if (mergerName.isEmpty())
continue;

BaseChaining baseChainingMerger = null;
@@ -62,7 +62,7 @@

}

- if (baseChainingMergers.size() == 0) return null;
+ if (baseChainingMergers.isEmpty()) return null;
return baseChainingMergers;

}

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -251,11 +251,11 @@


if (m1_subject != null )
- if (m1_subject.getMetadataIdRef() != "" )
+ if (!m1_subject.getMetadataIdRef().isEmpty())
newSubject.setMetadataIdRef(m1_subject.getMetadataIdRef());

if (m2_subject != null )
- if (m2_subject.getMetadataIdRef() != "" )
+ if (!m2_subject.getMetadataIdRef().isEmpty())
newSubject.setMetadataIdRef(m2_subject.getMetadataIdRef());



Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -259,7 +259,7 @@
"SQLStorageManager.store: "
+ "No ibatisConfig parameter in the key");

- if (ibatisConfig.trim() == "")
+ if (ibatisConfig.trim().isEmpty())
throw new PerfSONARException(
"error.sqlma.db_connection.ibatis",
"SQLStorageManager.store: "

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -131,7 +131,7 @@
Metadata metadata = null;
Map metadataMap = keyMessage.getMetadataMap();
if (metadataMap != null)
- if (data.getMetadataIdRef() != "")
+ if (!data.getMetadataIdRef().isEmpty())
metadata = (Metadata)
metadataMap.get(data.getMetadataIdRef());

@@ -250,7 +250,7 @@
+ "No eventType in the request metadata");

String eventType = eventTypeObj.getEventType().trim();
- if (eventType.equals(""))
+ if (eventType.isEmpty())
throw new PerfSONARException("error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "eventType in the request metadata is empty");
@@ -270,7 +270,7 @@
sex.getResultDescription());
}

- if (resp.getDataMap().size() > 0) {
+ if (!resp.getDataMap().isEmpty()) {
// metadata already exists in xmldb

Data d = (resp.getDataArray())[0];
@@ -293,7 +293,7 @@
}

Parameter ibatisConfig = null;
- if (!ibatis_config_str.trim().equals("")) {
+ if (!ibatis_config_str.trim().isEmpty()) {
ibatisConfig = new Parameter();
ibatisConfig.setParameterName("ibatisConfig");
ibatisConfig.setParameterValue(ibatis_config_str);
@@ -419,7 +419,7 @@
+ "ibatisConfig parameter for eventType (" + eventTypeStr +
"): "
+ ibatisConfigStr);

- if (ibatisConfigStr == null || ibatisConfigStr.trim().equals(""))
+ if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty())
return null;

Parameter ibatisConfig = new Parameter();
@@ -720,7 +720,7 @@
} catch (Exception ex) {
}

- if (mergerNames == null || mergerNames.trim().equals(""))
+ if (mergerNames == null || mergerNames.trim().isEmpty())
return message;

Set baseChainingMergers =
@@ -731,10 +731,9 @@

BaseChaining baseChaining = null;

- Iterator iterator = baseChainingMergers.iterator();
- while (iterator.hasNext()) {
+ for (Object baseChainingMerger : baseChainingMergers) {

- baseChaining = (BaseChaining) iterator.next();
+ baseChaining = (BaseChaining) baseChainingMerger;
message = baseChaining.processChaining(message);

}
@@ -759,7 +758,7 @@

if (metadata.getSubject() != null ) {

- if (metadata.getSubject().getMetadataIdRef() == "") {
+ if (metadata.getSubject().getMetadataIdRef().isEmpty()) {

// getting data from configuration storage manager


Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -50,7 +50,7 @@

// First check if results are for ordinary OWAMP (owamp
table) or OWAMP
// Aggregate (owamp_agg) table
- if (resultList.size() > 0) {
+ if (!resultList.isEmpty()) {
Collection<String> kCollection = ((Map)
resultList.get(0)).keySet();
for (String columnName : kCollection) {
if (columnName.equals("seqNum")

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ResponseGeneratorFactory.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ResponseGeneratorFactory.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ResponseGeneratorFactory.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -59,7 +59,7 @@
// + "class name for eventType (" + eventTypeName + "): "
// + className);

- if (className == null || className.trim().equals(""))
+ if (className == null || className.trim().isEmpty())
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",
"ResponseGeneratorFactory.getResponseGenerator: "

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/nmwg/OwampAggregationDatum.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -295,7 +295,7 @@
if (nss.getURI("") == null) {
nss.declarePrefix("", value);
}
- if ((prefix.equals("")) &&
!(value.equals(uri))) {
+ if ((prefix.isEmpty()) &&
!(value.equals(uri))) {
uri = value;
}
} else {
@@ -362,124 +362,124 @@
AttributesImpl atts = new AttributesImpl();

//SUMMARY DAT
- if (!(getValue().equals(""))) {
+ if (!(getValue().isEmpty())) {
atts.addAttribute(getUri(), "value", "value",
"CDATA", getValue());
}
- if (!(getValueUnits().equals(""))) {
+ if (!(getValueUnits().isEmpty())) {
atts.addAttribute(getUri(), "valueUnits",
"valueUnits", "CDATA",
getValueUnits());
}
- if (!(getNumBytes().equals(""))) {
+ if (!(getNumBytes().isEmpty())) {
atts.addAttribute(getUri(), "numBytes", "numBytes",
"CDATA",
getNumBytes());
}
- if (!(getNumBytesUnits().equals(""))) {
+ if (!(getNumBytesUnits().isEmpty())) {
atts.addAttribute(getUri(), "numBytesUnits",
"numBytesUnits",
"CDATA", getNumBytesUnits());
}
- if (!(getTimeType().equals(""))) {
+ if (!(getTimeType().isEmpty())) {
atts.addAttribute(getUri(), "timeType", "timeType",
"CDATA",
getTimeType());
}
- if (!(getTimeValue().equals(""))) {
+ if (!(getTimeValue().isEmpty())) {
atts.addAttribute(getUri(), "timeValue", "timeValue",
"CDATA",
getTimeValue());
}
/* Add Specific Attributes from here */
- if (!(getSender().equals(""))) {
+ if (!(getSender().isEmpty())) {
atts.addAttribute(getUri(), "sender", "sender",
"CDATA",
getSender());
}
- if (!(getReceiver().equals(""))) {
+ if (!(getReceiver().isEmpty())) {
atts.addAttribute(getUri(), "receiver", "receiver",
"CDATA",
getReceiver());
}
- if (!(getSent().equals(""))) {
+ if (!(getSent().isEmpty())) {
atts.addAttribute(getUri(), "sent", "sent",
"CDATA", getSent());
}
- if (!(getLoss().equals(""))) {
+ if (!(getLoss().isEmpty())) {
atts.addAttribute(getUri(), "loss", "loss",
"CDATA", getLoss());
}
- if (!(getLostPercent().equals(""))) {
+ if (!(getLostPercent().isEmpty())) {
atts.addAttribute(getUri(), "lostPercent",
"lostPercent", "CDATA",
getLostPercent());
}
- if (!(getDuplicates().equals(""))) {
+ if (!(getDuplicates().isEmpty())) {
atts.addAttribute(getUri(), "duplicates",
"duplicates", "CDATA",
getDuplicates());
}
- if (!(getMinDelay().equals(""))) {
+ if (!(getMinDelay().isEmpty())) {
atts.addAttribute(getUri(), "minDelay", "minDelay",
"CDATA", getMinDelay());
}
- if (!(getMedDelay().equals(""))) {
+ if (!(getMedDelay().isEmpty())) {
atts.addAttribute(getUri(), "medDelay", "medDelay",
"CDATA", getMedDelay());
}
- if (!(getMaxDelay().equals(""))) {
+ if (!(getMaxDelay().isEmpty())) {
atts.addAttribute(getUri(), "maxDelay", "maxDelay",
"CDATA", getMaxDelay());
}
- if (!(getDelayUnits().equals(""))) {
+ if (!(getDelayUnits().isEmpty())) {
atts.addAttribute(getUri(), "delayUnits",
"delayUnits", "CDATA", getDelayUnits());
}
- if (!(getError().equals(""))) {
+ if (!(getError().isEmpty())) {
atts.addAttribute(getUri(), "error", "error",
"CDATA", getError());
}
- if (!(getErrorUnits().equals(""))) {
+ if (!(getErrorUnits().isEmpty())) {
atts.addAttribute(getUri(), "errorUnits",
"errorUnits", "CDATA", getErrorUnits());
}
- if (!(getJitter().equals(""))) {
+ if (!(getJitter().isEmpty())) {
atts.addAttribute(getUri(), "jitter", "jitter",
"CDATA", getJitter());
}
- if (!(getJitterUnits().equals(""))) {
+ if (!(getJitterUnits().isEmpty())) {
atts.addAttribute(getUri(), "jitterUnits",
"jitterUnits", "CDATA", getJitterUnits());
}
- if (!(getHops().equals(""))) {
+ if (!(getHops().isEmpty())) {
atts.addAttribute(getUri(), "hops", "hops", "CDATA",
getHops());
}

//REGULAR DATUM
- if(!(getValue().equals(""))) {
+ if(!(getValue().isEmpty())) {
atts.addAttribute(getUri(), "value", "value",
"CDATA", getValue());
}
- if(!(getValueUnits().equals(""))) {
+ if(!(getValueUnits().isEmpty())) {
atts.addAttribute(getUri(), "valueUnits",
"valueUnits", "CDATA", getValueUnits());
}
- if(!(getNumBytes().equals(""))) {
+ if(!(getNumBytes().isEmpty())) {
atts.addAttribute(getUri(), "numBytes", "numBytes",
"CDATA", getNumBytes());
}
- if(!(getNumBytesUnits().equals(""))) {
+ if(!(getNumBytesUnits().isEmpty())) {
atts.addAttribute(getUri(), "numBytesUnits",
"numBytesUnits", "CDATA", getNumBytesUnits());
}
- if(!(getTimeType().equals(""))) {
+ if(!(getTimeType().isEmpty())) {
atts.addAttribute(getUri(), "timeType", "timeType",
"CDATA", getTimeType());
}
- if(!(getTimeValue().equals(""))) {
+ if(!(getTimeValue().isEmpty())) {
atts.addAttribute(getUri(), "timeValue", "timeValue",
"CDATA", getTimeValue());
}
- if(!(getSeqNum().equals(""))) {
+ if(!(getSeqNum().isEmpty())) {
atts.addAttribute(getUri(), "seqNum", "seqNum",
"CDATA", getSeqNum());
}
- if(!(getSendTime().equals(""))) {
+ if(!(getSendTime().isEmpty())) {
atts.addAttribute(getUri(), "sendTime", "sendTime",
"CDATA", getSendTime());
}
- if(!(getSendSynchronized().equals(""))) {
+ if(!(getSendSynchronized().isEmpty())) {
atts.addAttribute(getUri(), "sendSynchronized",
"sendSynchronized", "CDATA", getSendSynchronized());
}
- if(!(getSendTimeError().equals(""))) {
+ if(!(getSendTimeError().isEmpty())) {
atts.addAttribute(getUri(), "sendTimeError",
"sendTimeError", "CDATA", getSendTimeError());
}
- if(!(getReceiveTime().equals(""))) {
+ if(!(getReceiveTime().isEmpty())) {
atts.addAttribute(getUri(), "receiveTime",
"receiveTime", "CDATA", getReceiveTime());
}
- if(!(getReceiveSynchronized().equals(""))) {
+ if(!(getReceiveSynchronized().isEmpty())) {
atts.addAttribute(getUri(), "receiveSynchronized",
"receiveSynchronized", "CDATA", getReceiveSynchronized());
}
- if(!(getReceiveTimeError().equals(""))) {
+ if(!(getReceiveTimeError().isEmpty())) {
atts.addAttribute(getUri(), "receiveTimeError",
"receiveTimeError", "CDATA", getReceiveTimeError());
}
- if(!(getTTL().equals(""))) {
+ if(!(getTTL().isEmpty())) {
atts.addAttribute(getUri(), "ttl", "ttl", "CDATA",
getTTL());
}

@@ -487,7 +487,7 @@

if (nss.getURI(getPrefix()) == null) {
nss.pushContext();
- if (getPrefix().equals("")) {
+ if (getPrefix().isEmpty()) {
atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
} else {
atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:"
@@ -518,68 +518,68 @@
org.w3c.dom.Document doc = parent.getOwnerDocument();
org.w3c.dom.Element datum = doc.createElementNS(getUri(),
getQName());
parent.appendChild(datum);
- if (!(getValue().equals(""))) {
+ if (!(getValue().isEmpty())) {
datum.setAttribute("value", getValue());
}
- if (!(getValueUnits().equals(""))) {
+ if (!(getValueUnits().isEmpty())) {
datum.setAttribute("valueUnits", getValueUnits());
}
- if (!(getTimeType().equals(""))) {
+ if (!(getTimeType().isEmpty())) {
datum.setAttribute("timeType", getTimeType());
}
- if (!(getTimeValue().equals(""))) {
+ if (!(getTimeValue().isEmpty())) {
datum.setAttribute("timeValue", getTimeValue());
}
- if (!(getNumBytes().equals(""))) {
+ if (!(getNumBytes().isEmpty())) {
datum.setAttribute("numBytes", getNumBytes());
}
- if (!(getNumBytesUnits().equals(""))) {
+ if (!(getNumBytesUnits().isEmpty())) {
datum.setAttribute("numBytesUnits",
getNumBytesUnits());
}
/* Add Specific Attributes from here */
- if (!(getSent().equals(""))) {
+ if (!(getSent().isEmpty())) {
datum.setAttribute("sent", getSent());
}
- if (!(getReceiver().equals(""))) {
+ if (!(getReceiver().isEmpty())) {
datum.setAttribute("receiver", getReceiver());
}
- if (!(getSender().equals(""))) {
+ if (!(getSender().isEmpty())) {
datum.setAttribute("sender", getSender());
}
- if (!(getLoss().equals(""))) {
+ if (!(getLoss().isEmpty())) {
datum.setAttribute("loss", getLoss());
}
- if (!(getLostPercent().equals(""))) {
+ if (!(getLostPercent().isEmpty())) {
datum.setAttribute("lostPercent", getLostPercent());
}
- if (!(getDuplicates().equals(""))) {
+ if (!(getDuplicates().isEmpty())) {
datum.setAttribute("duplicates", getDuplicates());
}
- if (!(getMinDelay().equals(""))) {
+ if (!(getMinDelay().isEmpty())) {
datum.setAttribute("minDelay", getMinDelay());
}
- if (!(getMedDelay().equals(""))) {
+ if (!(getMedDelay().isEmpty())) {
datum.setAttribute("medDelay", getMedDelay());
}
- if (!(getMaxDelay().equals(""))) {
+ if (!(getMaxDelay().isEmpty())) {
datum.setAttribute("maxDelay", getMaxDelay());
}
- if (!(getDelayUnits().equals(""))) {
+ if (!(getDelayUnits().isEmpty())) {
datum.setAttribute("delayUnits", getDelayUnits());
}
- if (!(getError().equals(""))) {
+ if (!(getError().isEmpty())) {
datum.setAttribute("error", getError());
}
- if (!(getErrorUnits().equals(""))) {
+ if (!(getErrorUnits().isEmpty())) {
datum.setAttribute("errorUnits", getErrorUnits());
}
- if (!(getJitter().equals(""))) {
+ if (!(getJitter().isEmpty())) {
datum.setAttribute("jitter", getJitter());
}
- if (!(getJitterUnits().equals(""))) {
+ if (!(getJitterUnits().isEmpty())) {
datum.setAttribute("jitterUnits", getJitterUnits());
}
- if (!(getHops().equals(""))) {
+ if (!(getHops().isEmpty())) {
datum.setAttribute("hops", getHops());
}

@@ -589,28 +589,28 @@


//REGULAR DATUM
- if(!(getSeqNum().equals(""))) {
+ if(!(getSeqNum().isEmpty())) {
datum.setAttribute("seqNum", getSeqNum());
}
- if(!(getSendTime().equals(""))) {
+ if(!(getSendTime().isEmpty())) {
datum.setAttribute("sendTime", getSendTime());
}
- if(!(getSendSynchronized().equals(""))) {
+ if(!(getSendSynchronized().isEmpty())) {
datum.setAttribute("sendSynchronized",
getSendSynchronized());
}
- if(!(getSendTimeError().equals(""))) {
+ if(!(getSendTimeError().isEmpty())) {
datum.setAttribute("sendTimeError",
getSendTimeError());
}
- if(!(getReceiveTime().equals(""))) {
+ if(!(getReceiveTime().isEmpty())) {
datum.setAttribute("receiveTime", getReceiveTime());
}
- if(!(getReceiveSynchronized().equals(""))) {
+ if(!(getReceiveSynchronized().isEmpty())) {
datum.setAttribute("receiveSynchronized",
getReceiveSynchronized());
}
- if(!(getReceiveTimeError().equals(""))) {
+ if(!(getReceiveTimeError().isEmpty())) {
datum.setAttribute("receiveTimeError",
getReceiveTimeError());
}
- if(!(getTTL().equals(""))) {
+ if(!(getTTL().isEmpty())) {
datum.setAttribute("ttl", getTTL());
}


Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/IperfStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/IperfStoreRequestProcess.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/IperfStoreRequestProcess.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -49,11 +49,11 @@
String jitter = ((Datum)datum).getJitter();
String loss = ((Datum)datum).getLoss();

- if (valueUnits.trim().equals("")) valueUnits = null;
- if (numBytes.trim().equals("")) numBytes = null;
- if (numBytesUnits.trim().equals("")) numBytesUnits = null;
- if (interval.trim().equals("")) interval = null;
- if (loss.trim().equals("")) loss = null;
+ if (valueUnits.trim().isEmpty()) valueUnits = null;
+ if (numBytes.trim().isEmpty()) numBytes = null;
+ if (numBytesUnits.trim().isEmpty()) numBytesUnits = null;
+ if (interval.trim().isEmpty()) interval = null;
+ if (loss.trim().isEmpty()) loss = null;

ibatisParams.put("valueUnits", valueUnits);
ibatisParams.put("time", Integer.parseInt(timeValue));

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/L2PathStatusStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/L2PathStatusStoreRequestProcess.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/L2PathStatusStoreRequestProcess.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -50,7 +50,7 @@
handleIsoTimeValue(timeValue, ibatisParams);
} else if (timeType.trim().equalsIgnoreCase("unix")) {
handleUnixTimeValue(timeValue, ibatisParams);
- } else if (timeType.trim().equals("")) {
+ } else if (timeType.trim().isEmpty()) {
handleUnixTimeValue(timeValue, ibatisParams);
} else
handleUnixTimeValue(timeValue, ibatisParams);
@@ -68,7 +68,7 @@
protected void handleUnixTimeValue(String timeValue, Map ibatisParams) {

int timeValueInt;
- if (timeValue.equals("")) {
+ if (timeValue.isEmpty()) {
timeValueInt = (int)((new Date()).getTime() / 1000);
ibatisParams.put("timeValue", timeValueInt);
} else {

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/OwampStoreRequestProcess.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -60,42 +60,42 @@

// NMWG DATUM
if (receiveSynchronized != null
- &&
!receiveSynchronized.trim().equals("")) {
+ &&
!receiveSynchronized.trim().isEmpty()) {
ibatisParams.put("receiveSynchronized",
Integer

.parseInt(receiveSynchronized));
datumType = true;
}

- if (receiveTime != null &&
!receiveTime.trim().equals("")) {
+ if (receiveTime != null &&
!receiveTime.trim().isEmpty()) {
ibatisParams.put("receiveTime", receiveTime);
datumType = true;
}
- if (receiveTimeError != null &&
!receiveTimeError.trim().equals("")) {
+ if (receiveTimeError != null &&
!receiveTimeError.trim().isEmpty()) {
ibatisParams.put("receiveTimeError", Float

.parseFloat(receiveTimeError));
datumType = true;
}
- if (sendSynchronized != null &&
!sendSynchronized.trim().equals("")) {
+ if (sendSynchronized != null &&
!sendSynchronized.trim().isEmpty()) {
ibatisParams.put("sendSynchronized", Integer
.parseInt(sendSynchronized));
datumType = true;
}
- if (sendTime != null && !sendTime.trim().equals("")) {
+ if (sendTime != null && !sendTime.trim().isEmpty()) {
ibatisParams.put("sendTime", sendTime);
datumType = true;
}
- if (sendTimeError != null &&
!sendTimeError.trim().equals("")){
+ if (sendTimeError != null &&
!sendTimeError.trim().isEmpty()){
ibatisParams.put("sendTimeError", Float
.parseFloat(sendTimeError));
datumType = true;
}
- if (seqNum != null && !seqNum.trim().equals("")){
+ if (seqNum != null && !seqNum.trim().isEmpty()){
ibatisParams.put("seqNum",
Integer.parseInt(seqNum));
datumType = true;
}
// ibatisParams.put("timeType", timeType);
// ibatisParams.put("timeValue",
Long.parseLong(timeValue));
- if (ttl != null && !ttl.trim().equals("")){
+ if (ttl != null && !ttl.trim().isEmpty()){
ibatisParams.put("ttl",
Integer.parseInt(ttl));
datumType = true;
}

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcessFactory.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcessFactory.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcessFactory.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -58,7 +58,7 @@
+ "class name for eventType (" + eventTypeName + "): "
+ className);

- if (className == null || className.trim().equals(""))
+ if (className == null || className.trim().isEmpty())
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",
"StoreRequestProcessFactory.getStoreRequestProcess: "

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentsConfigurationReader.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentsConfigurationReader.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentsConfigurationReader.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -32,7 +32,7 @@
while ((line = input.readLine()) != null) {

String trimmed = line.trim();
- if ((trimmed.length() > 0) && // not empty
+ if ((!trimmed.isEmpty()) && // not empty
(!trimmed.startsWith("#")) && // not a comment
(trimmed.contains("=")) // contains EQ sign
) {

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -305,7 +305,7 @@
if (certFact == null) {
try {
String provider =
properties.getProperty("org.apache.ws.security.crypto.merlin.cert.provider");
- if (provider == null || provider.length() == 0) {
+ if (provider == null || provider.isEmpty()) {
certFact = CertificateFactory.getInstance("X.509");
} else {
certFact = CertificateFactory.getInstance("X.509",
provider);
@@ -467,7 +467,7 @@
String provider = properties

.getProperty("org.apache.ws.security.crypto.merlin.cert.provider");
CertPathValidator certPathValidator;
- if (provider == null || provider.length() == 0) {
+ if (provider == null || provider.isEmpty()) {
certPathValidator =
CertPathValidator.getInstance("PKIX");
} else {
certPathValidator =
CertPathValidator.getInstance("PKIX",

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -149,7 +149,7 @@
st.setSecTokenFromRequest();
AuthRRequest authrReq=new AuthRRequest(st,
messageType);
authrReq.setResource(getResource());
- if (!(eventType==null||eventType.equals("")))
{
+ if (!(eventType==null|| eventType.isEmpty()))
{

authrReq.setAction(URLEncoder.encode(messageType)+":"+URLEncoder.encode(eventType));
}
try {

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -151,7 +151,7 @@

}

- if(xmlDbURL==null || xmlDbURL.equals("")) {
+ if(xmlDbURL==null || xmlDbURL.isEmpty()) {

logger.fatal("Scheduler.readSchedules: Scheduler is unable to
" +
"read configuration information from
service.properties file " +
@@ -164,7 +164,7 @@

}

- if(userName==null || userName.equals("")) {
+ if(userName==null || userName.isEmpty()) {

logger.fatal("Scheduler.readSchedules: Scheduler is unable to
" +
"read configuration information from
service.properties file " +
@@ -177,7 +177,7 @@

}

- if(password==null || password.equals("")) {
+ if(password==null || password.isEmpty()) {

logger.fatal("Scheduler.readSchedules: Scheduler is unable to
" +
"read configuration information from
service.properties file " +
@@ -190,7 +190,7 @@

}

- if(community==null || community.equals("")) {
+ if(community==null || community.isEmpty()) {

logger.fatal("Scheduler.readSchedules: Scheduler is unable to
" +
"read configuration information from
service.properties file " +

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -35,7 +35,7 @@
* Return parameter by name.
*/
public Parameter getParameterByName(String name) {
- if(!(name.equals(""))) {
+ if(!(name.isEmpty())) {
if(name.equals("count") ||
name.equals("dscp") ||
name.equals("phb") ||
@@ -105,7 +105,7 @@
}

public void addParameter(String name, String value) {
- if(!(name.equals("")) && !(value.equals(""))) {
+ if(!(name.isEmpty()) && !(value.isEmpty())) {
if(name.equals("count") ||
name.equals("dscp") ||
name.equals("phb") ||

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/SASLCAClientConfiguration.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -165,7 +165,7 @@

Map<String, String> securityLayerProps = new HashMap<String,
String>();

- if (securityString == null || securityString.trim().length()
== 0) {
+ if (securityString == null ||
securityString.trim().isEmpty()) {
return securityLayerProps;
}

@@ -204,7 +204,7 @@

String s = qopString.toString();

- if (!s.equals("")) {
+ if (!s.isEmpty()) {
securityLayerProps.put(javax.security.sasl.Sasl.QOP,
s);
}


Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/LSRegisterRequestGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/LSRegisterRequestGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/LSRegisterRequestGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -98,7 +98,7 @@
if (accessPointString==null) throw new PerfSONARException(
"error.lsregistrator.no_accesspoint",
"AccessPoint parameter was not found. Registration failed");
- if ("".equals(accessPointString)) throw new PerfSONARException(
+ if (accessPointString != null && accessPointString.isEmpty()) throw
new PerfSONARException(
"error.lsregistrator.no_accesspoint",
"AccessPoint parameter was empty. Registration failed");
AccessPoint ap = new AccessPoint();
@@ -110,7 +110,7 @@
if (serviceNameString==null) throw new PerfSONARException(
"error.lsregistrator.no_servicename",
"ServiceName parameter was not found. Registration failed");
- if ("".equals(serviceNameString)) throw new PerfSONARException(
+ if (serviceNameString != null && serviceNameString.isEmpty()) throw
new PerfSONARException(
"error.lsregistrator.no_servicename",
"ServiceName parameter was empty. Registration failed");

ServiceName sn = new ServiceName();
@@ -122,7 +122,7 @@
if (serviceTypeString==null) throw new PerfSONARException(
"error.lsregistrator.no_servicetype",
"ServiceType parameter was not found. Registration failed");
- if ("".equals(serviceTypeString)) throw new PerfSONARException(
+ if (serviceTypeString != null && serviceTypeString.isEmpty()) throw
new PerfSONARException(
"error.lsregistrator.no_servicename",
"ServiceType parameter was empty. Registration failed");

ServiceType st = new ServiceType();
@@ -174,7 +174,7 @@

for (int i=0; i<supportedEventTypes.length; i++) {
String et=supportedEventTypes[i];
- if (!("".equals(et)))
+ if (!(et != null && et.isEmpty()))
eventTypes.addParameter("supportedEventType_"+i, et);
}


Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/xquery/lookupService/GenericXQueryExpression.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/xquery/lookupService/GenericXQueryExpression.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/xquery/lookupService/GenericXQueryExpression.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -100,7 +100,7 @@

//WHERE expression

- if (conditions.size()>0) {
+ if (!conditions.isEmpty()) {
xq.append("where\n");
int i=0;
for (Condition c : conditions) {

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/BaseChaining.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/BaseChaining.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/BaseChaining.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -107,7 +107,7 @@
protected Metadata processMetadataChaining(
Metadata metadata, Map metadataMap, Metadata newMetadata) {

- if (metadata.getMetadataIdRef() != "") {
+ if (!metadata.getMetadataIdRef().isEmpty()) {

Metadata chainedMetadata = (Metadata)
metadataMap.get(metadata.getMetadataIdRef());
merge(metadata, chainedMetadata, newMetadata);

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/EchoRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/EchoRequest.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/EchoRequest.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -76,7 +76,7 @@
Message respMessage = mergeMultipleResponses(output);

//if no metadata inside, print error
- if (respMessage.getMetadataMap().values().size() == 0) {
+ if (respMessage.getMetadataMap().values().isEmpty()) {
ResultCodesUtil.createResultCodeMetadata(
respMessage,
new PerfSONARException(
@@ -117,7 +117,7 @@

if (eventType.getEventType().trim().equals(ECHO_NAMESPACE)) {
response = executeSimpleEcho();
- } else if (eventType.getEventType().trim().equals("")) {
+ } else if (eventType.getEventType().trim().isEmpty()) {
response = getEmptyEventTypeResponse();
} else {
response = serviceEngine.takeAction(getType(), request);

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -59,7 +59,7 @@
//prevent endless loop
if (metadata.getSubject() != null) {

- if (!("".equals(metadata.getSubject().getMetadataIdRef()))&&
+ if (!(metadata.getSubject().getMetadataIdRef() != null &&
metadata.getSubject().getMetadataIdRef().isEmpty())&&

!(metadata.getId().equals(metadata.getSubject().getMetadataIdRef()))) {

getChaining(
@@ -67,7 +67,7 @@
metadata.getSubject().getMetadataIdRef(),
metadatas);

- } else if
(metadata.getSubject().getChildrenByType("link").size() != 0) {
+ } else if
(!metadata.getSubject().getChildrenByType("link").isEmpty()) {

Link link = (Link)
metadata.getSubject().getChildrenByType("link").get(0);
Node[] nodeArray = (Node[]) link.getNodeArray();
@@ -86,7 +86,7 @@
String chainedMetadataId = metadata.getMetadataIdRef();

//get other chain, prevent endless loop
- if (!("".equals(chainedMetadataId))&&
+ if (!(chainedMetadataId != null && chainedMetadataId.isEmpty())&&
!(metadata.getId().equals(chainedMetadataId))) {
getChaining(inputMessage, chainedMetadataId, metadatas);
}
@@ -106,7 +106,7 @@
for (Metadata metadata : collection) {

if ((subject = metadata.getSubject()) != null)
- if ((nodes = subject.getChildrenByType("node")).size() == 0)
+ if ((nodes = subject.getChildrenByType("node")).isEmpty())
continue;
else if ((node = (Node)nodes.get(0)) != null )
if (nodeId.equals(node.getId()))

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LookupInfoRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LookupInfoRequest.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LookupInfoRequest.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -95,7 +95,7 @@
Message respMessage = mergeMultipleResponses(output);

//if no metadata inside, print error
- if (respMessage.getMetadataMap().values().size() == 0) {
+ if (respMessage.getMetadataMap().values().isEmpty()) {
ResultCodesUtil.createResultCodeMetadata(
respMessage,
new PerfSONARException(

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -133,7 +133,7 @@
Message respMessage = mergeMultipleResponses(output);

//if no metadata inside, print error
- if (respMessage.getMetadataMap().values().size() == 0) {
+ if (respMessage.getMetadataMap().values().isEmpty()) {
ResultCodesUtil.createResultCodeMetadata(
respMessage,
new PerfSONARException(
@@ -327,7 +327,7 @@
//metadataIdRef in Subject
//prevent endless loop
if (metadata.getSubject() != null) {
- if (!("".equals(metadata.getSubject().getMetadataIdRef()))&&
+ if (!(metadata.getSubject().getMetadataIdRef() != null &&
metadata.getSubject().getMetadataIdRef().isEmpty())&&

!(metadata.getId().equals(metadata.getSubject().getMetadataIdRef()))) {

getChaining(
@@ -340,7 +340,7 @@
String chainedMetadataId = metadata.getMetadataIdRef();

//get other chain, prevent endless loop
- if (!("".equals(chainedMetadataId))&&
+ if (!(chainedMetadataId != null && chainedMetadataId.isEmpty())&&
!(metadata.getId().equals(chainedMetadataId))) {
getChaining(inputMessage, chainedMetadataId, metadatas);
}

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/GenericServiceLSRegistrator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/GenericServiceLSRegistrator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/GenericServiceLSRegistrator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -78,7 +78,7 @@
"GenericServiceLSRegistrator: Lookup Service URL is null"
);
}
- if ("".equals(lsUrl)) {
+ if (lsUrl != null && lsUrl.isEmpty()) {
throw new PerfSONARException(
"error.lsregistrator.no_ls_url",
"GenericServiceLSRegistrator: Lookup Service URL is empty"

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSListAddresses.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSListAddresses.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSListAddresses.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -30,7 +30,7 @@
String[] u = multiUrlString.split(",");
for (String urlString : u) {
String s = urlString.trim();
- if (s.length() > 0)
+ if (!s.isEmpty())
urls.add(s);
}
} catch (RuntimeException ex) { }
@@ -49,7 +49,7 @@
String[] u = multiUrlString.split(",");
for (String urlString : u) {
String s = urlString.trim();
- if (s.length() > 0)
+ if (!s.isEmpty())
try {
addFromURL(urls, s);
} catch (Exception ex) { /* just omit */ }
@@ -75,7 +75,7 @@
while ((line = in.readLine()) != null) {
try {
String s = line.trim();
- if (s.length() > 0) {
+ if (!s.isEmpty()) {
System.out.println(line);
urls.add(line);
}

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSRegistrationComponent.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSRegistrationComponent.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -246,7 +246,7 @@
String registrationFile = configuration
.getProperty(LSRegistrationComponent.REGISTRATION_FILE);

- if (registrationFile != null && registrationFile.length() > 0) {
+ if (registrationFile != null && !registrationFile.isEmpty()) {
return new InformationXMLFileServiceContent(registrationFile);
}
return null;
@@ -274,7 +274,7 @@
} catch (PerfSONARException e) {
logger.debug("LSRegistrationComponent:
service.ls.service_content_type could not be read.");
}
- if (contentType == null || contentType.trim().equals("")) {
+ if (contentType == null || contentType.trim().isEmpty()) {
return null;
}
return contentType;

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -351,7 +351,7 @@

if (domain.charAt(current) == '.') {
String subdomain = domain.substring(current+1);
- if (!"".equals(subdomain))
+ if (subdomain != null && !subdomain.isEmpty())
list.add(subdomain);
limit--;
}

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHTTPAccess.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHTTPAccess.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHTTPAccess.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -230,7 +230,7 @@
if (content!=null) {
str=content;
//add to list
- if (!("".equals(str)))
+ if (!(str != null && str.isEmpty()))
responseList.add(str);
if (debug) System.out.println("[D] Removed
<exist:value>");
}
@@ -259,7 +259,7 @@
result = response.toString();

//convert result list (if only exist:value) to String[]
- if (responseList.size()>0)
+ if (!responseList.isEmpty())
resultArray = responseList.
toArray(new String[responseList.size()]);


Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/HTTPAccess.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/HTTPAccess.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/HTTPAccess.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -178,7 +178,7 @@

if (password==null) password=""; //if null make it empty String

- if (!("".equals(username))) {
+ if (!(username != null && username.isEmpty())) {
if (debug) System.out.println("[D] authorization Basic "+
username+":"+password);


Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -100,7 +100,7 @@
+ "No metadata in the metadata configuration");

if (xmlResults.length == 1)
- if (xmlResults[0].trim().equals(""))
+ if (xmlResults[0].trim().isEmpty())
throw new PerfSONARException(
"warning.ma.metadata_configuration",
"MetadataConfigurationStorageManager.fetch: "
@@ -112,7 +112,7 @@
//logger.debug("MetadataConfigurationStorageManager.fetch: xml
result: "
// + xmlResults[i]);

- if (xmlResult1.trim().equals("")) continue;
+ if (xmlResult1.trim().isEmpty()) continue;

String xmlResult =
"<nmwg:message
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";> "
@@ -150,7 +150,7 @@
+ query);

// if query is an empty string then the method returns empty message
- if (query.trim().equals(""))
+ if (query.trim().isEmpty())
throw new PerfSONARException(
"error.ma.query",
"MetadataConfigurationStorageManager.fetchXmlStorage: "
@@ -310,7 +310,7 @@
for (Data data : collection) {

metadataIdRef = data.getMetadataIdRef();
- if ("".equals(metadataIdRef.trim())) continue;
+ if (metadataIdRef.trim() != null &&
metadataIdRef.trim().isEmpty()) continue;

metadata = dataSet.getMetadata(metadataIdRef);
if (metadata == null) continue;
@@ -379,7 +379,7 @@
} catch (Exception ex) {
}

- if (xmldbAccess == null || xmldbAccess.equals(""))
+ if (xmldbAccess == null || xmldbAccess.isEmpty())
xmldbAccess = "http";

XmlDbDataRepository dataRepository =

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -25,8 +25,8 @@

public Key getKey(Metadata metadata, Data data) throws
PerfSONARException {

- if (metadata.getSubject() != null &&
- metadata.getSubject().getChildrenByType("link").size() == 0)
return null;
+ if (metadata.getSubject() != null &&
+ metadata.getSubject().getChildrenByType("link").isEmpty())
return null;

if (metadata.getEventType() == null) return null;

@@ -43,7 +43,7 @@
} catch (Exception ex) {
}

- if (!ibatisServiceConfigParameter.trim().equals("")) {
+ if (!ibatisServiceConfigParameter.trim().isEmpty()) {
ibatisConfig = new Parameter();
ibatisConfig.setParameterName("ibatisConfig");
ibatisConfig.setParameterValue(ibatisServiceConfigParameter);
@@ -100,7 +100,7 @@

String ibatisConfigStr = eventType.getIbatisConfig();

- if (ibatisConfigStr == null || ibatisConfigStr.trim().equals(""))
+ if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty())
return null;

Parameter ibatisConfig = new Parameter();

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/MetadataKeyGeneratorFactory.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/MetadataKeyGeneratorFactory.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/MetadataKeyGeneratorFactory.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -45,7 +45,7 @@
String className = eventType.getMetadataKeyGenerator();


- if (className == null || className.trim().equals(""))
+ if (className == null || className.trim().isEmpty())
throw new PerfSONARException(
"error.ma.event_type_mapping_configuration",
"MetadataKeyGeneratorFactory.getMetadataKeyGenerator: "

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -133,19 +133,19 @@
+ " for $i in //nmwg:metadata \n"
+ " where 1
\n";

- if (eventType != "")
+ if (!eventType.isEmpty())
xQuery += "and $i/nmwg:eventType[(text()='" + eventType +
"')]";

- if (src != "")
+ if (!src.isEmpty())
xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";

- if (dst != "")
+ if (!dst.isEmpty())
xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";

Set<String> keySet = parametersMap.keySet();
for(String key : keySet){
String v = parametersMap.get(key);
- if(v.length() > 0){
+ if(!v.isEmpty()){
xQuery += "and
$i/bwctl:parameters/nmwg:parameter[(text()='" + v + "' and @name='"+key+"') "
+ "or (@value='" + v + "' and
@name='"+key+"')]";
}

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
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -112,7 +112,7 @@
if (keywordParameter != null) {

keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
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')] ";
}

@@ -132,7 +132,7 @@
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

try {
- ifAddressType =
(!interf.getIfAddressElement().getType().trim().equals("") ?
interf.getIfAddressElement().getType().trim(): null);
+ ifAddressType =
(!interf.getIfAddressElement().getType().trim().isEmpty() ?
interf.getIfAddressElement().getType().trim(): null);
} catch (Exception ex) {
ifAddressType = null;
}
@@ -207,62 +207,62 @@
+ keywordQueryPart;

if (ipAddress != null) {
- if (ipAddress.equals(""))
+ if (ipAddress.isEmpty())
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(""))
+ if (hostName.isEmpty())
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(""))
+ if (ifName.isEmpty())
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.isEmpty())
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)
+ if (ifAddress.isEmpty() && ifAddressType == null)
throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.equals(""))
+ if (!ifAddress.isEmpty())
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
}

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

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

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
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -113,7 +113,7 @@
if (keywordParameter != null) {

keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
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')] ";
}

@@ -133,7 +133,7 @@
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

try {
- ifAddressType =
(!interf.getIfAddressElement().getType().trim().equals("") ?
interf.getIfAddressElement().getType().trim(): null);
+ ifAddressType =
(!interf.getIfAddressElement().getType().trim().isEmpty() ?
interf.getIfAddressElement().getType().trim(): null);
} catch (Exception ex) {
ifAddressType = null;
}
@@ -207,62 +207,62 @@
+ keywordQueryPart;

if (ipAddress != null) {
- if (ipAddress.equals(""))
+ if (ipAddress.isEmpty())
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(""))
+ if (hostName.isEmpty())
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(""))
+ if (ifName.isEmpty())
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 != null) {
- if (ifDescription.equals(""))
+ if (ifDescription.isEmpty())
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 != null) {
- if (ifAddress.equals("") && ifAddressType == null)
+ if (ifAddress.isEmpty() && ifAddressType == null)
throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.equals(""))
+ if (!ifAddress.isEmpty())
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
}

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

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

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/IperfQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/IperfQueryGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/IperfQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -112,7 +112,7 @@
if (keywordParameter != null) {

keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
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')] ";
}

@@ -216,25 +216,25 @@

if (src != null) {

- if (src.equals(""))
+ if (src.isEmpty())
throw new PerfSONARException("error.ma.query",
"IperfQueryGenerator.getMetadataQuery: wrong src");
xQuery += "and
($i/iperf:subject/nmwgt:endPointPair/nmwgt:src[functx:trim(text())='" + src +
"'] or $i/iperf:subject/nmwgt:endPointPair/nmwgt:src[functx:trim(@value)='" +
src + "']) ";

- if (!sourceElement.getPort().trim().equals(""))
+ if (!sourceElement.getPort().trim().isEmpty())
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:src[functx:trim(@port)='" +
sourceElement.getPort().trim() + "'] ";
- if (!sourceElement.getType().trim().equals(""))
+ if (!sourceElement.getType().trim().isEmpty())
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:src[functx:trim(@type)='" +
sourceElement.getType().trim() + "'] ";
}

if (dst != null) {

- if (dst.equals(""))
+ if (dst.isEmpty())
throw new PerfSONARException("error.ma.query",
"IperfQueryGenerator.getMetadataQuery: wrong src");
xQuery += "and
($i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(text())='" + dst +
"'] or $i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(@value)='" +
dst + "'])";

- if (!destinationElement.getPort().trim().equals(""))
+ if (!destinationElement.getPort().trim().isEmpty())
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(@port)='" +
destinationElement.getPort().trim() + "'] ";
- if (!destinationElement.getType().trim().equals(""))
+ if (!destinationElement.getType().trim().isEmpty())
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(@type)='" +
destinationElement.getType().trim() + "'] ";
}

@@ -242,7 +242,7 @@
Set<String> keySet = iperfParametersMap.keySet();
for(String key : keySet){
String v = iperfParametersMap.get(key);
- if (v.length() > 0) {
+ if (!v.isEmpty()) {
xQuery += "and $i/iperf:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='" + key + "') "
+ "or (@value='" + v + "' and @name='" + key + "')] ";
}

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -110,7 +110,7 @@
if (keywordParameter != null) {

String keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
keywordQueryPart = " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword') or (functx:trim(@value)='" + keyword + "' and
functx:trim(@name)='keyword')] \n";
}

@@ -169,7 +169,7 @@
}


- if (linkGlobalName != "") {
+ if (!linkGlobalName.isEmpty()) {

xQuery = ""
+ "\n"
@@ -269,17 +269,17 @@


String node1 = null;
- if (node1Name == "" && node1Country == "" && node1City == ""
&& node1Institution == "")
+ if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty())
node1 = " let $node1_metadata := '' \n"
+ " let $node1_id := '' ";
else
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!node1Name.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node1Name + "') \n" : "")
+ + (!node1Country.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node1Country + "') \n" : "")
+ + (!node1City.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node1City + "') \n" : "")
+ + (!node1Institution.isEmpty() ? " 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"
@@ -290,17 +290,17 @@


String node2 = null;
- if (node2Name == "" && node2Country == "" && node2City == ""
&& node2Institution == "")
+ if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty())
node2 = " let $node2_metadata := '' \n"
+ " let $node2_id := '' ";
else
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!node2Name.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node2Name + "') \n" : "")
+ + (!node2Country.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node2Country + "') \n" : "")
+ + (!node2City.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node2City + "') \n" : "")
+ + (!node2Institution.isEmpty() ? " 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"
@@ -371,17 +371,17 @@
}

String node = null;
- if (nodeName == "" && nodeCountry == "" && nodeCity == "" &&
nodeInstitution == "")
+ if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty())
node = " let $node_metadata := '' \n"
+ " let $node_id := '' ";
else
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!nodeName.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + nodeName + "') \n" : "")
+ + (!nodeCountry.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + nodeCountry + "') \n" : "")
+ + (!nodeCity.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + nodeCity + "') \n" : "")
+ + (!nodeInstitution.isEmpty() ? " 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"

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -113,7 +113,7 @@
if (keywordParameter != null) {

String keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
keywordQueryPart = " and
$k/nmwg:parameters/nmwg:parameter[(functx:trim(text())='"+ keyword +"' and
functx:trim(@name)='keyword') or (functx:trim(@value)='" + keyword + "' and
functx:trim(@name)='keyword')] \n";
}

@@ -173,7 +173,7 @@
}


- if (linkGlobalName != "") {
+ if (!linkGlobalName.isEmpty()) {

xQuery = ""
+ "\n"
@@ -273,17 +273,17 @@


String node1 = null;
- if (node1Name == "" && node1Country == "" && node1City == ""
&& node1Institution == "")
+ if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty())
node1 = " let $node1_metadata := '' \n"
+ " let $node1_id := '' ";
else
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!node1Name.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node1Name + "') \n" : "")
+ + (!node1Country.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node1Country + "') \n" : "")
+ + (!node1City.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node1City + "') \n" : "")
+ + (!node1Institution.isEmpty() ? " 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"
@@ -294,17 +294,17 @@


String node2 = null;
- if (node2Name == "" && node2Country == "" && node2City == ""
&& node2Institution == "")
+ if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty())
node2 = " let $node2_metadata := '' \n"
+ " let $node2_id := '' ";
else
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!node2Name.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + node2Name + "') \n" : "")
+ + (!node2Country.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + node2Country + "') \n" : "")
+ + (!node2City.isEmpty() ? " and
functx:trim(fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + node2City + "') \n" : "")
+ + (!node2Institution.isEmpty() ? " 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"
@@ -375,17 +375,17 @@
}

String node = null;
- if (nodeName == "" && nodeCountry == "" && nodeCity == "" &&
nodeInstitution == "")
+ if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty())
node = " let $node_metadata := '' \n"
+ " let $node_id := '' ";
else
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\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" : "")
+ + (!nodeName.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name))
= fn:lower-case('" + nodeName + "') \n" : "")
+ + (!nodeCountry.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country))
= fn:lower-case('" + nodeCountry + "') \n" : "")
+ + (!nodeCity.isEmpty() ? " and
functx:trim(fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city))
= fn:lower-case('" + nodeCity + "') \n" : "")
+ + (!nodeInstitution.isEmpty() ? " 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"

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/MetadataQueryGeneratorFactory.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/MetadataQueryGeneratorFactory.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/MetadataQueryGeneratorFactory.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -61,7 +61,7 @@
// + "class name for eventType (" + eventTypeName + "): "
// + className);

- if (className == null || className.trim().equals(""))
+ if (className == null || className.trim().isEmpty())
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/OwampQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/OwampQueryGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/OwampQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -138,19 +138,19 @@
+ " where 1
\n";


- if (eventType != "")
+ if (!eventType.isEmpty())
xQuery += "and $i/nmwg:eventType[(text()='" + eventType +
"')]";

- if (src != "")
+ if (!src.isEmpty())
xQuery += "and
$i/owamp:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";

- if (dst != "")
+ if (!dst.isEmpty())
xQuery += "and
$i/owamp:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";

Set<String> keySet = parametersMap.keySet();
for(String key : keySet){
String v = parametersMap.get(key);
- if(v.length() > 0){
+ if(!v.isEmpty()){
xQuery += "and
$i/owamp:parameters/nmwg:parameter[(text()='" + v + "' and @name='"+key+"') "
+ "or (@value='" + v + "' and
@name='"+key+"')]";
}

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -136,19 +136,19 @@
+ " where 1
\n";


- if (eventType != "")
+ if (!eventType.isEmpty())
xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";

- if (src != "")
+ if (!src.isEmpty())
xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";

- if (dst != "")
+ if (!dst.isEmpty())
xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";

Set<String> keySet = parametersMap.keySet();
for (String key : keySet) {
String v = parametersMap.get(key);
- if (v.length() > 0){
+ if (!v.isEmpty()){
xQuery += "and $i/ping:parameters/nmwg:parameter[(text()='"
+ v + "' and @name='"+key+"') "
+ "or (@value='" + v + "' and @name='"+key+"')]";
}

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
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -112,7 +112,7 @@
if (keywordParameter != null) {

keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().equals(""))
+ if (!keyword.trim().isEmpty())
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')] ";
}

@@ -132,7 +132,7 @@
capacity = (interf.getCapacityElement() != null
? interf.getCapacityElement().getCapacity().trim() : null);

try {
- ifAddressType =
(!interf.getIfAddressElement().getType().trim().equals("") ?
interf.getIfAddressElement().getType().trim(): null);
+ ifAddressType =
(!interf.getIfAddressElement().getType().trim().isEmpty() ?
interf.getIfAddressElement().getType().trim(): null);
} catch (Exception ex) {
ifAddressType = null;
}
@@ -215,62 +215,62 @@
+ keywordQueryPart;

if (ipAddress != null) {
- if (ipAddress.equals(""))
+ if (ipAddress.isEmpty())
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 != null) {
- if (hostName.equals(""))
+ if (hostName.isEmpty())
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 != null) {
- if (ifName.equals(""))
+ if (ifName.isEmpty())
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 != null) {
- if (ifDescription.equals(""))
+ if (ifDescription.isEmpty())
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 != null) {
- if (ifAddress.equals("") && ifAddressType == null)
+ if (ifAddress.isEmpty() && ifAddressType == null)
throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.equals(""))
+ if (!ifAddress.isEmpty())
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
}

if (ifIndex != null) {
- if (ifIndex.equals(""))
+ if (ifIndex.isEmpty())
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 != null) {
- if (type.equals(""))
+ if (type.isEmpty())
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 != null) {
- if (direction.equals(""))
+ if (direction.isEmpty())
throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong direction");
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:direction[functx:trim(text())='" +
direction + "'] ";
}

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

Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-09-11 07:41:41 UTC (rev 6001)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-09-11 07:41:42 UTC (rev 6002)
@@ -129,7 +129,7 @@

if (lsURLArray != null) {
for (String aLsURLArray : lsURLArray) {
- if (!aLsURLArray.trim().equals("")) {
+ if (!aLsURLArray.trim().isEmpty()) {
registrator.register(aLsURLArray);
}
}
@@ -161,7 +161,7 @@
try {
lsURL = configuration.getProperty("service.r.ls_url");
if (lsURL != null)
- if (!lsURL.trim().equals(""))
+ if (!lsURL.trim().isEmpty())
lsURLArray = lsURL.split(",");
} catch (PatternSyntaxException ex) {
throw new PerfSONARException(



  • [pS-dev] [GEANT/SA2/ps-java-services] r6002 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar-java-sql- ma/src/main/java/org/perfsonar/service/measurementArchive/ sqlType/fetch perfsonar-java-sql-ma/src/main/java/org/perf sonar/service/measurementArchive/sqlType/nmwg perfsonar-ja va-sql-ma/src/main/java/org/perfsonar/service/measurementA rchive/sqlType/store perfsonar_base/src/main/java/org/pe rfsonar/base/auxiliary perfsonar_base/src/main/java/org/ perfsonar/base/auxiliary/components/authn perfsonar_base /src/main/java/org/perfsonar/base/auxiliary/components/aut hn/wssec perfsonar_base/src/main/java/org/perfsonar/base /auxiliary/components/scheduler perfsonar_base/src/main/ java/org/perfsonar/base/nmwg/owamp perfsonar_base/src/ma in/java/org/perfsonar/client/base/authn/saslca perfsonar _base/src/main/java/org/perfsonar/client/base/requests/l ookupService perfsonar_base/src/main/java/org/perfsonar/ client/base/xquery/lookupService per fsonar_base/src/mai n/java/org/perfsonar/service/base/messages perfsonar_bas e/src/main/java/org/perfsonar/service/base/registration pe rfsonar_base/src/main/java/org/perfsonar/service/base/st orage/xmldb/exist/rest perfsonar_base/src/main/java/org/ perfsonar/service/measurementArchive/metadataConfig perfso nar_base/src/main/java/org/perfsonar/service/measurement Archive/metadataConfig/keyGenerator perfsonar_base/src/m ain/java/org/perfsonar/service/measurementArchive/metadata Config/queryGenerator perfsonar_base/src/main/java/org/p erfsonar/service/measurementArchive/register, svn-noreply, 09/11/2012

Archive powered by MHonArc 2.6.16.

Top of Page