perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6012 - 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/store perfsonar _base/src/main/java/org/perfsonar/base/auxiliary perfson ar_base/src/main/java/org/perfsonar/base/auxiliary/compo nents/authn perfsonar_base/src/main/java/org/perfsonar/b ase/auxiliary/components/scheduler perfsonar_base/src/ma in/java/org/perfsonar/base/auxiliary/components/simplesche duler perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/base/util/ iptrie perfsonar_base/src/main/java/org/perfsonar/client /base/requests/lookupService perfsonar_base/src/main/jav a/org/perfsonar/client/base/xquery/lookupService perfsonar _base/src/main/java/org/perfsonar/client/testHarness per fsonar_base/src/main/java/org/perfsona r/service/base/au thn perfsonar_base/src/main/java/org/perfsonar/service/b ase/authn/tokens perfsonar_base/src/main/java/org/perfso nar/service/base/messages perfsonar_base/src/main/java/o rg/perfsonar/service/base/registration perfsonar_base/sr c/main/java/org/perfsonar/service/base/storage/xmldb perfs onar_base/src/main/java/org/perfsonar/service/base/stora ge/xmldb/exist/rest perfsonar_base/src/main/java/org/per fsonar/service/base/storage/xmldb/exist/xmlrpc perfsonar _base/src/main/java/org/perfsonar/service/base/storage/x mlfile perfsonar_base/src/main/java/org/perfsonar/servic e/base/transport perfsonar_base/src/main/java/org/perfso nar/service/base/util perfsonar_base/src/main/java/org/p erfsonar/service/base/web perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/metadataConfig per fsonar_base/src/main/java/org/perfsonar/service/measurem entArchive/metadataConfig/keyGenerator perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/metad ataConfig/quer yGenerator perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/register
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r6012 - 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/store perfsonar _base/src/main/java/org/perfsonar/base/auxiliary perfson ar_base/src/main/java/org/perfsonar/base/auxiliary/compo nents/authn perfsonar_base/src/main/java/org/perfsonar/b ase/auxiliary/components/scheduler perfsonar_base/src/ma in/java/org/perfsonar/base/auxiliary/components/simplesche duler perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/base/util/ iptrie perfsonar_base/src/main/java/org/perfsonar/client /base/requests/lookupService perfsonar_base/src/main/jav a/org/perfsonar/client/base/xquery/lookupService perfsonar _base/src/main/java/org/perfsonar/client/testHarness per fsonar_base/src/main/java/org/perfsona r/service/base/au thn perfsonar_base/src/main/java/org/perfsonar/service/b ase/authn/tokens perfsonar_base/src/main/java/org/perfso nar/service/base/messages perfsonar_base/src/main/java/o rg/perfsonar/service/base/registration perfsonar_base/sr c/main/java/org/perfsonar/service/base/storage/xmldb perfs onar_base/src/main/java/org/perfsonar/service/base/stora ge/xmldb/exist/rest perfsonar_base/src/main/java/org/per fsonar/service/base/storage/xmldb/exist/xmlrpc perfsonar _base/src/main/java/org/perfsonar/service/base/storage/x mlfile perfsonar_base/src/main/java/org/perfsonar/servic e/base/transport perfsonar_base/src/main/java/org/perfso nar/service/base/util perfsonar_base/src/main/java/org/p erfsonar/service/base/web perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/metadataConfig per fsonar_base/src/main/java/org/perfsonar/service/measurem entArchive/metadataConfig/keyGenerator perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/metad ataConfig/quer yGenerator perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/register
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6012 - 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/store perfsonar _base/src/main/java/org/perfsonar/base/auxiliary perfson ar_base/src/main/java/org/perfsonar/base/auxiliary/compo nents/authn perfsonar_base/src/main/java/org/perfsonar/b ase/auxiliary/components/scheduler perfsonar_base/src/ma in/java/org/perfsonar/base/auxiliary/components/simplesche duler perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/base/util/ iptrie perfsonar_base/src/main/java/org/perfsonar/client /base/requests/lookupService perfsonar_base/src/main/jav a/org/perfsonar/client/base/xquery/lookupService perfsonar _base/src/main/java/org/perfsonar/client/testHarness per fsonar_base/src/main/java/org/perfsona r/service/base/au thn perfsonar_base/src/main/java/org/perfsonar/service/b ase/authn/tokens perfsonar_base/src/main/java/org/perfso nar/service/base/messages perfsonar_base/src/main/java/o rg/perfsonar/service/base/registration perfsonar_base/sr c/main/java/org/perfsonar/service/base/storage/xmldb perfs onar_base/src/main/java/org/perfsonar/service/base/stora ge/xmldb/exist/rest perfsonar_base/src/main/java/org/per fsonar/service/base/storage/xmldb/exist/xmlrpc perfsonar _base/src/main/java/org/perfsonar/service/base/storage/x mlfile perfsonar_base/src/main/java/org/perfsonar/servic e/base/transport perfsonar_base/src/main/java/org/perfso nar/service/base/util perfsonar_base/src/main/java/org/p erfsonar/service/base/web perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/metadataConfig per fsonar_base/src/main/java/org/perfsonar/service/measurem entArchive/metadataConfig/keyGenerator perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/metad ataConfig/quer yGenerator perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/register
- Date: Fri, 5 Oct 2012 10:22:48 +0100 (BST)
Author: nordunet.behrmann
Date: 2012-10-05 10:22:48 +0100 (Fri, 05 Oct 2012)
New Revision: 6012
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/BwctlResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/DiscardsResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ErrorsResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/GenericResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/IperfResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.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/PingResponseGenerator.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/fetch/UtilizationResponseGenerator.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/StoreRequestProcessFactory.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/AuxiliaryComponentManager.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/scheduler/Scheduler.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/simplescheduler/SchedulerTask.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/MathUtil.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/NetUtil.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/TimeDateUtil.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/IpTrie.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/Trie.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/TrieNode.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/EchoRequestGenerator.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/client/testHarness/SOAPClientMulti.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AttrResponse.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.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/MessageHandlerFactory.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/InformationExistDbXmlrpcServiceContent.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/XmlDbResult.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/ExistDbHttpXmlStorageManager.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/base/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmlfile/XmlFileStorageManager.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/transport/SSHFileTransport.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/util/ResultCodesUtil.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.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/SimpleMetadataConfigurationStorageManager.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.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:
perfsonar_base, perfsonar-java-sql-ma: Use explicit braces on control flow
statements
Braces make the code easier to read and help prevent errors when modifying
the code.
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -34,8 +34,9 @@
String mergerName = aMergerNamesArray.trim();
- if (mergerName.isEmpty())
+ if (mergerName.isEmpty()) {
continue;
+ }
BaseChaining baseChainingMerger;
try {
@@ -62,7 +63,9 @@
}
- if (baseChainingMergers.isEmpty()) 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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -62,16 +62,18 @@
Subject m2_subject = metadata2.getSubject();
String subjectClassName = "";
- if (m1_subject != null)
+ if (m1_subject != null) {
subjectClassName = m1_subject.getClass().getName();
- else if (m2_subject != null)
+ } else if (m2_subject != null) {
subjectClassName = m2_subject.getClass().getName();
+ }
- if
(subjectClassName.equals("org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject"))
+ if
(subjectClassName.equals("org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject"))
{
mergeMetadataWithUtilSubject(metadata1, metadata2, newMetadata);
- else if
(subjectClassName.equals("org.ggf.ns.nmwg.ops.select.v2_0.Subject"))
+ } else if
(subjectClassName.equals("org.ggf.ns.nmwg.ops.select.v2_0.Subject")) {
mergeMetadataWithSelectSubject(metadata1, metadata2,
newMetadata);
+ }
}
@@ -187,17 +189,39 @@
((org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject)
newMetadata.getSubject()).getInterface();
- if (m1_ipAddress != null)
newInterf.setIpAddressElement(m1_ipAddress);
- if (m1_hostName != null)
newInterf.setHostNameElement(m1_hostName);
- if (m1_ifName != null) newInterf.setIfNameElement(m1_ifName);
- if (m1_ifDescription != null)
newInterf.setIfDescriptionElement(m1_ifDescription);
- if (m1_ifAddress != null)
newInterf.setIfAddressElement(m1_ifAddress);
- if (m1_ifIndex != null)
newInterf.setIfIndexElement(m1_ifIndex);
- if (m1_type != null) newInterf.setTypeElement(m1_type);
- if (m1_direction != null)
newInterf.setDirectionElement(m1_direction);
- if (m1_authRealm != null)
newInterf.setAuthRealmElement(m1_authRealm);
- if (m1_classOfService != null)
newInterf.setClassOfServiceElement(m1_classOfService);
- if (m1_capacity != null)
newInterf.setCapacityElement(m1_capacity);
+ if (m1_ipAddress != null) {
+ newInterf.setIpAddressElement(m1_ipAddress);
+ }
+ if (m1_hostName != null) {
+ newInterf.setHostNameElement(m1_hostName);
+ }
+ if (m1_ifName != null) {
+ newInterf.setIfNameElement(m1_ifName);
+ }
+ if (m1_ifDescription != null) {
+ newInterf.setIfDescriptionElement(m1_ifDescription);
+ }
+ if (m1_ifAddress != null) {
+ newInterf.setIfAddressElement(m1_ifAddress);
+ }
+ if (m1_ifIndex != null) {
+ newInterf.setIfIndexElement(m1_ifIndex);
+ }
+ if (m1_type != null) {
+ newInterf.setTypeElement(m1_type);
+ }
+ if (m1_direction != null) {
+ newInterf.setDirectionElement(m1_direction);
+ }
+ if (m1_authRealm != null) {
+ newInterf.setAuthRealmElement(m1_authRealm);
+ }
+ if (m1_classOfService != null) {
+ newInterf.setClassOfServiceElement(m1_classOfService);
+ }
+ if (m1_capacity != null) {
+ newInterf.setCapacityElement(m1_capacity);
+ }
}
}
@@ -208,17 +232,39 @@
((org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject)
newMetadata.getSubject()).getInterface();
- if (m2_ipAddress != null)
newInterf.setIpAddressElement(m2_ipAddress);
- if (m2_hostName != null)
newInterf.setHostNameElement(m2_hostName);
- if (m2_ifName != null) newInterf.setIfNameElement(m2_ifName);
- if (m2_ifDescription != null)
newInterf.setIfDescriptionElement(m2_ifDescription);
- if (m2_ifAddress != null)
newInterf.setIfAddressElement(m2_ifAddress);
- if (m2_ifIndex != null)
newInterf.setIfIndexElement(m2_ifIndex);
- if (m2_type != null) newInterf.setTypeElement(m2_type);
- if (m2_direction != null)
newInterf.setDirectionElement(m2_direction);
- if (m2_authRealm != null)
newInterf.setAuthRealmElement(m2_authRealm);
- if (m2_classOfService != null)
newInterf.setClassOfServiceElement(m2_classOfService);
- if (m2_capacity != null)
newInterf.setCapacityElement(m2_capacity);
+ if (m2_ipAddress != null) {
+ newInterf.setIpAddressElement(m2_ipAddress);
+ }
+ if (m2_hostName != null) {
+ newInterf.setHostNameElement(m2_hostName);
+ }
+ if (m2_ifName != null) {
+ newInterf.setIfNameElement(m2_ifName);
+ }
+ if (m2_ifDescription != null) {
+ newInterf.setIfDescriptionElement(m2_ifDescription);
+ }
+ if (m2_ifAddress != null) {
+ newInterf.setIfAddressElement(m2_ifAddress);
+ }
+ if (m2_ifIndex != null) {
+ newInterf.setIfIndexElement(m2_ifIndex);
+ }
+ if (m2_type != null) {
+ newInterf.setTypeElement(m2_type);
+ }
+ if (m2_direction != null) {
+ newInterf.setDirectionElement(m2_direction);
+ }
+ if (m2_authRealm != null) {
+ newInterf.setAuthRealmElement(m2_authRealm);
+ }
+ if (m2_classOfService != null) {
+ newInterf.setClassOfServiceElement(m2_classOfService);
+ }
+ if (m2_capacity != null) {
+ newInterf.setCapacityElement(m2_capacity);
+ }
}
}
@@ -248,13 +294,15 @@
(org.ggf.ns.nmwg.ops.select.v2_0.Subject)
newMetadata.getSubject();
- if (m1_subject != null)
+ if (m1_subject != null) {
if (!m1_subject.getMetadataIdRef().isEmpty())
newSubject.setMetadataIdRef(m1_subject.getMetadataIdRef());
+ }
- if (m2_subject != null)
+ if (m2_subject != null) {
if (!m2_subject.getMetadataIdRef().isEmpty())
newSubject.setMetadataIdRef(m2_subject.getMetadataIdRef());
+ }
if (m1_eventType != null) {
@@ -268,8 +316,9 @@
Parameters m1_paremeters = metadata1.getParameters();
Parameters m2_paremeters = metadata2.getParameters();
org.ggf.ns.nmwg.ops.select.v2_0.Parameters newParameters = null;
- if (m1_paremeters != null || m2_paremeters != null)
+ if (m1_paremeters != null || m2_paremeters != null) {
newParameters = new org.ggf.ns.nmwg.ops.select.v2_0.Parameters();
+ }
Iterator _pIt = m1_paremeters.getParameterIterator();
while (_pIt.hasNext()) {
Parameter param = (Parameter) _pIt.next();
@@ -280,8 +329,9 @@
Parameter param = (Parameter) pIt.next();
newParameters.addParameter(param);
}
- if (newParameters != null)
+ if (newParameters != null) {
newMetadata.setParameters(newParameters);
+ }
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -100,11 +100,12 @@
throws PerfSONARException
{
- if (dataQuery == null)
+ if (dataQuery == null) {
throw new PerfSONARException(
"error.ma.query",
"SQLStorageManager.fetch: "
+ "Query message is null");
+ }
Message response = new Message();
@@ -236,10 +237,11 @@
throws PerfSONARException
{
- if (dataSet == null)
+ if (dataSet == null) {
throw new PerfSONARException(
"error.ma.query",
"SQLStorageManager.store: Input request is null");
+ }
Message response = new Message();
@@ -261,17 +263,19 @@
String ibatisConfig = (String) ibatisParams.get("ibatisConfig");
- if (ibatisConfig == null)
+ if (ibatisConfig == null) {
throw new PerfSONARException(
"error.sqlma.db_connection.ibatis",
"SQLStorageManager.store: "
+ "No ibatisConfig parameter in the key");
+ }
- if (ibatisConfig.trim().isEmpty())
+ if (ibatisConfig.trim().isEmpty()) {
throw new PerfSONARException(
"error.sqlma.db_connection.ibatis",
"SQLStorageManager.store: "
+ "Empty ibatisConfig parameter in the key");
+ }
// getting data from Datum
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLTypeMAServiceEngine.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -130,10 +130,11 @@
Metadata metadata = null;
Map metadataMap = keyMessage.getMetadataMap();
- if (metadataMap != null)
+ if (metadataMap != null) {
if (!data.getMetadataIdRef().isEmpty())
metadata = (Metadata)
metadataMap.get(data.getMetadataIdRef());
+ }
Message dReq = new Message();
Metadata dMet = new Metadata();
@@ -154,8 +155,9 @@
d.setMetadataIdRef(metadata.getId());
Collection<Metadata> metadatas = metadataMap.values();
- for (Metadata m : metadatas)
+ for (Metadata m : metadatas) {
response.addChild(m);
+ }
} else {
response.addChild(dMet);
@@ -182,7 +184,9 @@
for (Data data : collection) {
Metadata meta = (Metadata)
metadataMap.get(data.getMetadataIdRef());
- if (meta == null) continue;
+ if (meta == null) {
+ continue;
+ }
Key key = getStoreKey(meta);
@@ -218,16 +222,18 @@
{
EventType eventTypeObj = metadata.getEventType();
- if (eventTypeObj == null)
+ if (eventTypeObj == null) {
throw new PerfSONARException("error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "No eventType in the request metadata");
+ }
String eventType = eventTypeObj.getEventType().trim();
- if (eventType.isEmpty())
+ if (eventType.isEmpty()) {
throw new PerfSONARException("error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "eventType in the request metadata is empty");
+ }
Key key = metadata.getKey();
@@ -238,14 +244,17 @@
Parameter ibatisConfig = key.getParameterByName("ibatisConfig");
if (ibatisConfig == null) {
ibatisConfig = getIbatisConfig(eventType);
- if (ibatisConfig != null) key.addParameter(ibatisConfig);
+ if (ibatisConfig != null) {
+ key.addParameter(ibatisConfig);
+ }
}
- if (ibatisConfig == null)
+ if (ibatisConfig == null) {
throw new PerfSONARException(
"error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "No ibatisConfig parameter in the key");
+ }
} else {
@@ -257,12 +266,13 @@
try {
resp = metadataConfig.fetch(query);
} catch (PerfSONARException sex) {
- if
(sex.getResultCode().equals("warning.ma.metadata_configuration"))
+ if
(sex.getResultCode().equals("warning.ma.metadata_configuration")) {
resp = new Message();
- else
+ } else {
throw new PerfSONARException(
sex.getResultCode(),
sex.getResultDescription());
+ }
}
if (!resp.getDataMap().isEmpty()) {
@@ -272,8 +282,9 @@
Key k = d.getKey();
key = k;
- if (key.getParameterByName("eventType") == null)
+ if (key.getParameterByName("eventType") == null) {
key.addParameter("eventType", eventType);
+ }
} else {
// metadata does not exist in xmldb
@@ -301,7 +312,9 @@
Parameters params = metadata.getParameters();
Parameters originalParams = null;
- if (params != null) originalParams = copyParameters(params);
+ if (params != null) {
+ originalParams = copyParameters(params);
+ }
if (params == null || !params.getPrefix().equals("nmwg")) {
params = new Parameters();
@@ -315,7 +328,9 @@
} else if (params.getParameterByName("ibatisConfig") ==
null) {
ibatisConfig = getIbatisConfig(eventType);
- if (ibatisConfig != null) params.addChild(ibatisConfig);
+ if (ibatisConfig != null) {
+ params.addChild(ibatisConfig);
+ }
}
if (params.getParameterByName("ibatisConfig") == null) {
@@ -345,7 +360,9 @@
_metadata.setEventType(eventTypeObj);
// adding original parameters
- if (originalParams != null)
_metadata.setParameters(originalParams);
+ if (originalParams != null) {
+ _metadata.setParameters(originalParams);
+ }
Message configMessage = new Message();
_metadata.setId(metadataId);
@@ -398,11 +415,12 @@
org.perfsonar.service.measurementArchive.eventTypeConfig.EventType
eventType =
eventTypeConfigurationComponent.getEventType(eventTypeStr);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"SQLTypeMAServiceEngine.getIbatisConfig: "
+ "eventType " + eventTypeStr + " is not supported");
+ }
String ibatisConfigStr = eventType.getIbatisConfig();
@@ -411,8 +429,9 @@
+ "ibatisConfig parameter for eventType (" + eventTypeStr +
"): "
+ ibatisConfigStr);
- if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty())
+ if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty()) {
return null;
+ }
Parameter ibatisConfig = new Parameter();
ibatisConfig.setParameterName("ibatisConfig");
@@ -426,7 +445,9 @@
throws PerfSONARException
{
- if (!isFirstRunDone()) metadataConfig.removeAll();
+ if (!isFirstRunDone()) {
+ metadataConfig.removeAll();
+ }
((MetadataConfigurationStorageManager)
metadataConfig).storeMetadataElements(request);
((MetadataConfigurationStorageManager)
metadataConfig).storeDataElements(request);
@@ -435,7 +456,9 @@
Data dataTrigger = (Data) request.getDataIterator().next();
String dataTriggerId = "";
- if (dataTrigger != null) dataTriggerId = dataTrigger.getId();
+ if (dataTrigger != null) {
+ dataTriggerId = dataTrigger.getId();
+ }
String desc = "Metadata linked with request data trigger id='" +
dataTriggerId + "' has been stored.";
return generateResultCodeResponse("success.metadata_config_replace",
desc);
@@ -688,11 +711,13 @@
for (Message m : messageVector) {
- for (Object meta : m.getMetadataMap().values())
+ for (Object meta : m.getMetadataMap().values()) {
response.addChild((Metadata) meta);
+ }
- for (Object data : m.getDataMap().values())
+ for (Object data : m.getDataMap().values()) {
response.addChild((Data) data);
+ }
}
@@ -720,14 +745,16 @@
} catch (Exception ex) {
}
- if (mergerNames == null || mergerNames.trim().isEmpty())
+ if (mergerNames == null || mergerNames.trim().isEmpty()) {
return message;
+ }
Set baseChainingMergers =
BaseChainingMergerFactory.getBaseChainingMergers(mergerNames);
- if (baseChainingMergers == null)
+ if (baseChainingMergers == null) {
return message;
+ }
BaseChaining baseChaining;
@@ -775,11 +802,13 @@
getEventType(metadata, msg);
- for (Object m : msg.getMetadataMap().values())
+ for (Object m : msg.getMetadataMap().values()) {
message.addChild((Metadata) m);
+ }
- for (Object d : msg.getDataMap().values())
+ for (Object d : msg.getDataMap().values()) {
message.addChild((Data) d);
+ }
} else {
@@ -864,11 +893,13 @@
getEventType(metadata, msg);
- for (Object m : msg.getMetadataMap().values())
+ for (Object m : msg.getMetadataMap().values()) {
message.addChild((Metadata) m);
+ }
- for (Object d : msg.getDataMap().values())
+ for (Object d : msg.getDataMap().values()) {
message.addChild((Data) d);
+ }
} else if (key == null) {
@@ -907,15 +938,16 @@
Message response;
if (eventTypeStr.equals(ECHO_XMLDB_ACCESS_TEST_NAMESPACE)
- || eventTypeStr.equals(ECHO_XMLDB_CONTENT_TEST_NAMESPACE))
+ || eventTypeStr.equals(ECHO_XMLDB_CONTENT_TEST_NAMESPACE)) {
response = executeXmlDBSimpleTest(request, testName);
- else if (eventTypeStr.equals(ECHO_RANDOM_FETCH_TEST_NAMESPACE))
+ } else if (eventTypeStr.equals(ECHO_RANDOM_FETCH_TEST_NAMESPACE)) {
response = executeRandomFetchTest(request, testName);
- else if (eventTypeStr.equals(ECHO_SELF_TEST_NAMESPACE + "1.0"))
+ } else if (eventTypeStr.equals(ECHO_SELF_TEST_NAMESPACE + "1.0")) {
response = executeSelfTest(request);
- else
+ } else {
return generateResultCodeResponse(
"error.request", "This eventType in echo request is not
supported");
+ }
return response;
}
@@ -930,7 +962,9 @@
serviceName = configuration.getProperty("service.name");
} catch (Exception ex) {
}
- if (serviceName == null) serviceName = "pS" + serviceType;
+ if (serviceName == null) {
+ serviceName = "pS" + serviceType;
+ }
Message response;
Data data;
@@ -972,7 +1006,9 @@
serviceName = configuration.getProperty("service.name");
} catch (Exception ex) {
}
- if (serviceName == null) serviceName = "pS" + serviceType;
+ if (serviceName == null) {
+ serviceName = "pS" + serviceType;
+ }
Message keyMessage;
try {
@@ -992,12 +1028,13 @@
"No data elements in the metadata configuration");
}
Key key = keyData.getKey();
- if (key == null)
+ if (key == null) {
return generateResultCodeResponse(
ECHO_SELF_TEST_NAMESPACE + serviceType + "/" + serviceName +
"/" + testName + "/failure/1.0",
"No key in data element with id='"
+ keyData.getId()
+ "' in the metadata configuration");
+ }
Metadata metadata = new Metadata();
metadata.setKey(key);
@@ -1109,8 +1146,9 @@
for (Object d : msg.getDataMap().values()) {
Key key = ((Data) d).getKey();
- if (key.getParameters().getParameterMap().get("eventType") ==
null)
+ if (key.getParameters().getParameterMap().get("eventType") ==
null) {
key.addParameter("eventType", eventType);
+ }
}
return eventType;
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -55,44 +55,70 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("intervalEnd"))
datum.setIntervalEnd(strValue);
- else if (column.equals("intervalStart"))
datum.setIntervalStart(strValue);
- else if (column.equals("intervalUnit"))
datum.setIntervalUnit(strValue);
- else if (column.equals("numBytes"))
datum.setNumBytes(strValue);
- else if (column.equals("numBytesUnits"))
datum.setNumBytesUnits(strValue);
- else if (column.equals("timeType"))
datum.setTimeType(strValue);
- else if (column.equals("timeValue"))
datum.setTimeValue(strValue);
- else if (column.equals("value"))
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
datum.setValueUnits(strValue);
- else if (column.equals("tcpAdapterType"))
datum.setTcpAdapterType(strValue);
- else if (column.equals("tcpMSSSize"))
datum.setTcpMSSSize(strValue);
- else if (column.equals("tcpMSSUnit"))
datum.setTcpMSSUnit(strValue);
- else if (column.equals("tcpMTUUnit"))
datum.setTcpMTUUnit(strValue);
- else if (column.equals("tcpMTUSize"))
datum.setTcpMTUSize(strValue);
- else if (column.equals("tcpWindowSize"))
datum.setTcpWindowSize(strValue);
- else if (column.equals("tcpWindowUnit"))
datum.setTcpWindowUnit(strValue);
- else if (column.equals("udpBufferSize"))
datum.setUdpBufferSize(strValue);
- else if (column.equals("udpBufferUnit"))
datum.setUdpBufferUnit(strValue);
- else if (column.equals("udpJitter"))
datum.setUdpJitter(strValue);
- else if (column.equals("udpJitterUnit"))
datum.setUdpJitterUnit(strValue);
- else if (column.equals("udpPacketLoss"))
datum.setUdpPacketLoss(strValue);
- else if (column.equals("udpPacketLossPercentage"))
datum.setUdpPacketLossPercentage(strValue);
- else if (column.equals("udpPacketSent"))
datum.setUdpPacketSent(strValue);
+ if (column.equals("intervalEnd")) {
+ datum.setIntervalEnd(strValue);
+ } else if (column.equals("intervalStart")) {
+ datum.setIntervalStart(strValue);
+ } else if (column.equals("intervalUnit")) {
+ datum.setIntervalUnit(strValue);
+ } else if (column.equals("numBytes")) {
+ datum.setNumBytes(strValue);
+ } else if (column.equals("numBytesUnits")) {
+ datum.setNumBytesUnits(strValue);
+ } else if (column.equals("timeType")) {
+ datum.setTimeType(strValue);
+ } else if (column.equals("timeValue")) {
+ datum.setTimeValue(strValue);
+ } else if (column.equals("value")) {
+ datum.setValue(strValue);
+ } else if (column.equals("valueUnits")) {
+ datum.setValueUnits(strValue);
+ } else if (column.equals("tcpAdapterType")) {
+ datum.setTcpAdapterType(strValue);
+ } else if (column.equals("tcpMSSSize")) {
+ datum.setTcpMSSSize(strValue);
+ } else if (column.equals("tcpMSSUnit")) {
+ datum.setTcpMSSUnit(strValue);
+ } else if (column.equals("tcpMTUUnit")) {
+ datum.setTcpMTUUnit(strValue);
+ } else if (column.equals("tcpMTUSize")) {
+ datum.setTcpMTUSize(strValue);
+ } else if (column.equals("tcpWindowSize")) {
+ datum.setTcpWindowSize(strValue);
+ } else if (column.equals("tcpWindowUnit")) {
+ datum.setTcpWindowUnit(strValue);
+ } else if (column.equals("udpBufferSize")) {
+ datum.setUdpBufferSize(strValue);
+ } else if (column.equals("udpBufferUnit")) {
+ datum.setUdpBufferUnit(strValue);
+ } else if (column.equals("udpJitter")) {
+ datum.setUdpJitter(strValue);
+ } else if (column.equals("udpJitterUnit")) {
+ datum.setUdpJitterUnit(strValue);
+ } else if (column.equals("udpPacketLoss")) {
+ datum.setUdpPacketLoss(strValue);
+ } else if (column.equals("udpPacketLossPercentage")) {
+ datum.setUdpPacketLossPercentage(strValue);
+ } else if (column.equals("udpPacketSent")) {
+ datum.setUdpPacketSent(strValue);
+ }
}
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/DiscardsResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/DiscardsResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/DiscardsResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,26 +59,28 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("value"))
+ if (column.equals("value")) {
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
+ } else if (column.equals("valueUnits")) {
datum.setValueUnits(strValue);
- else if (column.equals("timeValue")) {
+ } else if (column.equals("timeValue")) {
datum.setTimeValue(strValue);
datum.setTimeType("unix");
}
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ErrorsResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ErrorsResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ErrorsResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,26 +59,28 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("value"))
+ if (column.equals("value")) {
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
+ } else if (column.equals("valueUnits")) {
datum.setValueUnits(strValue);
- else if (column.equals("timeValue")) {
+ } else if (column.equals("timeValue")) {
datum.setTimeValue(strValue);
datum.setTimeType("unix");
}
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/GenericResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/GenericResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/GenericResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,26 +59,28 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("value"))
+ if (column.equals("value")) {
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
+ } else if (column.equals("valueUnits")) {
datum.setValueUnits(strValue);
- else if (column.equals("timeValue")) {
+ } else if (column.equals("timeValue")) {
datum.setTimeValue(strValue);
datum.setTimeType("unix");
}
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/IperfResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/IperfResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/IperfResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -56,43 +56,48 @@
for (String column : kCollection) {
Object value = resultMap.get(column);
- if (value == null) continue;
+ if (value == null) {
+ continue;
+ }
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("value"))
+ if (column.equals("value")) {
datum.addAttr("value", strValue, null);
- else if (column.equals("valueUnits"))
+ } else if (column.equals("valueUnits")) {
datum.addAttr("valueUnits", strValue, null);
- else if (column.equals("numBytes"))
+ } else if (column.equals("numBytes")) {
datum.addAttr("numBytes", strValue, null);
- else if (column.equals("numBytesUnits"))
+ } else if (column.equals("numBytesUnits")) {
datum.addAttr("numBytesUnits", strValue, null);
- else if (column.equals("time")) {
+ } else if (column.equals("time")) {
datum.addAttr("timeValue", strValue, null);
datum.addAttr("timeType", "unix", null);
- } else if (column.equals("interv"))
+ } else if (column.equals("interv")) {
datum.addAttr("interval", strValue, null);
- else if (column.equals("throughput"))
+ } else if (column.equals("throughput")) {
datum.addAttr("throughput", strValue, null);
- else if (column.equals("jitter"))
+ } else if (column.equals("jitter")) {
datum.addAttr("jitter", strValue, null);
- else if (column.equals("loss"))
+ } else if (column.equals("loss")) {
datum.addAttr("loss", strValue, null);
+ }
//logger.debug("IperfResponseGenerator.getResponse: "
// + "column: " + column + ", value: " + strValue );
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -63,18 +63,20 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -104,37 +104,40 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
System.out.println("Here 4");
- if (column.equals("seqNum"))
+ if (column.equals("seqNum")) {
datum.setSeqNum(strValue);
- else if (column.equals("sendTime"))
+ } else if (column.equals("sendTime")) {
datum.setSendTime(strValue);
- else if (column.equals("sendSynchronized"))
+ } else if (column.equals("sendSynchronized")) {
datum.setSendSynchronized(strValue);
- else if (column.equals("sendTimeError"))
+ } else if (column.equals("sendTimeError")) {
datum.setSendTimeError(strValue);
- else if (column.equals("receiveTime"))
+ } else if (column.equals("receiveTime")) {
datum.setReceiveTime(strValue);
- else if (column.equals("receiveSynchronized"))
+ } else if (column.equals("receiveSynchronized")) {
datum.setReceiveSynchronized(strValue);
- else if (column.equals("receiveTimeError"))
+ } else if (column.equals("receiveTimeError")) {
datum.setReceiveTimeError(strValue);
- else if (column.equals("ttl"))
+ } else if (column.equals("ttl")) {
datum.setTTL(strValue);
+ }
// else if (column.equals("timeType"))
// datum.setTimeType(strValue);
// else if (column.equals("timeValue"))
@@ -156,51 +159,54 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
System.out.println("Here 4");
- if (column.equals("sender"))
+ if (column.equals("sender")) {
datum.setSender(strValue);
- else if (column.equals("receiver"))
+ } else if (column.equals("receiver")) {
datum.setReceiver(strValue);
- else if (column.equals("sent"))
+ } else if (column.equals("sent")) {
datum.setSent(strValue);
- else if (column.equals("loss"))
+ } else if (column.equals("loss")) {
datum.setLoss(strValue);
- else if (column.equals("lostPercent"))
+ } else if (column.equals("lostPercent")) {
datum.setLostPercent(strValue);
- else if (column.equals("duplicates"))
+ } else if (column.equals("duplicates")) {
datum.setDuplicates(strValue);
- else if (column.equals("minDelay"))
+ } else if (column.equals("minDelay")) {
datum.setMinDelay(strValue);
- else if (column.equals("medDelay"))
+ } else if (column.equals("medDelay")) {
datum.setMedDelay(strValue);
- else if (column.equals("maxDelay"))
+ } else if (column.equals("maxDelay")) {
datum.setMaxDelay(strValue);
- else if (column.equals("error"))
+ } else if (column.equals("error")) {
datum.setError(strValue);
- else if (column.equals("delayUnits"))
+ } else if (column.equals("delayUnits")) {
datum.setDelayUnits(strValue);
- else if (column.equals("errorUnits"))
+ } else if (column.equals("errorUnits")) {
datum.setErrorUnits(strValue);
- else if (column.equals("jitter"))
+ } else if (column.equals("jitter")) {
datum.setJitter(strValue);
- else if (column.equals("jitterUnits"))
+ } else if (column.equals("jitterUnits")) {
datum.setJitterUnits(strValue);
- else if (column.equals("hops"))
+ } else if (column.equals("hops")) {
datum.setHops(strValue);
+ }
// else if (column.equals("timeType"))
// datum.setTimeType(strValue);
// else if (column.equals("timeValue"))
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -55,29 +55,40 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("numBytes"))
datum.setNumBytes(strValue);
- else if (column.equals("numBytesUnits"))
datum.setNumBytesUnits(strValue);
- else if (column.equals("seqNum"))
datum.setSeqNum(strValue);
- else if (column.equals("value"))
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
datum.setValueUnits(strValue);
- else if (column.equals("ttl")) datum.setTTL(strValue);
- else if (column.equals("timeType"))
datum.setTimeType(strValue);
- else if (column.equals("timeValue"))
datum.setTimeValue(strValue);
+ if (column.equals("numBytes")) {
+ datum.setNumBytes(strValue);
+ } else if (column.equals("numBytesUnits")) {
+ datum.setNumBytesUnits(strValue);
+ } else if (column.equals("seqNum")) {
+ datum.setSeqNum(strValue);
+ } else if (column.equals("value")) {
+ datum.setValue(strValue);
+ } else if (column.equals("valueUnits")) {
+ datum.setValueUnits(strValue);
+ } else if (column.equals("ttl")) {
+ datum.setTTL(strValue);
+ } else if (column.equals("timeType")) {
+ datum.setTimeType(strValue);
+ } else if (column.equals("timeValue")) {
+ datum.setTimeValue(strValue);
+ }
//logger.debug("SQLStorageManager.fetch: "
// + "column: " + column + ", value: " + strValue );
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ResponseGeneratorFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -46,11 +46,12 @@
EventType eventType =
eventTypeConfigurationComponent.getEventType(eventTypeName);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"ResponseGeneratorFactory.getResponseGenerator: "
+ "eventType " + eventTypeName + " is not supported");
+ }
String className = eventType.getResponseGenerator();
@@ -60,12 +61,13 @@
// + "class name for eventType (" + eventTypeName + "): "
// + className);
- if (className == null || className.trim().isEmpty())
+ if (className == null || className.trim().isEmpty()) {
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",
"ResponseGeneratorFactory.getResponseGenerator: "
+ "Could not find class name for eventType "
+ eventTypeName);
+ }
ResponseGenerator responseGenerator;
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/UtilizationResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/UtilizationResponseGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/UtilizationResponseGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,26 +59,28 @@
String className = value.getClass().getName();
String strValue = null;
- if (className.equals("java.lang.Float"))
+ if (className.equals("java.lang.Float")) {
strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
+ }
+ if (className.equals("java.lang.Double")) {
strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
+ } else if (className.equals("java.lang.Integer")) {
strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
+ } else if (className.equals("java.lang.Long")) {
strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
+ } else if (className.equals("java.lang.Date")) {
strValue = value.toString();
- else if (className.equals("java.lang.String"))
+ } else if (className.equals("java.lang.String")) {
strValue = (String) value;
+ }
if (strValue != null) {
- if (column.equals("value"))
+ if (column.equals("value")) {
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
+ } else if (column.equals("valueUnits")) {
datum.setValueUnits(strValue);
- else if (column.equals("timeValue")) {
+ } else if (column.equals("timeValue")) {
datum.setTimeValue(strValue);
datum.setTimeType("unix");
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/IperfStoreRequestProcess.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -49,11 +49,21 @@
String jitter = ((Datum) datum).getJitter();
String loss = ((Datum) datum).getLoss();
- 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;
+ 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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/L2PathStatusStoreRequestProcess.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -52,8 +52,9 @@
handleUnixTimeValue(timeValue, ibatisParams);
} else if (timeType.trim().isEmpty()) {
handleUnixTimeValue(timeValue, ibatisParams);
- } else
+ } else {
handleUnixTimeValue(timeValue, ibatisParams);
+ }
String stateAdmin = ((Datum) datum).getStateAdmin().getStateAdmin();
String stateOper = ((Datum) datum).getStateOper().getStateOper();
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcessFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -43,11 +43,12 @@
EventType eventType =
eventTypeConfigurationComponent.getEventType(eventTypeName);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"StoreRequestProcessFactory.getStoreRequestProcess: "
+ "eventType " + eventTypeName + " is not supported");
+ }
String className = eventType.getStoreRequestProcess();
@@ -57,12 +58,13 @@
+ "class name for eventType (" + eventTypeName + "): "
+ className);
- if (className == null || className.trim().isEmpty())
+ if (className == null || className.trim().isEmpty()) {
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",
"StoreRequestProcessFactory.getStoreRequestProcess: "
+ "Could not find class name for eventType "
+ eventTypeName);
+ }
StoreRequestProcess storeRequestProcess;
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/AuxiliaryComponentManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/AuxiliaryComponentManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/AuxiliaryComponentManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -315,19 +315,27 @@
*/
public static void setTempDirectory(File directory)
{
- if (!directory.exists()) throw new IllegalArgumentException("Temp
directory doesn't exist.");
- if (!directory.canRead()) throw new IllegalArgumentException("Temp
directory can't be read");
- if (!directory.canWrite()) throw new IllegalArgumentException("Temp
directory can't be written to.");
+ if (!directory.exists()) {
+ throw new IllegalArgumentException("Temp directory doesn't
exist.");
+ }
+ if (!directory.canRead()) {
+ throw new IllegalArgumentException("Temp directory can't be
read");
+ }
+ if (!directory.canWrite()) {
+ throw new IllegalArgumentException("Temp directory can't be
written to.");
+ }
componentManager.tempDirectory = directory;
}
private static String slashify(String path)
{
String p = path;
- if (File.separatorChar != '/')
+ if (File.separatorChar != '/') {
p = p.replace(File.separatorChar, '/');
- if (!p.startsWith("/"))
+ }
+ if (!p.startsWith("/")) {
p = "/" + p;
+ }
return p;
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/ComponentsConfigurationReader.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -41,8 +41,9 @@
) {
// split by [spaces]=[spaces]
String[] tokens = trimmed.split("(\\ |\\t)*\\=(\\ |\\t)*",
2);
- if (tokens.length == 2)
+ if (tokens.length == 2) {
listProperties.add(new Entry(tokens[0], tokens[1]));
+ }
}
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -67,8 +67,9 @@
{
try {
String alias = keystore.getCertificateAlias(cert);
- if (alias != null)
+ if (alias != null) {
return alias;
+ }
// Use brute force search
Enumeration<String> e = keystore.aliases();
while (e.hasMoreElements()) {
@@ -288,8 +289,9 @@
// Convert the vector into an array
String[] result = new String[aliases.size()];
- for (int i = 0; i < aliases.size(); i++)
+ for (int i = 0; i < aliases.size(); i++) {
result[i] = aliases.elementAt(i);
+ }
return result;
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -415,13 +415,19 @@
scheduleChain[0] = nextMetadataResults[0];
- } else moreNodesInChain = false;
+ } else {
+ moreNodesInChain = false;
+ }
- if (errorInChain) break;
+ if (errorInChain) {
+ break;
+ }
}
- if (errorInChain) continue;
+ if (errorInChain) {
+ continue;
+ }
//TODO: Decide which schedule action to call upon - this is done
based on the first event type in the chain
//call on action thread which should accept array of metadata
(or message?) objects
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/simplescheduler/SchedulerTask.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/simplescheduler/SchedulerTask.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/simplescheduler/SchedulerTask.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -21,8 +21,11 @@
public SchedulerTask(long interval, SchedulerAction action)
{
- if (interval < MIN_INTERVAL) this.interval = MIN_INTERVAL;
- else this.interval = interval;
+ if (interval < MIN_INTERVAL) {
+ this.interval = MIN_INTERVAL;
+ } else {
+ this.interval = interval;
+ }
this.action = action;
this.timestamp = 0;
@@ -175,7 +178,9 @@
public boolean equals(Object o)
{
- if (o == null) return false;
+ if (o == null) {
+ return false;
+ }
return o instanceof SchedulerTask ?
(((SchedulerTask) o).action == null ?
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/MathUtil.java
===================================================================
--- trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/MathUtil.java
2012-10-05 09:22:46 UTC (rev 6011)
+++ trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/MathUtil.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -33,11 +33,13 @@
public double[] convertOctetsToBits(double[] octetValues) throws
PerfSONARException
{
- if (octetValues == null)
+ if (octetValues == null) {
return null;
+ }
- if (octetValues.length == 0)
+ if (octetValues.length == 0) {
return octetValues;
+ }
double[] bitValues = new double[octetValues.length];
@@ -86,11 +88,13 @@
public long[] convertOctetsToBits(long[] octetValues) throws
PerfSONARException
{
- if (octetValues == null)
+ if (octetValues == null) {
return null;
+ }
- if (octetValues.length == 0)
+ if (octetValues.length == 0) {
return octetValues;
+ }
long[] bitValues = new long[octetValues.length];
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/NetUtil.java
===================================================================
--- trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/NetUtil.java
2012-10-05 09:22:46 UTC (rev 6011)
+++ trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/NetUtil.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -29,8 +29,9 @@
String[] splitByDot;
splitByDot = ipv4AddressString.split("[.]+");
- if (splitByDot.length > 4)
+ if (splitByDot.length > 4) {
return false;
+ }
//TODO: complete work on IPv4 validation
return true;
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/TimeDateUtil.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/TimeDateUtil.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/TimeDateUtil.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -50,12 +50,14 @@
throws PerfSONARException
{
- if (timeParemeter == null)
+ if (timeParemeter == null) {
return null;
+ }
String unixTime = _getUnixTime(timeParemeter);
- if (unixTime == null)
+ if (unixTime == null) {
unixTime = timeParemeter.getParameterValue();
+ }
return unixTime;
@@ -73,14 +75,16 @@
// TODO handle.
}
- if (subelement == null)
+ if (subelement == null) {
return null;
+ }
- if (!subelement.getLocalName().equals("time"))
+ if (!subelement.getLocalName().equals("time")) {
throw new PerfSONARException(
"error.parameter",
"TimeDateUtil._getUnixTime: wrong type of parameter; "
+ "it should be time type");
+ }
Time time = (Time) subelement;
String unixTimeString;
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
===================================================================
--- trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
2012-10-05 09:22:46 UTC (rev 6011)
+++ trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -156,8 +156,11 @@
Document doc = builder.newDocument();
Document builtDoc = m.getDOM(doc);
- if (builtDoc == null) throw new NullPointerException();
- else return builtDoc;
+ if (builtDoc == null) {
+ throw new NullPointerException();
+ } else {
+ return builtDoc;
+ }
} catch (Exception e) {
throw new PerfSONARException(
@@ -374,15 +377,21 @@
//find starting tag
int indexStartTag1 = str.indexOf("<" + tag);
- if (indexStartTag1 == -1) return null;
+ if (indexStartTag1 == -1) {
+ return null;
+ }
//find end of starting tag
int indexStartTag2 = str.indexOf(">", indexStartTag1);
- if (indexStartTag2 == -1) return null;
+ if (indexStartTag2 == -1) {
+ return null;
+ }
//find closing tag
int indexEndTag1 = str.indexOf("</" + tag, indexStartTag2);
- if (indexEndTag1 == -1) return null;
+ if (indexEndTag1 == -1) {
+ return null;
+ }
String substr = str.substring(indexStartTag2 + 1, indexEndTag1);
return substr;
@@ -407,7 +416,9 @@
if (ind1 > -1) {
ind1 = str.indexOf('\"', ind1);
- } else return null; //attribute not found
+ } else {
+ return null; //attribute not found
+ }
if (ind1 > -1) {
ind1 += 1;
@@ -480,8 +491,9 @@
for (int i = 0; i < nl.getLength(); i++) {
org.w3c.dom.Element el = (org.w3c.dom.Element) nl.item(i);
HashMap<String, String> elementsMap = new HashMap<String,
String>();
- for (String e : elements)
+ for (String e : elements) {
elementsMap.put(e, getElementValue(el, e));
+ }
elementsMapList.add(elementsMap);
}
}
@@ -543,7 +555,9 @@
}
}
- if (!found) return null;
+ if (!found) {
+ return null;
+ }
return map;
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/IpTrie.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/IpTrie.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/IpTrie.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -101,7 +101,9 @@
// hackage for the root node, which might have a null child
// no other node does
- if (node.childOne == null || node.childZero == null) continue;
+ if (node.childOne == null || node.childZero == null) {
+ continue;
+ }
if (node.trieNode.getData() == null &&
(node.childZero.trieNode.getData() != null ||
@@ -124,7 +126,9 @@
// hackage for the root node, which might have a null child
// no other node does
- if (node.childOne == null || node.childZero == null) continue;
+ if (node.childOne == null || node.childZero == null) {
+ continue;
+ }
if (node.trieNode.getData() == null &&
(node.childZero.trieNode.getData() != null ||
@@ -175,7 +179,9 @@
for (IpTrieNode node; it.hasNext(); ) {
node = it.next();
sum += node.childCount;
- if (node.mask == 32) sum++;
+ if (node.mask == 32) {
+ sum++;
+ }
}
if (sum != trie.getCount()) {
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/Trie.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/Trie.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/Trie.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -64,10 +64,11 @@
public boolean FindExactMatch(long key, long keyLength)
{
- if (firstDigit(key, keyLength) == 1)
+ if (firstDigit(key, keyLength) == 1) {
return rootNode.getChildOne() != null &&
rootNode.getChildOne().FindExactMatch(key, keyLength);
- else
+ } else {
return rootNode.getChildZero() != null &&
rootNode.getChildZero().FindExactMatch(key, keyLength);
+ }
}
// public Trie Merge(Trie trie) {
@@ -83,11 +84,13 @@
long position = Constants.MAX_KEY_LENGTH;
List<Long> keys = new ArrayList<Long>();
- if (rootNode.getChildZero() != null)
+ if (rootNode.getChildZero() != null) {
keys = GetKeys(keys, rootNode.getChildZero(), key, position);
+ }
- if (rootNode.getChildOne() != null)
+ if (rootNode.getChildOne() != null) {
keys = GetKeys(keys, rootNode.getChildOne(), key, position);
+ }
return keys;
}
@@ -96,10 +99,12 @@
{
key = key | (node.getKey() << (position - node.getKeyLength()));
- if (node.getChildZero() != null)
+ if (node.getChildZero() != null) {
keys = GetKeys(keys, node.getChildZero(), key, position -
node.getKeyLength());
- if (node.getChildOne() != null)
+ }
+ if (node.getChildOne() != null) {
keys = GetKeys(keys, node.getChildOne(), key, position -
node.getKeyLength());
+ }
for (long i = 0; i < node.getValueCount(); i++) {
keys.add(key);
@@ -112,12 +117,14 @@
{
//implements the best match by digging all the way to the leaf based
on the key difference.
if (firstDigit(key, keyLength) == 1) {
- if (rootNode.getChildOne() != null)
+ if (rootNode.getChildOne() != null) {
return rootNode.getChildOne().FindBestMatch(key, keyLength);
- else
+ } else {
return null;
- } else if (rootNode.getChildZero() == null)
+ }
+ } else if (rootNode.getChildZero() == null) {
return null;
+ }
return rootNode.getChildZero().FindBestMatch(key, keyLength);
}
@@ -129,8 +136,9 @@
List<Long> list2 = trie.GetKeys();
for (int i = 0; i < this.nodeCount; i++) {
- if (!list1.get(i).equals(list2.get(i)))
+ if (!list1.get(i).equals(list2.get(i))) {
return false;
+ }
}
return true;
}
@@ -166,19 +174,21 @@
if (currentKeyLength == keyLength && node.getKey() == (key & 1)) {
// by setting node.m_valueCount to -1, we indicate that it can
be deleted
- if (node.getValueCount() > 1)
+ if (node.getValueCount() > 1) {
node.setValueCount(node.getValueCount() - 1);
- else {
- if (node.getChildZero() == null && node.getChildOne() ==
null)
+ } else {
+ if (node.getChildZero() == null && node.getChildOne() ==
null) {
node.setValueCount(node.getValueCount() - 1);
- else
+ } else {
node.setValueCount(0);
+ }
}
return true;
- } else if (firstDigit(key, keyLength - currentKeyLength) == 1)
+ } else if (firstDigit(key, keyLength - currentKeyLength) == 1) {
child = node.getChildOne();
- else
+ } else {
child = node.getChildZero();
+ }
success = ((child != null) && Remove(child, key, keyLength,
currentKeyLength));
@@ -187,13 +197,15 @@
// the node is safe to be deleted if its valueCount = -1
if (child.getValueCount() < 0) {
- if (child.getKey() == 1)
+ if (child.getKey() == 1) {
node.setChildOne(null);
- else
+ } else {
node.setChildZero(null);
+ }
- if (node.getValueCount() == 0 && node.getChildZero() == null
&& node.getChildOne() == null)
+ if (node.getValueCount() == 0 && node.getChildZero() == null
&& node.getChildOne() == null) {
node.setValueCount(-1);
+ }
}
}
return success;
@@ -227,8 +239,9 @@
if (childOne != null) {
mostDominantKeyList(childOne, key, position);
}
- if ((node.getChildOne() != null) && (node.getChildZero() != null))
+ if ((node.getChildOne() != null) && (node.getChildZero() != null)) {
keyList.add(new TrieNode(key, position));
+ }
}
public void printDot(String fileName) throws FileNotFoundException
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/TrieNode.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/TrieNode.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/iptrie/TrieNode.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -250,16 +250,16 @@
long keyDiff = key - (keyCommon << keyLengthDiff);
if (firstDigit(keyDiff, keyLengthDiff) == 1) {
- if (childOne != null)
+ if (childOne != null) {
return childOne.FindExactMatch(keyDiff, keyLengthDiff);
- else {
+ } else {
matchStatus = false;
return matchStatus;
}
} else {
- if (childZero != null)
+ if (childZero != null) {
return childZero.FindExactMatch(keyDiff, keyLengthDiff);
- else {
+ } else {
matchStatus = false;
return matchStatus;
}
@@ -302,11 +302,13 @@
public TrieNode Clone()
{
TrieNode clone = new TrieNode(this.key, this.keyLength,
this.valueCount);
- if (this.childZero != null)
+ if (this.childZero != null) {
clone.childZero = this.childZero.Clone();
+ }
- if (this.childOne != null)
+ if (this.childOne != null) {
clone.childOne = this.childOne.Clone();
+ }
return clone;
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/EchoRequestGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/EchoRequestGenerator.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/EchoRequestGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -76,10 +76,12 @@
Parameters params = new Parameters();
params.setId("modifiers");
- if (testDBConnection)
+ if (testDBConnection) {
params.addParameter("testDBConnection", YES);
- if (testDBSchema)
+ }
+ if (testDBSchema) {
params.addParameter("testDBSchema", YES);
+ }
Data data = new Data();
data.setId(dataId);
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/lookupService/LSRegisterRequestGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -96,36 +96,48 @@
//access point -- mandatory
String accessPointString= commonParameters.get("access_point");
- if (accessPointString==null) throw new PerfSONARException(
+ if (accessPointString==null) {
+ throw new PerfSONARException(
"error.lsregistrator.no_accesspoint",
"AccessPoint parameter was not found. Registration failed");
- if (accessPointString != null && accessPointString.isEmpty()) 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();
ap.setAccessPoint(accessPointString);
service.setAccessPoint(ap);
//service name -- mandatory
String serviceNameString= commonParameters.get("service_name");
- if (serviceNameString==null) throw new PerfSONARException(
+ if (serviceNameString==null) {
+ throw new PerfSONARException(
"error.lsregistrator.no_servicename",
"ServiceName parameter was not found. Registration failed");
- if (serviceNameString != null && serviceNameString.isEmpty()) 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();
sn.setServiceName(serviceNameString);
service.setServiceName(sn);
//service type -- mandatory
String serviceTypeString= commonParameters.get("service_type");
- if (serviceTypeString==null) throw new PerfSONARException(
+ if (serviceTypeString==null) {
+ throw new PerfSONARException(
"error.lsregistrator.no_servicetype",
"ServiceType parameter was not found. Registration failed");
- if (serviceTypeString != null && serviceTypeString.isEmpty()) 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();
st.setServiceType(serviceTypeString);
service.setServiceType(st);
@@ -175,8 +187,9 @@
for (int i=0; i<supportedEventTypes.length; i++) {
String et=supportedEventTypes[i];
- if (!(et != null && et.isEmpty()))
- eventTypes.addParameter("supportedEventType_"+i, et);
+ if (!(et != null && et.isEmpty())) {
+ eventTypes.addParameter("supportedEventType_" + i, et);
+ }
}
metadata.setParameters(eventTypes);
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/xquery/lookupService/GenericXQueryExpression.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -242,7 +242,9 @@
public void setResultType(int resultType) {
- if (resultType==RETURN_FULL_LOOKUP_INFO) isLetData = true;
+ if (resultType==RETURN_FULL_LOOKUP_INFO) {
+ isLetData = true;
+ }
this.resultType = resultType;
@@ -289,7 +291,9 @@
StringBuilder sb = new StringBuilder();
if (getConditionType() == IS) {
sb.append("(");
- if (prefix!=null) sb.append(prefix);
+ if (prefix!=null) {
+ sb.append(prefix);
+ }
sb.append(name);
sb.append(" = ");
sb.append("'");
@@ -297,7 +301,9 @@
sb.append("')");
} else if (getConditionType() == CONTAINS) {
sb.append("contains(");
- if (prefix!=null) sb.append(prefix);
+ if (prefix!=null) {
+ sb.append(prefix);
+ }
sb.append(name);
sb.append(",");
sb.append("'");
@@ -305,7 +311,9 @@
sb.append("')");
} else if (getConditionType() == PREFIX) {
sb.append("starts-with(");
- if (prefix!=null) sb.append(prefix);
+ if (prefix!=null) {
+ sb.append(prefix);
+ }
sb.append(name);
sb.append(",");
sb.append("'");
@@ -313,7 +321,9 @@
sb.append("')");
} else if (getConditionType() == SUFFIX) {
sb.append("ends-with(");
- if (prefix!=null) sb.append(prefix);
+ if (prefix!=null) {
+ sb.append(prefix);
+ }
sb.append(name);
sb.append(",");
sb.append("'");
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPClientMulti.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPClientMulti.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPClientMulti.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -85,13 +85,16 @@
// User of this class should check for different output file names!
// Create thread for each request
- for (int i = 0; i < args.length; i++)
+ for (int i = 0; i < args.length; i++) {
new SOAPClientMulti(this, args[i++], args[i++], args[i]).start();
+ }
// Synchronously start all threads now
try {
// Wait for all the threads to start waiting
- while (threadCount < args.length / 3) Thread.sleep(50);
+ while (threadCount < args.length / 3) {
+ Thread.sleep(50);
+ }
synchronized (this) {
notifyAll();
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AttrResponse.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AttrResponse.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AttrResponse.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -45,12 +45,13 @@
public String getNamespaceURI(String prefix)
{
String uri;
- if (prefix.equals("samlp"))
+ if (prefix.equals("samlp")) {
uri = "urn:oasis:names:tc:SAML:2.0:protocol";
- else if (prefix.equals("saml"))
+ } else if (prefix.equals("saml")) {
uri = "urn:oasis:names:tc:SAML:2.0:assertion";
- else
+ } else {
uri = null;
+ }
return uri;
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -63,8 +63,9 @@
@Override
public Object getSTFromRequest() throws PerfSONARException
{
- if (!hasSTInRequest())
+ if (!hasSTInRequest()) {
return null;
+ }
MessageContext mc = MessageContext.getCurrentContext();
try {
Message m = mc.getCurrentMessage();
@@ -95,8 +96,9 @@
@Override
public Object getSTValue() throws PerfSONARException
{
- if (!hasSTInRequest())
+ if (!hasSTInRequest()) {
return null;
+ }
Object res = null;
SOAPHeader sh = (SOAPHeader) getSTFromRequest();
/* Iterator it=sh.examineAllHeaderElements();
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,8 +59,9 @@
//put all data having the same metadataIdRef to the same
container
String metaref = data.getMetadataIdRef();
- if (dataChains.get(metaref) == null)
+ if (dataChains.get(metaref) == null) {
dataChains.put(metaref, new Message());
+ }
Message m = dataChains.get(metaref);
m.setData(data);
//System.out.println("## data ["+data.getId()+"] ->
["+metaref+"]");
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -49,12 +49,16 @@
// node's nodeIdRef might points to a metadata which does not exist
//if (metadataId == null) throw new NoSuchMetadataException();
- if (metadataId == null) return metadatas;
+ if (metadataId == null) {
+ return metadatas;
+ }
Metadata metadata = inputMessage.getMetadata(metadataId);
- if (metadata == null) throw new NoSuchMetadataException();
+ if (metadata == null) {
+ throw new NoSuchMetadataException();
+ }
metadatas.put(metadata.getId(), metadata);
@@ -76,11 +80,12 @@
Node[] nodeArray = link.getNodeArray();
if (nodeArray.length > 0) {
- for (Node aNodeArray : nodeArray)
+ for (Node aNodeArray : nodeArray) {
this.getChaining(
inputMessage,
getNodeMetadataId(aNodeArray.getNodeIdRef(),
inputMessage),
metadatas);
+ }
}
}
@@ -109,12 +114,13 @@
Vector nodes;
for (Metadata metadata : collection) {
- if ((subject = metadata.getSubject()) != null)
+ if ((subject = metadata.getSubject()) != null) {
if ((nodes = subject.getChildrenByType("node")).isEmpty())
continue;
else if ((node = (Node) nodes.get(0)) != null)
if (nodeId.equals(node.getId()))
return metadata.getId();
+ }
}
return null;
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LookupInfoRequest.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -181,56 +181,63 @@
//access point
String accessPointString = (String)
commonParameters.get("access_point");
- if (accessPointString == null)
+ if (accessPointString == null) {
accessPointString = "";
+ }
AccessPoint ap = new AccessPoint();
ap.setAccessPoint(accessPointString);
service.setAccessPoint(ap);
//service name
String serviceNameString = (String)
commonParameters.get("service_name");
- if (serviceNameString == null)
+ if (serviceNameString == null) {
serviceNameString = "";
+ }
ServiceName sn = new ServiceName();
sn.setServiceName(serviceNameString);
service.setServiceName(sn);
//service type
String serviceTypeString = (String)
commonParameters.get("service_type");
- if (serviceTypeString == null)
+ if (serviceTypeString == null) {
serviceTypeString = "";
+ }
ServiceType st = new ServiceType();
st.setServiceType(serviceTypeString);
service.setServiceType(st);
//service description
String serviceDescString = (String)
commonParameters.get("service_description");
- if (serviceDescString == null)
+ if (serviceDescString == null) {
serviceDescString = "";
+ }
ServiceDescription sd = new ServiceDescription();
sd.setServiceDescription(serviceDescString);
service.setServiceDescription(sd);
//service version
String serviceVersionString = (String)
commonParameters.get("service_version");
- if (serviceVersionString == null)
+ if (serviceVersionString == null) {
serviceVersionString = "";
+ }
ServiceVersion sv = new ServiceVersion();
sv.setServiceVersion(serviceVersionString);
service.setServiceVersion(sv);
//organization owning the service
String organizationString = (String)
commonParameters.get("organization_name");
- if (organizationString == null)
+ if (organizationString == null) {
organizationString = "";
+ }
Organization organization = new Organization();
organization.setOrganization(organizationString);
service.setOrganization(organization);
//organization owning the service
String contactEmailString = (String)
commonParameters.get("contact_email");
- if (contactEmailString == null)
+ if (contactEmailString == null) {
contactEmailString = "";
+ }
ContactEmail contactEmail = new ContactEmail();
contactEmail.setContactEmail(contactEmailString);
service.setContactEmail(contactEmail);
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/MessageHandlerFactory.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/MessageHandlerFactory.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/MessageHandlerFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -94,8 +94,9 @@
private static void init() throws PerfSONARException
{
synchronized (mutex) {
- if (!m2c.isEmpty())
+ if (!m2c.isEmpty()) {
return; // if the lock was blocking a other thread then make
the second thread do nothing here.
+ }
ConfigurationComponent configManager = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -253,7 +253,9 @@
for (Message m : messages) {
respMessage = m;
}
- if (respMessage == null) respMessage = new Message();
+ if (respMessage == null) {
+ respMessage = new Message();
+ }
return respMessage;
}
@@ -319,11 +321,15 @@
throws NoSuchMetadataException
{
- if (metadataId == null) throw new NoSuchMetadataException();
+ if (metadataId == null) {
+ throw new NoSuchMetadataException();
+ }
Metadata metadata = inputMessage.getMetadata(metadataId);
- if (metadata == null) throw new NoSuchMetadataException();
+ if (metadata == null) {
+ throw new NoSuchMetadataException();
+ }
metadatas.put(metadata.getId(), metadata);
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/GenericServiceLSRegistrator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -64,8 +64,9 @@
//get service.r.type - test if ls
try {
String typeStr = configuration.getProperty("service.r.type");
- if ("ls".equalsIgnoreCase(typeStr))
+ if ("ls".equalsIgnoreCase(typeStr)) {
ls = true;
+ }
} catch (Exception ex) {
ls = false;
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/InformationExistDbXmlrpcServiceContent.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -59,17 +59,19 @@
String[] results = (String[])
storageManager.fetch(GET_METADATA_XPATH);
- if (results == null)
+ if (results == null) {
throw new PerfSONARException(
"warning.ls.register",
"InformationExistDbXmlrpcServiceContent.fetch: "
+ "Fetch method of storage manager returned null");
+ }
- if (results.length == 0)
+ if (results.length == 0) {
throw new PerfSONARException(
"warning.ls.register",
"InformationExistDbXmlrpcServiceContent.fetch: "
+ "No metadata elements in the metadata configuration");
+ }
return results;
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSListAddresses.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -32,8 +32,9 @@
String[] u = multiUrlString.split(",");
for (String urlString : u) {
String s = urlString.trim();
- if (!s.isEmpty())
+ if (!s.isEmpty()) {
urls.add(s);
+ }
}
} catch (RuntimeException ex) {
}
@@ -54,10 +55,11 @@
String[] u = multiUrlString.split(",");
for (String urlString : u) {
String s = urlString.trim();
- if (!s.isEmpty())
+ if (!s.isEmpty()) {
try {
addFromURL(urls, s);
} catch (Exception ex) { /* just omit */ }
+ }
}
} catch (RuntimeException rex) {
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSRegistrationComponent.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -165,8 +165,9 @@
String rootHints = getProperty("service.r.root_hints");
//if no LS to register with throw exception
- if ((localLsUrls == null) && (rootHints == null))
+ if ((localLsUrls == null) && (rootHints == null)) {
throw new
PerfSONARException("error.lsregistration.no_ls_url");
+ }
logger.debug("LSRegistrationComponent.runAction: register to
gLS-es");
@@ -190,8 +191,9 @@
list.addFromMultipleURLs(remoteUrls, rootHints);
for (String url : remoteUrls) {
logger.debug("LSRegistrationComponent send to gLS url
from roots.hints: [" + url + "]: ");
- if (registerToLS(registrator, url) == true)
+ if (registerToLS(registrator, url) == true) {
break; //break after first success
+ }
}
}
} catch (PerfSONARException e) {
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -116,9 +116,11 @@
long time = 60000;
if (LSSummaryServiceContent.counter == 0)
+ {
logger.debug("LSSummaryServiceContent: Wait [" +
(time / 1000) +
"] seconds until other components are initialized...");
+ }
synchronized (this) {
try {
@@ -148,8 +150,9 @@
dbUsername = config.getProperty("service.ls.db_username");
dbPassword = config.getProperty("service.ls.db_password");
- if (dbCollection == null || dbUsername == null || dbPassword ==
null)
+ if (dbCollection == null || dbUsername == null || dbPassword ==
null) {
throw new PerfSONARException();
+ }
logger.debug(
"LSSummaryServiceContent: database access details: " +
"(url=" + dbCollection + ", username=" + dbUsername + ",
" + dbPassword + ")");
@@ -364,18 +367,23 @@
public Collection<String> getSubDomains(String domain, int limit,
Collection<String> list)
{
- if (domain == null) return null;
+ if (domain == null) {
+ return null;
+ }
int last = domain.length();
for (int current = last - 1; current >= 0; current--) {
- if (limit == 0) break;
+ if (limit == 0) {
+ break;
+ }
if (domain.charAt(current) == '.') {
String subdomain = domain.substring(current + 1);
- if (subdomain != null && !subdomain.isEmpty())
+ if (subdomain != null && !subdomain.isEmpty()) {
list.add(subdomain);
+ }
limit--;
}
}
@@ -493,9 +501,11 @@
return s;
} catch (Exception e) {
logger.error("LSSummaryServiceContent: Cannot perform xquery ["
+ xq + "]: " + e.getMessage() + "\n" + e.toString());
- if (e instanceof PerfSONARException) throw (PerfSONARException)
e;
- else
+ if (e instanceof PerfSONARException) {
+ throw (PerfSONARException) e;
+ } else {
throw new
PerfSONARException("error.lsregistration.db_error", "Cannot perform xquery ["
+ xq + "] : " + e.getLocalizedMessage());
+ }
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/XmlDbResult.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/XmlDbResult.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/XmlDbResult.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -53,10 +53,13 @@
public String getResultAsString()
{
- if (results.length == 1) return results[0];
- else {
+ if (results.length == 1) {
+ return results[0];
+ } else {
StringWriter sw = new StringWriter();
- for (String result : results) sw.append(result);
+ for (String result : results) {
+ sw.append(result);
+ }
return sw.toString();
}
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHTTPAccess.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -165,8 +165,10 @@
if (str.startsWith("<exist:result")) {
- if (debug) System.out.println(
- "[HEAD] [" + str + "]");
+ if (debug) {
+ System.out.println(
+ "[HEAD] [" + str + "]");
+ }
doParseLine = false;
exResult = true;
@@ -191,12 +193,18 @@
} catch (RuntimeException e) {
}
- if (debug) System.out.println(
- "[RESV] hits=" + hits);
- if (debug) System.out.println(
- "[RESV] start=" + first);
- if (debug) System.out.println(
- "[RESV] count=" + count);
+ if (debug) {
+ System.out.println(
+ "[RESV] hits=" + hits);
+ }
+ if (debug) {
+ System.out.println(
+ "[RESV] start=" + first);
+ }
+ if (debug) {
+ System.out.println(
+ "[RESV] count=" + count);
+ }
//Case if exist:result in one line
//if <exist:result>anything</exist:result>
@@ -208,7 +216,9 @@
str = content;
doParseLine = true; //this time parse line, because
//it may contain more data to be parsed
- if (debug) System.out.println("[D] Results in one
line, parsing content [" + str + "]...");
+ if (debug) {
+ System.out.println("[D] Results in one line,
parsing content [" + str + "]...");
+ }
}
} //<exist:result>
@@ -216,8 +226,10 @@
} else {
if (str.startsWith("</exist:result")) {
- if (debug) System.out.println(
- "[FOOT] [" + str + "]");
+ if (debug) {
+ System.out.println(
+ "[FOOT] [" + str + "]");
+ }
doParseLine = false;
}
@@ -234,9 +246,12 @@
if (content != null) {
str = content;
//add to list
- if (!(str != null && str.isEmpty()))
+ if (!(str != null && str.isEmpty())) {
responseList.add(str);
- if (debug) System.out.println("[D] Removed
<exist:value>");
+ }
+ if (debug) {
+ System.out.println("[D] Removed <exist:value>");
+ }
}
}
@@ -253,7 +268,9 @@
//add Line Feed sign at the end of each line
response.append("\n");
- if (debug) System.out.println("[LINE] [" + str + "]");
+ if (debug) {
+ System.out.println("[LINE] [" + str + "]");
+ }
} //parse
@@ -263,14 +280,16 @@
result = response.toString();
//convert result list (if only exist:value) to String[]
- if (!responseList.isEmpty())
+ if (!responseList.isEmpty()) {
resultArray = responseList.
toArray(new String[responseList.size()]);
+ }
- if (resultArray != null)
+ if (resultArray != null) {
return new XmlDbResult(resultArray, hits, first, count);
//return XmlDbResult
- else
+ } else {
return new XmlDbResult(result, hits, first, count); //return
XmlDbResult
+ }
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -160,11 +160,12 @@
ex.getClass() + " : " + ex.getMessage());
}
- if (getResultType() == XmlDbConstants.RETURN_STRING_ARRAY)
+ if (getResultType() == XmlDbConstants.RETURN_STRING_ARRAY) {
return results.getResultAsStringArray();
+ } else {
+ return results;
+ }
- else return results;
-
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/rest/HTTPAccess.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -170,26 +170,32 @@
httpUrlConnection.setRequestMethod(method);
//set content type
- if (contentType != null)
+ if (contentType != null) {
httpUrlConnection.setRequestProperty("Content-Type",
contentType);
+ }
httpUrlConnection.setDoOutput(isRequest);
httpUrlConnection.setDoInput(isResponse);
//set content length
- if (content != null)
+ if (content != null) {
httpUrlConnection.setRequestProperty(
"Content-Length",
String.valueOf(content.length()));
+ }
//HTTP Authorization, set "Authorization: Basic " if necessary
if (username != null) {
- if (password == null) password = ""; //if null make it empty
String
+ if (password == null) {
+ password = ""; //if null make it empty String
+ }
if (!(username != null && username.isEmpty())) {
- if (debug) System.out.println("[D] authorization Basic " +
- username + ":" + password);
+ if (debug) {
+ System.out.println("[D] authorization Basic " +
+ username + ":" + password);
+ }
String basicAuth = "Basic " +
(new sun.misc.BASE64Encoder().
@@ -213,7 +219,9 @@
int responseCode = httpUrlConnection.getResponseCode();
String responseMessage = httpUrlConnection.getResponseMessage();
- if (debug) System.out.println("[D] Response code: " + responseCode +
" (" + responseMessage + ")");
+ if (debug) {
+ System.out.println("[D] Response code: " + responseCode + " (" +
responseMessage + ")");
+ }
InputStream response = null;
if (isResponse) {
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -153,11 +153,15 @@
"XPathQueryService", "1.0");
//service.setProperty("indent", "yes");
- if (service == null) getLogger().debug("StorageManager: warning
- service is null");
+ if (service == null) {
+ getLogger().debug("StorageManager: warning - service is
null");
+ }
ResourceSet result = service.query(xqueryExpression);
- if (result == null) getLogger().debug("StorageManager: warning -
result is null");
+ if (result == null) {
+ getLogger().debug("StorageManager: warning - result is
null");
+ }
ResourceIterator resIt = result.getIterator();
List<Object> list = new Vector<Object>();
@@ -179,9 +183,9 @@
//determine return type
- if (getResultType() == XmlDbConstants.RETURN_STRING_ARRAY)
+ if (getResultType() == XmlDbConstants.RETURN_STRING_ARRAY) {
return xml;
- else if (getResultType() == XmlDbConstants.RETURN_XML_DB_RESULT)
{
+ } else if (getResultType() ==
XmlDbConstants.RETURN_XML_DB_RESULT) {
return new XmlDbResult(xml, xml.length, 1, xml.length);
} else {
//default
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmlfile/XmlFileStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmlfile/XmlFileStorageManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmlfile/XmlFileStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -199,8 +199,9 @@
sm.initStorage(dr);
System.out.println("Fetch...");
String[] results = (String[])
sm.fetch("/perfsonar:store/nmwg:metadata");
- for (int i = 0; i < results.length; i++)
+ for (int i = 0; i < results.length; i++) {
System.out.println("Result [" + i + "]: " + results[i]);
+ }
System.out.println("END");
} catch (Exception ex) {
ex.printStackTrace();
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/transport/SSHFileTransport.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/transport/SSHFileTransport.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/transport/SSHFileTransport.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -71,18 +71,27 @@
// * One of source address or destination address must
// not be null, one should be
// * Both source and destination paths must not be null
- if (file == null) throw new Exception("file parameter is null");
- if (src == null) throw new Exception("src is null");
- if (dst == null) throw new Exception("dst is null");
+ if (file == null) {
+ throw new Exception("file parameter is null");
+ }
+ if (src == null) {
+ throw new Exception("src is null");
+ }
+ if (dst == null) {
+ throw new Exception("dst is null");
+ }
if (src.getAddress() == null &&
- dst.getAddress() == null)
+ dst.getAddress() == null) {
throw new Exception("both src and dst addresses are null");
+ }
if (src.getAddress() != null &&
- dst.getAddress() != null)
+ dst.getAddress() != null) {
throw new Exception("both src and dst addresses are not null");
+ }
if (src.getPath() == null ||
- dst.getPath() == null)
+ dst.getPath() == null) {
throw new Exception("src or dst path is null");
+ }
// Source file is local
@@ -136,10 +145,11 @@
ssh.waitFor();
- if (ssh.exitValue() != 0)
+ if (ssh.exitValue() != 0) {
throw new Exception(
"Error copying local file, exit code "
+ ssh.exitValue());
+ }
// Destination file is local
} else if (dst.getAddress() == null) {
@@ -224,12 +234,18 @@
// * loc must not be null
// * address in loc must not be null
// * path in loc must not be null
- if (file == null) throw new Exception("file parameter is null");
- if (loc == null) throw new Exception("loc is null");
- if (loc.getAddress() == null)
+ if (file == null) {
+ throw new Exception("file parameter is null");
+ }
+ if (loc == null) {
+ throw new Exception("loc is null");
+ }
+ if (loc.getAddress() == null) {
throw new Exception("loc address is null");
- if (loc.getPath() == null)
+ }
+ if (loc.getPath() == null) {
throw new Exception("loc path is null");
+ }
String remoteFilePath =
@@ -262,10 +278,11 @@
ssh.waitFor();
- if (ssh.exitValue() != 0)
+ if (ssh.exitValue() != 0) {
throw new Exception(
"Error removing remote file, exit code "
+ ssh.exitValue());
+ }
}
@@ -290,12 +307,18 @@
// * loc must not be null
// * address in loc must not be null
// * path in loc must not be null
- if (file == null) throw new Exception("file parameter is null");
- if (loc == null) throw new Exception("loc is null");
- if (loc.getAddress() == null)
+ if (file == null) {
+ throw new Exception("file parameter is null");
+ }
+ if (loc == null) {
+ throw new Exception("loc is null");
+ }
+ if (loc.getAddress() == null) {
throw new Exception("loc address is null");
- if (loc.getPath() == null)
+ }
+ if (loc.getPath() == null) {
throw new Exception("loc path is null");
+ }
String remoteFilePath =
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/util/ResultCodesUtil.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/util/ResultCodesUtil.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/util/ResultCodesUtil.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -34,7 +34,9 @@
{
Metadata metadata = new Metadata();
- if (metadataId == null) metadataId = "resultCodeMetadata";
+ if (metadataId == null) {
+ metadataId = "resultCodeMetadata";
+ }
metadata.setId(metadataId);
EventType eventType = new EventType();
@@ -66,7 +68,9 @@
{
Data data = new Data();
- if (dataId == null) dataId = "resultDescriptionData";
+ if (dataId == null) {
+ dataId = "resultDescriptionData";
+ }
data.setId(dataId);
data.setMetadataIdRef(metadataIdRef);
@@ -98,9 +102,11 @@
//metadata
String metadataId;
- if (parentMetadataIdRef != null)
+ if (parentMetadataIdRef != null) {
metadataId = "resultCodeMetadata_for_" + parentMetadataIdRef;
- else metadataId = "resultCodeMetadata";
+ } else {
+ metadataId = "resultCodeMetadata";
+ }
Metadata metadata = createResultCodeMetadata(
metadataId,
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/web/RequestHandler.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -54,7 +54,9 @@
public Document acceptCall(Document request)
{
try {
- if (!initialised) init();
+ if (!initialised) {
+ init();
+ }
checkAuxiliaryComponents();
return handleCall(request);
} catch (PerfSONARException pex) {
@@ -185,14 +187,18 @@
protected void checkAuxiliaryComponents() throws PerfSONARException
{
- if (configuration == null) throw new PerfSONARException(
- "error.common.no_configuration",
- "Cannot read configuration file"
- );
- if (logger == null) throw new PerfSONARException(
- "error.common.no_logger",
- "Cannot find logger component"
- );
+ if (configuration == null) {
+ throw new PerfSONARException(
+ "error.common.no_configuration",
+ "Cannot read configuration file"
+ );
+ }
+ if (logger == null) {
+ throw new PerfSONARException(
+ "error.common.no_logger",
+ "Cannot find logger component"
+ );
+ }
}
/**
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -87,11 +87,12 @@
String[] xmlResults = fetchXmlStorage(dataQuery);
- if (xmlResults == null)
+ if (xmlResults == null) {
throw new PerfSONARException(
"error.ma",
"MetadataConfigurationStorageManager.fetch: "
+ "Result array of metadata search in null");
+ }
logger.debug("MetadataConfigurationStorageManager.fetch: "
@@ -99,18 +100,20 @@
+ xmlResults.length);
- if (xmlResults.length == 0)
+ if (xmlResults.length == 0) {
throw new PerfSONARException(
"warning.ma.metadata_configuration",
"MetadataConfigurationStorageManager.fetch: "
+ "No metadata in the metadata configuration");
+ }
- if (xmlResults.length == 1)
+ if (xmlResults.length == 1) {
if (xmlResults[0].trim().isEmpty())
throw new PerfSONARException(
"warning.ma.metadata_configuration",
"MetadataConfigurationStorageManager.fetch: "
+ "No metadata in the metadata configuration");
+ }
for (String xmlResult1 : xmlResults) {
@@ -118,7 +121,9 @@
//logger.debug("MetadataConfigurationStorageManager.fetch: xml
result: "
// + xmlResults[i]);
- if (xmlResult1.trim().isEmpty()) continue;
+ if (xmlResult1.trim().isEmpty()) {
+ continue;
+ }
String xmlResult =
"<nmwg:message
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"> "
@@ -129,12 +134,13 @@
Map<String, Element> elements =
transformations.transformResults(xmlResult, tagNames);
- if (elements == null)
+ if (elements == null) {
throw new PerfSONARException(
"warning.ma.metadata_configuration",
"MetadataConfigurationStorageManager.fetch: "
+ "No metadata or data elements in the fetch result "
+ "sent from xml database");
+ }
Collection<Element> collection = elements.values();
for (Element elem : collection) {
@@ -157,11 +163,12 @@
+ query);
// if query is an empty string then the method returns empty message
- if (query.trim().isEmpty())
+ if (query.trim().isEmpty()) {
throw new PerfSONARException(
"error.ma.query",
"MetadataConfigurationStorageManager.fetchXmlStorage: "
+ "Empty query to get data from the metadata
configuration");
+ }
return executeQuery(query);
}
@@ -171,10 +178,11 @@
public Message store(Message dataSet) throws PerfSONARException
{
- if (dataSet.getMetadataMap().size() > 1)
+ if (dataSet.getMetadataMap().size() > 1) {
return storeAllElements(dataSet);
- else
+ } else {
return storeSinglePair(dataSet);
+ }
}
@@ -263,7 +271,9 @@
String query;
for (Object element : collection) {
- if (isAlreadyStored((Element) element)) continue;
+ if (isAlreadyStored((Element) element)) {
+ continue;
+ }
query = "update insert " +
transformations.serializeXML((Element) element) + " into //*:store";
logger.debug(query);
@@ -284,10 +294,11 @@
logger.debug(query);
String[] results = executeQuery(query);
- if (results != null && results.length > 0)
+ if (results != null && results.length > 0) {
return true;
- else
+ } else {
return false;
+ }
}
@@ -326,13 +337,19 @@
for (Data data : collection) {
metadataIdRef = data.getMetadataIdRef();
- if (metadataIdRef.trim() != null &&
metadataIdRef.trim().isEmpty()) continue;
+ if (metadataIdRef.trim() != null &&
metadataIdRef.trim().isEmpty()) {
+ continue;
+ }
metadata = dataSet.getMetadata(metadataIdRef);
- if (metadata == null) continue;
+ if (metadata == null) {
+ continue;
+ }
eventType = metadata.getEventType();
- if (eventType == null) continue;
+ if (eventType == null) {
+ continue;
+ }
eventTypeString = eventType.getEventType();
try {
@@ -341,10 +358,14 @@
} catch (PerfSONARException pex) {
continue;
}
- if (metadataKeyGenerator == null) continue;
+ if (metadataKeyGenerator == null) {
+ continue;
+ }
key = metadataKeyGenerator.getKey(metadata, data);
- if (key == null) continue;
+ if (key == null) {
+ continue;
+ }
newData = new Data();
newData.setId(data.getId());
@@ -402,8 +423,9 @@
} catch (Exception ex) {
}
- if (xmldbAccess == null || xmldbAccess.isEmpty())
+ if (xmldbAccess == null || xmldbAccess.isEmpty()) {
xmldbAccess = "http";
+ }
XmlDbDataRepository dataRepository =
ExistDbFactory.getDataRepositoryByProperties(
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/SimpleMetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/SimpleMetadataConfigurationStorageManager.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/SimpleMetadataConfigurationStorageManager.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -85,9 +85,9 @@
public void initStorage(Key dataRepository) throws PerfSONARException
{
- if (dataRepository == null)
+ if (dataRepository == null) {
this.xmlFile = configuration.getProperty("service.ma.conf_file");
- else {
+ } else {
Parameter param =
dataRepository.getParameterByName("service.ma.conf_file");
this.xmlFile = param.getParameterValue();
@@ -144,11 +144,12 @@
Map<String, Element> elements =
transformations.transformResults(output, tagNames);
- if (elements == null)
+ if (elements == null) {
throw new PerfSONARException(
"warning.ma.metadata_configuration",
"SimpleMetadataConfigurationStorageManager.fetch: "
+ "No metadata in metadata configuration file");
+ }
logger.debug("SimpleMetadataConfigurationStorageManager.fetch: "
+ "The number of elements returned as a result of xquery
statement: "
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
2012-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/Transformations.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -96,11 +96,12 @@
// + "start getMetadataQuery");
- if (query == null)
+ if (query == null) {
throw new PerfSONARException(
"error.ma.query",
"Transformations.getMetadataQuery: "
+ "Input message is null");
+ }
Metadata metadata;
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/L2PathStatusKeyGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -28,9 +28,13 @@
{
if (metadata.getSubject() != null &&
- metadata.getSubject().getChildrenByType("link").isEmpty())
return null;
+ metadata.getSubject().getChildrenByType("link").isEmpty()) {
+ return null;
+ }
- if (metadata.getEventType() == null) return null;
+ if (metadata.getEventType() == null) {
+ return null;
+ }
Link link = (Link)
metadata.getSubject().getChildrenByType("link").get(0);
String pathId = link.getNameElement().getName();
@@ -53,10 +57,12 @@
}
- if (ibatisConfig == null)
+ if (ibatisConfig == null) {
ibatisConfig =
getIbatisConfig(metadata.getEventType().getEventType());
- if (ibatisConfig == null)
+ }
+ if (ibatisConfig == null) {
return null;
+ }
Key key = new Key();
key.addParameter("pathId", pathId);
@@ -95,17 +101,19 @@
org.perfsonar.service.measurementArchive.eventTypeConfig.EventType
eventType =
eventTypeConfigurationComponent.getEventType(eventTypeStr);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"SQLTypeMAServiceEngine.getStoreKey: "
+ "eventType " + eventTypeStr + " is not supported");
+ }
String ibatisConfigStr = eventType.getIbatisConfig();
- if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty())
+ if (ibatisConfigStr == null || ibatisConfigStr.trim().isEmpty()) {
return null;
+ }
Parameter ibatisConfig = new Parameter();
ibatisConfig.setParameterName("ibatisConfig");
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/keyGenerator/MetadataKeyGeneratorFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -37,22 +37,24 @@
EventType eventType =
eventTypeConfigurationComponent.getEventType(eventTypeName);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"MetadataKeyGeneratorFactory.getMetadataKeyGenerator: "
+ "eventType " + eventTypeName + " is not supported");
+ }
String className = eventType.getMetadataKeyGenerator();
- if (className == null || className.trim().isEmpty())
+ if (className == null || className.trim().isEmpty()) {
throw new PerfSONARException(
"error.ma.event_type_mapping_configuration",
"MetadataKeyGeneratorFactory.getMetadataKeyGenerator: "
+ "Could not find class name for eventType "
+ eventTypeName);
+ }
MetadataKeyGenerator metadataKeyGenerator;
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/BwctlQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -72,11 +72,12 @@
{
- if (query == null)
+ if (query == null) {
throw new PerfSONARException(
"error.ma.query",
"BwctlQueryGenerator.getMetadataQuery: "
+ "Input message is null");
+ }
String src = "";
@@ -107,10 +108,11 @@
Parameters params = metadata.getParameters();
for (String parameter : parameters) {
- if (params.getParameterByName(parameter) != null)
+ if (params.getParameterByName(parameter) != null) {
parametersMap.put(parameter,
(params.getParameterByName(parameter).getParameterValue() != null ?
params.getParameterByName(parameter).getParameterValue().trim() : ""));
+ }
}
if (end != null) {
@@ -130,14 +132,17 @@
+ " for $i in //nmwg:metadata \n"
+ " where 1
\n";
- if (!eventType.isEmpty())
+ if (!eventType.isEmpty()) {
xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
+ }
- if (!src.isEmpty())
+ if (!src.isEmpty()) {
xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
+ }
- if (!dst.isEmpty())
+ if (!dst.isEmpty()) {
xQuery += "and
$i/bwctl:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
+ }
Set<String> keySet = parametersMap.keySet();
for (String key : keySet) {
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/DiscardsQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -110,8 +110,9 @@
if (keywordParameter != null) {
keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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')] ";
+ }
}
Subject subject = (Subject) metadata.getSubject();
@@ -200,68 +201,80 @@
+ " where 1 \n";
- if (eventType != null)
+ if (eventType != null) {
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] "
+ keywordQueryPart;
+ }
if (ipAddress != null) {
- if (ipAddress.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty() && ifAddressType == null)
+ if (ifAddress.isEmpty() && ifAddressType == null) {
throw new PerfSONARException("error.ma.query",
"DiscardsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.isEmpty())
+ }
+ if (!ifAddress.isEmpty()) {
xQuery += "and
$i/discards:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
}
if (ifIndex != null) {
- if (ifIndex.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/ErrorsQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -110,8 +110,9 @@
if (keywordParameter != null) {
keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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')] ";
+ }
}
Subject subject = (Subject) metadata.getSubject();
@@ -199,68 +200,80 @@
+ " where 1 \n";
- if (eventType != null)
+ if (eventType != null) {
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] "
+ keywordQueryPart;
+ }
if (ipAddress != null) {
- if (ipAddress.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty() && ifAddressType == null)
+ if (ifAddress.isEmpty() && ifAddressType == null) {
throw new PerfSONARException("error.ma.query",
"ErrorsQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.isEmpty())
+ }
+ if (!ifAddress.isEmpty()) {
xQuery += "and
$i/errors:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
}
if (ifIndex != null) {
- if (ifIndex.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/IperfQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -111,8 +111,9 @@
if (keywordParameter != null) {
keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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')] ";
+ }
}
// iperf parameters
@@ -127,10 +128,11 @@
}
if (params != null) {
for (String parameter : parameters) {
- if (params.getParameterByName(parameter) != null)
+ if (params.getParameterByName(parameter) != null) {
iperfParametersMap.put(parameter,
(params.getParameterByName(parameter).getParameterValue() != null ?
params.getParameterByName(parameter).getParameterValue().trim() : ""));
+ }
}
}
@@ -205,36 +207,43 @@
if (eventType != null)
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
*/
- if (eventType != null)
+ if (eventType != null) {
xQuery += "and
(($i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='" + eventType + "'
and functx:trim(@name)='supportedEventType') "
+ "or (functx:trim(@value)='" + eventType + "' and
functx:trim(@name)='supportedEventType')]) "
+ "or "
+ "($i/nmwg:eventType[functx:trim(text())='" + eventType +
"'])"
+ ") "
+ keywordQueryPart;
+ }
if (src != null) {
- if (src.isEmpty())
+ 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().isEmpty())
+ if (!sourceElement.getPort().trim().isEmpty()) {
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:src[functx:trim(@port)='" +
sourceElement.getPort().trim() + "'] ";
- if (!sourceElement.getType().trim().isEmpty())
+ }
+ 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.isEmpty())
+ 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().isEmpty())
+ if (!destinationElement.getPort().trim().isEmpty()) {
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(@port)='" +
destinationElement.getPort().trim() + "'] ";
- if (!destinationElement.getType().trim().isEmpty())
+ }
+ if (!destinationElement.getType().trim().isEmpty()) {
xQuery += "and
$i/iperf:subject/nmwgt:endPointPair/nmwgt:dst[functx:trim(@type)='" +
destinationElement.getType().trim() + "'] ";
+ }
}
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -107,8 +107,9 @@
if (keywordParameter != null) {
String keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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";
+ }
}
// situation when only eventType is provided in the request
@@ -281,10 +282,10 @@
String node1;
- if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty())
+ if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty()) {
node1 = " let $node1_metadata := '' \n"
+ " let $node1_id := '' ";
- else
+ } else {
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -299,13 +300,14 @@
+ "
fn:data($node1_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
String node2;
- if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty())
+ if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty()) {
node2 = " let $node2_metadata := '' \n"
+ " let $node2_id := '' ";
- else
+ } else {
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -320,6 +322,7 @@
+ "
fn:data($node2_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
xQuery = "\n "
@@ -391,10 +394,10 @@
}
String node;
- if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty())
+ if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty()) {
node = " let $node_metadata := '' \n"
+ " let $node_id := '' ";
- else
+ } else {
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -409,6 +412,7 @@
+ "
fn:data($node_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
xQuery = "\n "
+ "\n "
+ node
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGeneratorTMP.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -110,8 +110,9 @@
if (keywordParameter != null) {
String keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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";
+ }
}
// situation when only eventType is provided in the request
@@ -285,10 +286,10 @@
String node1;
- if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty())
+ if (node1Name.isEmpty() && node1Country.isEmpty() &&
node1City.isEmpty() && node1Institution.isEmpty()) {
node1 = " let $node1_metadata := '' \n"
+ " let $node1_id := '' ";
- else
+ } else {
node1 = " let $node1_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -303,13 +304,14 @@
+ "
fn:data($node1_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
String node2;
- if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty())
+ if (node2Name.isEmpty() && node2Country.isEmpty() &&
node2City.isEmpty() && node2Institution.isEmpty()) {
node2 = " let $node2_metadata := '' \n"
+ " let $node2_id := '' ";
- else
+ } else {
node2 = " let $node2_metadata :=
\n"
+ " for $j in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -324,6 +326,7 @@
+ "
fn:data($node2_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
xQuery = "\n "
@@ -395,10 +398,10 @@
}
String node;
- if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty())
+ if (nodeName.isEmpty() && nodeCountry.isEmpty() &&
nodeCity.isEmpty() && nodeInstitution.isEmpty()) {
node = " let $node_metadata := '' \n"
+ " let $node_id := '' ";
- else
+ } else {
node = " let $node_metadata :=
\n"
+ " for $i in //nmwg:metadata
\n"
+ " where 1
\n"
@@ -413,6 +416,7 @@
+ "
fn:data($node_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ " else
\n"
+ " ''
\n";
+ }
xQuery = "\n "
+ "\n "
+ node
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/MetadataQueryGeneratorFactory.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -48,11 +48,12 @@
EventType eventType =
eventTypeConfigurationComponent.getEventType(eventTypeName);
- if (eventType == null)
+ if (eventType == null) {
throw new PerfSONARException(
"error.ma.query",
"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
+ "eventType " + eventTypeName + " is not supported");
+ }
String className = eventType.getMetadataQueryGenerator();
@@ -62,12 +63,13 @@
// + "class name for eventType (" + eventTypeName + "): "
// + className);
- if (className == null || className.trim().isEmpty())
+ if (className == null || className.trim().isEmpty()) {
throw new PerfSONARException(
"error.ma.metadata_query_mapping_configuration",
"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
+ "Could not find class name for eventType "
+ eventTypeName);
+ }
MetadataQueryGenerator metadataQueryGenerator;
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/OwampQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -110,10 +110,11 @@
Parameters params = metadata.getParameters();
if (params != null) {
for (String parameter : parameters) {
- if (params.getParameterByName(parameter) != null)
+ if (params.getParameterByName(parameter) != null) {
parametersMap.put(parameter,
(params.getParameterByName(parameter).getParameterValue() != null ?
params.getParameterByName(parameter).getParameterValue().trim() : ""));
+ }
}
}
@@ -136,14 +137,17 @@
+ " where 1
\n";
- if (!eventType.isEmpty())
+ if (!eventType.isEmpty()) {
xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
+ }
- if (!src.isEmpty())
+ if (!src.isEmpty()) {
xQuery += "and
$i/owamp:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
+ }
- if (!dst.isEmpty())
+ if (!dst.isEmpty()) {
xQuery += "and
$i/owamp:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
+ }
Set<String> keySet = parametersMap.keySet();
for (String key : keySet) {
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/PingQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -71,11 +71,12 @@
{
- if (query == null)
+ if (query == null) {
throw new PerfSONARException(
"error.ma.query",
"PingQueryGenerator.getMetadataQuery: "
+ "Input message is null");
+ }
String src = "";
String dst = "";
@@ -106,13 +107,14 @@
Parameters params = metadata.getParameters();
- if (params != null)
+ if (params != null) {
for (String parameter : parameters) {
if (params.getParameterByName(parameter) != null)
parametersMap.put(parameter,
(params.getParameterByName(parameter).getParameterValue() != null ?
params.getParameterByName(parameter).getParameterValue().trim() : ""));
}
+ }
if (end != null) {
src = (end.getSourceElement() != null ?
end.getSourceElement().getValue().trim() : "");
@@ -132,14 +134,17 @@
+ " where 1
\n";
- if (!eventType.isEmpty())
+ if (!eventType.isEmpty()) {
xQuery += "and $i/nmwg:eventType[(text()='" + eventType + "')]";
+ }
- if (!src.isEmpty())
+ if (!src.isEmpty()) {
xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:src[@value='"
+ src + "']";
+ }
- if (!dst.isEmpty())
+ if (!dst.isEmpty()) {
xQuery += "and
$i/ping:subject/nmwgt:endPointPair/nmwgt:dst[@value='"
+ dst + "']";
+ }
Set<String> keySet = parametersMap.keySet();
for (String key : keySet) {
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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -110,8 +110,9 @@
if (keywordParameter != null) {
keyword = keywordParameter.getParameterValue();
- if (!keyword.trim().isEmpty())
+ 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')] ";
+ }
}
Subject subject = (Subject) metadata.getSubject();
@@ -204,72 +205,84 @@
if (eventType != null)
xQuery += "and $i/nmwg:eventType[functx:trim(text())='" +
eventType + "'] ";
*/
- if (eventType != null)
+ if (eventType != null) {
xQuery += "and
(($i/nmwg:parameters/nmwg:parameter[(functx:trim(text())='" + eventType + "'
and functx:trim(@name)='supportedEventType') "
+ "or (functx:trim(@value)='" + eventType + "' and
functx:trim(@name)='supportedEventType')]) "
+ "or "
+ "($i/nmwg:eventType[functx:trim(text())='" + eventType +
"'])"
+ ") "
+ keywordQueryPart;
+ }
if (ipAddress != null) {
- if (ipAddress.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty() && ifAddressType == null)
+ if (ifAddress.isEmpty() && ifAddressType == null) {
throw new PerfSONARException("error.ma.query",
"UtilizationQueryGenerator.getMetadataQuery: wrong ifAddress");
- if (!ifAddress.isEmpty())
+ }
+ if (!ifAddress.isEmpty()) {
xQuery += "and
$i/netutil:subject/nmwgt:interface/nmwgt:ifAddress[functx:trim(text())='" +
ifAddress + "'] ";
+ }
}
if (ifIndex != null) {
- if (ifIndex.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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.isEmpty())
+ 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-10-05 09:22:46 UTC (rev 6011)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-10-05 09:22:48 UTC (rev 6012)
@@ -166,9 +166,10 @@
try {
lsURL = configuration.getProperty("service.r.ls_url");
- if (lsURL != null)
+ if (lsURL != null) {
if (!lsURL.trim().isEmpty())
lsURLArray = lsURL.split(",");
+ }
} catch (PatternSyntaxException ex) {
throw new PerfSONARException(
"error.ma.register",
- [pS-dev] [GEANT/SA2/ps-java-services] r6012 - 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/store perfsonar _base/src/main/java/org/perfsonar/base/auxiliary perfson ar_base/src/main/java/org/perfsonar/base/auxiliary/compo nents/authn perfsonar_base/src/main/java/org/perfsonar/b ase/auxiliary/components/scheduler perfsonar_base/src/ma in/java/org/perfsonar/base/auxiliary/components/simplesche duler perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/base/util/ iptrie perfsonar_base/src/main/java/org/perfsonar/client /base/requests/lookupService perfsonar_base/src/main/jav a/org/perfsonar/client/base/xquery/lookupService perfsonar _base/src/main/java/org/perfsonar/client/testHarness per fsonar_base/src/main/java/org/perfsona r/service/base/au thn perfsonar_base/src/main/java/org/perfsonar/service/b ase/authn/tokens perfsonar_base/src/main/java/org/perfso nar/service/base/messages perfsonar_base/src/main/java/o rg/perfsonar/service/base/registration perfsonar_base/sr c/main/java/org/perfsonar/service/base/storage/xmldb perfs onar_base/src/main/java/org/perfsonar/service/base/stora ge/xmldb/exist/rest perfsonar_base/src/main/java/org/per fsonar/service/base/storage/xmldb/exist/xmlrpc perfsonar _base/src/main/java/org/perfsonar/service/base/storage/x mlfile perfsonar_base/src/main/java/org/perfsonar/servic e/base/transport perfsonar_base/src/main/java/org/perfso nar/service/base/util perfsonar_base/src/main/java/org/p erfsonar/service/base/web perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/metadataConfig per fsonar_base/src/main/java/org/perfsonar/service/measurem entArchive/metadataConfig/keyGenerator perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/metad ataConfig/quer yGenerator perfsonar_base/src/main/java/o rg/perfsonar/service/measurementArchive/register, svn-noreply, 10/05/2012
Archive powered by MHonArc 2.6.16.