perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6000 - 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/compone nts/authn perfsonar_base/src/main/java/org/perfsonar/bas e/auxiliary/components/scheduler perfsonar_base/src/main /java/org/perfsonar/base/auxiliary/components/scheduler/ac tions perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/client/bas e/authn/saslca perfsonar_base/src/main/java/org/perfsona r/client/base/requests/authService perfsonar_base/src/ma in/java/org/perfsonar/client/testHarness perfsonar_base/ src/main/java/org/perfsonar/service/base/authn perfsonar _base/src/main/java/org/perfsonar/service/base/authn/tok ens perfsonar_base/src/main/java/org/per fsonar/service/ base/messages perfsonar_base/src/main/java/org/perfsonar /service/base/registration perfsonar_base/src/main/java/ org/perfsonar/service/base/storage/xmldb perfsonar_base/ src/main/java/org/perfsonar/service/measurementArchive/met adataConfig perfsonar_base/src/main/java/org/perfsonar/s ervice/measurementArchive/register
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r6000 - 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/compone nts/authn perfsonar_base/src/main/java/org/perfsonar/bas e/auxiliary/components/scheduler perfsonar_base/src/main /java/org/perfsonar/base/auxiliary/components/scheduler/ac tions perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/client/bas e/authn/saslca perfsonar_base/src/main/java/org/perfsona r/client/base/requests/authService perfsonar_base/src/ma in/java/org/perfsonar/client/testHarness perfsonar_base/ src/main/java/org/perfsonar/service/base/authn perfsonar _base/src/main/java/org/perfsonar/service/base/authn/tok ens perfsonar_base/src/main/java/org/per fsonar/service/ base/messages perfsonar_base/src/main/java/org/perfsonar /service/base/registration perfsonar_base/src/main/java/ org/perfsonar/service/base/storage/xmldb perfsonar_base/ src/main/java/org/perfsonar/service/measurementArchive/met adataConfig perfsonar_base/src/main/java/org/perfsonar/s ervice/measurementArchive/register
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6000 - 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/compone nts/authn perfsonar_base/src/main/java/org/perfsonar/bas e/auxiliary/components/scheduler perfsonar_base/src/main /java/org/perfsonar/base/auxiliary/components/scheduler/ac tions perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/client/bas e/authn/saslca perfsonar_base/src/main/java/org/perfsona r/client/base/requests/authService perfsonar_base/src/ma in/java/org/perfsonar/client/testHarness perfsonar_base/ src/main/java/org/perfsonar/service/base/authn perfsonar _base/src/main/java/org/perfsonar/service/base/authn/tok ens perfsonar_base/src/main/java/org/per fsonar/service/ base/messages perfsonar_base/src/main/java/org/perfsonar /service/base/registration perfsonar_base/src/main/java/ org/perfsonar/service/base/storage/xmldb perfsonar_base/ src/main/java/org/perfsonar/service/measurementArchive/met adataConfig perfsonar_base/src/main/java/org/perfsonar/s ervice/measurementArchive/register
- Date: Tue, 11 Sep 2012 08:41:39 +0100 (BST)
Author: nordunet.behrmann
Date: 2012-09-11 08:41:39 +0100 (Tue, 11 Sep 2012)
New Revision: 6000
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/SQLStorageManager.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/UtilizationResponseGenerator.java
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcess.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/scheduler/actions/SchedulerAction.java
trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AttrEERequestGenerator.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPUbCClient.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCMDSTest.java
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCSaslTest.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.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/AuthNResponse.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthRResponse.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/DataRequest.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/MessageHandlerFactory.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/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
Log:
Use Java 5 style foreach loop when possible
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/BaseChainingMergerFactory.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -30,9 +30,9 @@
String[] mergerNamesArray = mergerNames.split("\\s*,\\s*");
- for (int i = 0; i < mergerNamesArray.length; i++) {
+ for (String aMergerNamesArray : mergerNamesArray) {
- String mergerName = mergerNamesArray[i].trim();
+ String mergerName = aMergerNamesArray.trim();
if (mergerName.equals(""))
continue;
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/SQLStorageManager.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -117,9 +117,8 @@
Parameters params = (Parameters) o;
Parameter[] paramsArray = params.getParameterArray();
- for (int i = 0; i < paramsArray.length; i++) {
+ for (Parameter p : paramsArray) {
- Parameter p = paramsArray[i];
String pname = p.getParameterName();
//String pvalue = p.getParameterValue();
String pvalue = "";
@@ -134,8 +133,8 @@
startTime = Long.parseLong(pvalue);
} catch (NumberFormatException nfex) {
throw new PerfSONARException(
- "error.ma.query",
- "SQLStorageManager.fetch: "
+ "error.ma.query",
+ "SQLStorageManager.fetch: "
+ "startTime parameter in the request "
+ "has wrong format");
}
@@ -148,8 +147,8 @@
endTime = Long.parseLong(pvalue);
} catch (NumberFormatException nfex) {
throw new PerfSONARException(
- "error.ma.query",
- "SQLStorageManager.fetch: "
+ "error.ma.query",
+ "SQLStorageManager.fetch: "
+ "endTime parameter in the request "
+ "has wrong format");
}
@@ -248,8 +247,7 @@
// moving parameters from key into ibatisParam map
Parameter[] paramsArray =
key.getParameters().getParameterArray();
- for (int i = 0; i < paramsArray.length; i++) {
- Parameter param = paramsArray[i];
+ for (Parameter param : paramsArray) {
ibatisParams.put(param.getParameterName(),
param.getParameterValue());
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/BwctlResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -42,67 +42,66 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
- Datum datum = new Datum();
+ Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
- for (String column : kCollection) {
+ for (String column : kCollection) {
- Object value = resultMap.get(column);
- String className = value.getClass().getName();
- String strValue = null;
+ Object value = resultMap.get(column);
+ String className = value.getClass().getName();
+ String strValue = null;
- if (className.equals("java.lang.Float"))
- strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
- strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
- strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
- strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
- strValue = ((Date) value).toString();
- else if (className.equals("java.lang.String"))
- strValue = (String) value;
+ if (className.equals("java.lang.Float"))
+ strValue = Float.toString((Float) value);
+ if (className.equals("java.lang.Double"))
+ strValue = Double.toString((Double) value);
+ else if (className.equals("java.lang.Integer"))
+ strValue = Integer.toString((Integer) value);
+ else if (className.equals("java.lang.Long"))
+ strValue = Long.toString((Long) value);
+ else if (className.equals("java.lang.Date"))
+ strValue = ((Date) value).toString();
+ else if (className.equals("java.lang.String"))
+ strValue = (String) value;
- if (strValue != null) {
+ 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);
+ }
+ }
- }
+ data.addChild(datum);
- data.addChild(datum);
+ }
- }
-
return data;
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/DiscardsResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -46,12 +46,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/ErrorsResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -46,12 +46,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/GenericResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -46,12 +46,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/IperfResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -46,12 +46,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/L2PathStatusResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -50,12 +50,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
@@ -84,7 +84,8 @@
stateOper.setStateOper(strValue);
datum.addChild(stateOper);
- } if (column.equals("status_admin")) {
+ }
+ if (column.equals("status_admin")) {
StateAdmin stateAdmin = new StateAdmin();
stateAdmin.setStateAdmin(strValue);
@@ -97,8 +98,8 @@
NamespaceSupport support = new NamespaceSupport();
support.declarePrefix(datum.getPrefix(),
datum.getUri());
- datum.addAttr("timeValue" , strValue, support);
- datum.addAttr("timeType" , "unix", support);
+ datum.addAttr("timeValue", strValue, support);
+ datum.addAttr("timeType", "unix", support);
}
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/OwampResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -84,132 +84,132 @@
}
System.out.println("Here 1");
- for (int i = 0; i < resultList.size(); i++) {
- System.out.println("Here 2");
+ for (Object aResultList : resultList) {
+ System.out.println("Here 2");
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection = ((Map)
resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
- if (owamp) {
- Datum datum = new Datum();
-
- for (String column : kCollection) {
- System.out.println("Here 3");
- Object value = resultMap.get(column);
- String className =
value.getClass().getName();
- String strValue = null;
+ if (owamp) {
+ Datum datum = new Datum();
- if
(className.equals("java.lang.Float"))
- strValue =
Float.toString((Float) value);
- if
(className.equals("java.lang.Double"))
- strValue =
Double.toString((Double) value);
- else if
(className.equals("java.lang.Integer"))
- strValue =
Integer.toString((Integer) value);
- else if
(className.equals("java.lang.Long"))
- strValue =
Long.toString((Long) value);
- else if
(className.equals("java.lang.Date"))
- strValue = ((Date)
value).toString();
- else if
(className.equals("java.lang.String"))
- strValue = (String) value;
+ for (String column : kCollection) {
+ System.out.println("Here 3");
+ Object value = resultMap.get(column);
+ String className = value.getClass().getName();
+ String strValue = null;
- if (strValue != null) {
- System.out.println("Here 4");
- if (column.equals("seqNum"))
-
datum.setSeqNum(strValue);
- else if
(column.equals("sendTime"))
-
datum.setSendTime(strValue);
- else if
(column.equals("sendSynchronized"))
-
datum.setSendSynchronized(strValue);
- else if
(column.equals("sendTimeError"))
-
datum.setSendTimeError(strValue);
- else if
(column.equals("receiveTime"))
-
datum.setReceiveTime(strValue);
- else if
(column.equals("receiveSynchronized"))
-
datum.setReceiveSynchronized(strValue);
- else if
(column.equals("receiveTimeError"))
-
datum.setReceiveTimeError(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 (className.equals("java.lang.Float"))
+ strValue = Float.toString((Float) value);
+ if (className.equals("java.lang.Double"))
+ strValue = Double.toString((Double) value);
+ else if (className.equals("java.lang.Integer"))
+ strValue = Integer.toString((Integer) value);
+ else if (className.equals("java.lang.Long"))
+ strValue = Long.toString((Long) value);
+ else if (className.equals("java.lang.Date"))
+ strValue = ((Date) value).toString();
+ else if (className.equals("java.lang.String"))
+ strValue = (String) value;
- //
logger.debug("SQLStorageManager.fetch: "
- } // + "column: " + column + ",
value: " + strValue );
+ if (strValue != null) {
+ System.out.println("Here 4");
+ if (column.equals("seqNum"))
+ datum.setSeqNum(strValue);
+ else if (column.equals("sendTime"))
+ datum.setSendTime(strValue);
+ else if (column.equals("sendSynchronized"))
+ datum.setSendSynchronized(strValue);
+ else if (column.equals("sendTimeError"))
+ datum.setSendTimeError(strValue);
+ else if (column.equals("receiveTime"))
+ datum.setReceiveTime(strValue);
+ else if (column.equals("receiveSynchronized"))
+ datum.setReceiveSynchronized(strValue);
+ else if (column.equals("receiveTimeError"))
+ datum.setReceiveTimeError(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);
- }
- data.addChild(datum);
+ // logger.debug("SQLStorageManager.fetch: "
+ } // + "column: " + column + ", value: " + strValue );
- } else {
- OwampAggregationDatum datum = new
OwampAggregationDatum();
-
-
- for (String column : kCollection) {
- System.out.println("Here 3");
- Object value = resultMap.get(column);
- String className =
value.getClass().getName();
- String strValue = null;
+ }
+ data.addChild(datum);
- if
(className.equals("java.lang.Float"))
- strValue =
Float.toString((Float) value);
- if
(className.equals("java.lang.Double"))
- strValue =
Double.toString((Double) value);
- else if
(className.equals("java.lang.Integer"))
- strValue =
Integer.toString((Integer) value);
- else if
(className.equals("java.lang.Long"))
- strValue =
Long.toString((Long) value);
- else if
(className.equals("java.lang.Date"))
- strValue = ((Date)
value).toString();
- else if
(className.equals("java.lang.String"))
- strValue = (String) value;
+ } else {
+ OwampAggregationDatum datum = new OwampAggregationDatum();
- if (strValue != null) {
- System.out.println("Here 4");
- if (column.equals("sender"))
-
datum.setSender(strValue);
- else if
(column.equals("receiver"))
-
datum.setReceiver(strValue);
- else if
(column.equals("sent"))
-
datum.setSent(strValue);
- else if
(column.equals("loss"))
-
datum.setLoss(strValue);
- else if
(column.equals("lostPercent"))
-
datum.setLostPercent(strValue);
- else if
(column.equals("duplicates"))
-
datum.setDuplicates(strValue);
- else if
(column.equals("minDelay"))
-
datum.setMinDelay(strValue);
- else if
(column.equals("medDelay"))
-
datum.setMedDelay(strValue);
- else if
(column.equals("maxDelay"))
-
datum.setMaxDelay(strValue);
- else if
(column.equals("error"))
-
datum.setError(strValue);
- else if
(column.equals("delayUnits"))
-
datum.setDelayUnits(strValue);
- else if
(column.equals("errorUnits"))
-
datum.setErrorUnits(strValue);
- else if
(column.equals("jitter"))
-
datum.setJitter(strValue);
- else if
(column.equals("jitterUnits"))
-
datum.setJitterUnits(strValue);
- else if
(column.equals("hops"))
-
datum.setHops(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 );
+ for (String column : kCollection) {
+ System.out.println("Here 3");
+ Object value = resultMap.get(column);
+ String className = value.getClass().getName();
+ String strValue = null;
- }
-
- data.addChild(datum);
- }
+ if (className.equals("java.lang.Float"))
+ strValue = Float.toString((Float) value);
+ if (className.equals("java.lang.Double"))
+ strValue = Double.toString((Double) value);
+ else if (className.equals("java.lang.Integer"))
+ strValue = Integer.toString((Integer) value);
+ else if (className.equals("java.lang.Long"))
+ strValue = Long.toString((Long) value);
+ else if (className.equals("java.lang.Date"))
+ strValue = ((Date) value).toString();
+ else if (className.equals("java.lang.String"))
+ strValue = (String) value;
- }
+ if (strValue != null) {
+ System.out.println("Here 4");
+ if (column.equals("sender"))
+ datum.setSender(strValue);
+ else if (column.equals("receiver"))
+ datum.setReceiver(strValue);
+ else if (column.equals("sent"))
+ datum.setSent(strValue);
+ else if (column.equals("loss"))
+ datum.setLoss(strValue);
+ else if (column.equals("lostPercent"))
+ datum.setLostPercent(strValue);
+ else if (column.equals("duplicates"))
+ datum.setDuplicates(strValue);
+ else if (column.equals("minDelay"))
+ datum.setMinDelay(strValue);
+ else if (column.equals("medDelay"))
+ datum.setMedDelay(strValue);
+ else if (column.equals("maxDelay"))
+ datum.setMaxDelay(strValue);
+ else if (column.equals("error"))
+ datum.setError(strValue);
+ else if (column.equals("delayUnits"))
+ datum.setDelayUnits(strValue);
+ else if (column.equals("errorUnits"))
+ datum.setErrorUnits(strValue);
+ else if (column.equals("jitter"))
+ datum.setJitter(strValue);
+ else if (column.equals("jitterUnits"))
+ datum.setJitterUnits(strValue);
+ else if (column.equals("hops"))
+ datum.setHops(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 );
+
+ }
+
+ data.addChild(datum);
+ }
+
+ }
System.out.println("Here 6");
return data;
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/PingResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -41,13 +41,13 @@
Data data = new Data();
-
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
+
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
@@ -58,11 +58,11 @@
if (className.equals("java.lang.Float"))
strValue = Float.toString((Float) value);
if (className.equals("java.lang.Double"))
- strValue = Double.toString((Double) value);
+ strValue = Double.toString((Double) value);
else if (className.equals("java.lang.Integer"))
strValue = Integer.toString((Integer) value);
else if (className.equals("java.lang.Long"))
- strValue = Long.toString((Long) value);
+ strValue = Long.toString((Long) value);
else if (className.equals("java.lang.Date"))
strValue = ((Date) value).toString();
else if (className.equals("java.lang.String"))
@@ -70,18 +70,18 @@
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);
-
- //logger.debug("SQLStorageManager.fetch: "
- // + "column: " + column + ", value: " + 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/UtilizationResponseGenerator.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/UtilizationResponseGenerator.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/fetch/UtilizationResponseGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -46,12 +46,12 @@
Data data = new Data();
- for (int i = 0; i < resultList.size(); i++) {
+ for (Object aResultList : resultList) {
Datum datum = new Datum();
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
+ Map resultMap = (Map) aResultList;
+ Collection<String> kCollection = ((Map) aResultList).keySet();
for (String column : kCollection) {
Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcess.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcess.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/store/StoreRequestProcess.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -84,9 +84,9 @@
return;
}
- for (int i = 0; i < datumVector.size(); i++) {
+ for (Object aDatumVector : datumVector) {
- Element datum = (Element) datumVector.get(i);
+ Element datum = (Element) aDatumVector;
prepareStoreParameters(datum, ibatisParams);
sqlMap.insert("setResults", ibatisParams);
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/authn/DynamicCrypto.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -281,11 +281,11 @@
public byte[] getCertificateData(boolean reverse, X509Certificate[]
certs)
throws WSSecurityException {
Vector<X509Certificate> list = new Vector<X509Certificate>();
- for (int i = 0; i < certs.length; i++) {
+ for (X509Certificate cert : certs) {
if (reverse) {
- list.insertElementAt(certs[i], 0);
+ list.insertElementAt(cert, 0);
} else {
- list.add(certs[i]);
+ list.add(cert);
}
}
try {
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/Scheduler.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -238,36 +238,35 @@
ScheduleMessageParser parser = new ScheduleMessageParser();
Vector<String> metadataIdVector = new Vector<String>();
- for(int i=0;i<scheduleResults.length;i++) {
-
- try{
- parser.parse(scheduleResults[i]);
- Metadata metadataElement = (Metadata)
parser.getElement("metadata");
- Subject subjectElement = metadataElement.getSubject();
- String metadataIdRef = subjectElement.getMetadataIdRef();
-
- if(metadataIdRef==null ||
metadataIdRef.equalsIgnoreCase("")) {
- logger.error("Scheduler.readSchedules: Corrupt entry
found in the " +
- "list of schedules to be executed.
This entry, " +
- "with metadata
id="+metadataElement.getId()+" does not" +
- "refer to any metadata chain that
should be executed");
- throw new
PerfSONARException("error.common.scheduler.init",
- "Scheduler: Corrupt entry found in the " +
- "list of schedules to be executed.
Metadata reference missing " +
- "in metadata element"
+metadataElement.getId());
-
- }
-
- metadataIdVector.add(metadataIdRef);
- }
- catch(Exception e) {
- logger.error("Scheduler.readSchedules: Could not execute
all schedules: " +
- "Encountered the following error:
"+e.getMessage());
-
- }
-
-
- }
+ for (String scheduleResult : scheduleResults) {
+
+ try {
+ parser.parse(scheduleResult);
+ Metadata metadataElement = (Metadata)
parser.getElement("metadata");
+ Subject subjectElement = metadataElement.getSubject();
+ String metadataIdRef = subjectElement.getMetadataIdRef();
+
+ if (metadataIdRef == null ||
metadataIdRef.equalsIgnoreCase("")) {
+ logger.error("Scheduler.readSchedules: Corrupt entry
found in the " +
+ "list of schedules to be executed. This entry, " +
+ "with metadata id=" + metadataElement.getId() + "
does not" +
+ "refer to any metadata chain that should be
executed");
+ throw new
PerfSONARException("error.common.scheduler.init",
+ "Scheduler: Corrupt entry found in the " +
+ "list of schedules to be executed. Metadata
reference missing " +
+ "in metadata element" + metadataElement.getId());
+
+ }
+
+ metadataIdVector.add(metadataIdRef);
+ } catch (Exception e) {
+ logger.error("Scheduler.readSchedules: Could not execute all
schedules: " +
+ "Encountered the following error: " + e.getMessage());
+
+ }
+
+
+ }
String[] leafMetadataIds = new String[metadataIdVector.size()];
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/actions/SchedulerAction.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/actions/SchedulerAction.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/auxiliary/components/scheduler/actions/SchedulerAction.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -120,345 +120,327 @@
// schedule chain per iteration below.
// lets work on the given list in sequence
- for(int i=0;i<metadataList.length;i++) {
-
-
+ for (Metadata aMetadataList : metadataList) {
+
+
Message tempMessageObject = new Message();
-
- Metadata metadataElement = metadataList[i];
+
+ Metadata metadataElement = aMetadataList;
Map initialDataMap = requestMessage.getDataMap();
Collection initialDataCollection = initialDataMap.values();
Iterator initialDataIterator = initialDataCollection.iterator();
-
+
tempMessageObject.setMetadata(metadataElement);
-
- if(metadataElement!=null) {
-
+
+ if (metadataElement != null) {
+
String metadataId = metadataElement.getId();
-
+
EventType eventType = metadataElement.getEventType();
-
+
String eventTypeString = eventType.getEventType();
-
+
// set the metadata idrefs in all data. set them all to the
same one now as
// we don't support chaining in individual schedules yet
-
- while(initialDataIterator.hasNext()) {
+
+ while (initialDataIterator.hasNext()) {
Data dataElementInInitialCollection = (Data)
initialDataIterator.next();
dataElementInInitialCollection.setMetadataIdRef(metadataId);
tempMessageObject.setData(dataElementInInitialCollection);
}
-
-
+
+
// use this as message object
requestMessage = tempMessageObject;
-
-
+
+
// TODO: this process needs improvement
-
+
String eventTypeClassName = eventTypeString.concat("_class");
String eventTypeInterfaceName =
eventTypeString.concat("_interface");
eventTypeClassName =
"SchedulerAction.".concat(eventTypeClassName);
eventTypeInterfaceName =
"SchedulerAction.".concat(eventTypeInterfaceName);
String handlerClassName = null;
-
+
try {
-
+
handlerClassName =
configurationComponent.getProperty(eventTypeClassName);
-
- }
- catch(Exception e){
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has to be mapped to a classname (including
package name) in" +
- "the configuration file (service.properties
file). An error has occurred" +
- "while trying to read this mapping. Error
message is: "+e.getMessage());
-
+
+ } catch (Exception e) {
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has to be mapped to a classname (including package
name) in" +
+ "the configuration file (service.properties file).
An error has occurred" +
+ "while trying to read this mapping. Error message
is: " + e.getMessage());
+
return;
-
+
}
-
+
logger.debug("SchedulerAction: Schedule entry contains " +
- "event type: "+eventTypeString+" .SchedulerAction
instructed" +
- " to use class: "+handlerClassName+" for this event
type");
-
-
+ "event type: " + eventTypeString + " .SchedulerAction
instructed" +
+ " to use class: " + handlerClassName + " for this event
type");
+
+
Class handlerClass = null;
try {
-
+
handlerClass = Class.forName(handlerClassName);
-
+
} catch (ClassNotFoundException e1) {
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction (generic) " +
- "cannot find this classname. Possible
configuration error. " +
- "Please provide the exact classname (including
package declaration) " +
- "in the configuration file (service.properties
file)");
-
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction (generic) " +
+ "cannot find this classname. Possible configuration
error. " +
+ "Please provide the exact classname (including
package declaration) " +
+ "in the configuration file (service.properties
file)");
+
return;
-
- } catch(Exception e) {
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction (generic) " +
- "is not able to use this class name for unknown
reasons. Exception " +
- "encountered: "+e.getMessage());
-
+
+ } catch (Exception e) {
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction (generic) " +
+ "is not able to use this class name for unknown
reasons. Exception " +
+ "encountered: " + e.getMessage());
+
return;
-
+
}
-
+
Class[] interfaceClasses = null;
interfaceClasses = handlerClass.getInterfaces();
-
+
String matchedInterfaceClassName = null;
-
+
// this is a hack for rrd storage manager impl
-
-
- if(interfaceClasses == null || interfaceClasses.length==0) {
-
- logger.debug("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+" which does not
implement any interface.");
-
- }
-
- else {
-
- for(int itr=0;itr<interfaceClasses.length;itr++) {
-
+
+
+ if (interfaceClasses == null || interfaceClasses.length ==
0) {
+
+ logger.debug("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + " which does not
implement any interface.");
+
+ } else {
+
+ for (Class interfaceClass : interfaceClasses) {
+
String interfaceClassName = null;
- interfaceClassName = interfaceClasses[itr].getName();
-
-
-
-
-
- if(interfaceClassName.equals(
- "net.geant2.monitoring.nms.service.commons."+
+ interfaceClassName = interfaceClass.getName();
+
+
+ if (interfaceClassName.equals(
+ "net.geant2.monitoring.nms.service.commons." +
"engine.ServiceEngine")) {
-
- matchedInterfaceClassName = interfaceClassName;
-
-
- }
-
- else if(interfaceClassName.equals(
- "net.geant2.monitoring.nms.service.commons."
+
+
+ matchedInterfaceClassName = interfaceClassName;
+
+
+ } else if (interfaceClassName.equals(
+ "net.geant2.monitoring.nms.service.commons." +
"measurementExecutor.MeasurementExecutor")) {
-
- matchedInterfaceClassName = interfaceClassName;
-
- }
-
- else if(interfaceClassName.equals(
- "net.geant2.monitoring.nms.service.commons."
+
+
+ matchedInterfaceClassName = interfaceClassName;
+
+ } else if (interfaceClassName.equals(
+ "net.geant2.monitoring.nms.service.commons." +
"storageManager.StorageManager")) {
-
- matchedInterfaceClassName = interfaceClassName;
-
+
+ matchedInterfaceClassName = interfaceClassName;
+
}
-
+
}
-
+
}
-
-
+
+
// I know that the following code could have been put in the
for loop. But I choose
// to purposely have it here
- if(matchedInterfaceClassName==null){
-
+ if (matchedInterfaceClassName == null) {
+
String interfaceNameFromProperties = null;
- System.out.println("eventTypeInterfaceName:
"+eventTypeInterfaceName);
+ System.out.println("eventTypeInterfaceName: " +
eventTypeInterfaceName);
try {
- interfaceNameFromProperties =
+ interfaceNameFromProperties =
this.configurationComponent.getProperty(eventTypeInterfaceName);
} catch (PerfSONARException e2) {
-
+
matchedInterfaceClassName = null;
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction (generic) is not " +
- "configured to work with any of the
interfaces that it implements. " +
- "No configurations were found in the config
file either. " +
- "SchedulerAction cannot complete this
schedule");
-
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction (generic) is not " +
+ "configured to work with any of the interfaces
that it implements. " +
+ "No configurations were found in the config file
either. " +
+ "SchedulerAction cannot complete this schedule");
+
return;
}
-
+
matchedInterfaceClassName = interfaceNameFromProperties;
}
-
- logger.debug("SchedulerAction: The eventType in schedule:
"+eventTypeString+
- " is configured to be handled by
class"+handlerClassName+" which "+
- "implements the interface:
"+matchedInterfaceClassName);
-
- if(matchedInterfaceClassName!=null){
-
+
+ logger.debug("SchedulerAction: The eventType in schedule: "
+ eventTypeString +
+ " is configured to be handled by class" +
handlerClassName + " which " +
+ "implements the interface: " +
matchedInterfaceClassName);
+
+ if (matchedInterfaceClassName != null) {
+
try {
-
+
Message replyMessage = null;
-
- if( matchedInterfaceClassName.equals
-
("net.geant2.monitoring.nms.service.commons.engine.ServiceEngine") ||
-
matchedInterfaceClassName.equalsIgnoreCase("ServiceEngine") ||
-
matchedInterfaceClassName.equalsIgnoreCase("Service Engine")||
-
matchedInterfaceClassName.equalsIgnoreCase("Service_Engine")) {
-
- logger.debug("SchedulerAction: The event type:
"+eventTypeString+" requires" +
- "contacting a ServiceEngine of type:
"+handlerClassName);
-
- ServiceEngine serviceEngine =
(ServiceEngine)handlerClass.newInstance();
-
- replyMessage =
serviceEngine.takeAction("MAKE_MEASUREMENT",requestMessage);
-
-
- }
-
-
- else if(matchedInterfaceClassName.equals
-
("net.geant2.monitoring.nms.service.commons.measurementExecutor.MeasurementExecutor")
- ||
matchedInterfaceClassName.equalsIgnoreCase("MeasurementExecutor") ||
-
matchedInterfaceClassName.equalsIgnoreCase("Measurement Executor") ||
-
matchedInterfaceClassName.equalsIgnoreCase("Measurement_Executor")) {
-
- logger.debug("SchedulerAction: The event type:
"+eventTypeString+" requires" +
- "contacting a MeasurementExecutor of
type: "+handlerClassName);
-
- MeasurementExecutor measurementExecutor =
(MeasurementExecutor)handlerClass.newInstance();
+
+ if (matchedInterfaceClassName.equals
+
("net.geant2.monitoring.nms.service.commons.engine.ServiceEngine") ||
+
matchedInterfaceClassName.equalsIgnoreCase("ServiceEngine") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Service Engine") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Service_Engine")) {
+
+ logger.debug("SchedulerAction: The event type: "
+ eventTypeString + " requires" +
+ "contacting a ServiceEngine of type: " +
handlerClassName);
+
+ ServiceEngine serviceEngine = (ServiceEngine)
handlerClass.newInstance();
+
+ replyMessage =
serviceEngine.takeAction("MAKE_MEASUREMENT", requestMessage);
+
+
+ } else if (matchedInterfaceClassName.equals
+
("net.geant2.monitoring.nms.service.commons.measurementExecutor.MeasurementExecutor")
+ ||
matchedInterfaceClassName.equalsIgnoreCase("MeasurementExecutor") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Measurement Executor") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Measurement_Executor")) {
+
+ logger.debug("SchedulerAction: The event type: "
+ eventTypeString + " requires" +
+ "contacting a MeasurementExecutor of type: "
+ handlerClassName);
+
+ MeasurementExecutor measurementExecutor =
(MeasurementExecutor) handlerClass.newInstance();
replyMessage =
measurementExecutor.makeMeasurement(requestMessage);
-
- }
-
-
- else if(matchedInterfaceClassName.equals
-
("net.geant2.monitoring.nms.service.commons.storageManager.StorageManager") ||
-
matchedInterfaceClassName.equalsIgnoreCase("StorageManager")||
-
matchedInterfaceClassName.equalsIgnoreCase("Storage Manager")||
-
matchedInterfaceClassName.equalsIgnoreCase("Storage_Manager") ) {
-
- logger.debug("SchedulerAction: The event type:
"+eventTypeString+" requires" +
- "contacting a StorageManager of type:
"+handlerClassName);
- StorageManager storageManager =
(StorageManager)handlerClass.newInstance();
+
+ } else if (matchedInterfaceClassName.equals
+
("net.geant2.monitoring.nms.service.commons.storageManager.StorageManager") ||
+
matchedInterfaceClassName.equalsIgnoreCase("StorageManager") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Storage Manager") ||
+
matchedInterfaceClassName.equalsIgnoreCase("Storage_Manager")) {
+
+ logger.debug("SchedulerAction: The event type: "
+ eventTypeString + " requires" +
+ "contacting a StorageManager of type: " +
handlerClassName);
+ StorageManager storageManager = (StorageManager)
handlerClass.newInstance();
replyMessage = (Message)
storageManager.store(requestMessage);
-
- }
- else {
-
+
+ } else {
+
logger.error("SchedulerAction: The event type
for a " +
- "scheduler: "+eventTypeString+ "has been
configured " +
- "to be handled by an implementation of
"+
- matchedInterfaceClassName+ " But
SchedulerAction (generic) " +
- "does not know how to deal with this
interface.");
-
+ "scheduler: " + eventTypeString + "has been
configured " +
+ "to be handled by an implementation of " +
+ matchedInterfaceClassName + " But
SchedulerAction (generic) " +
+ "does not know how to deal with this
interface.");
+
return;
-
+
}
-
- if(replyMessage==null) {
+
+ if (replyMessage == null) {
logger.error("SchedulerAction: A configured
schedule instructed scheduler " +
- "to contact "+handlerClass.getName()+".
" +
- "But for the given input in the
schedule, the service engine returned a null message." +
- "SchedulerAction cannot continue with
this schedule.");
-
+ "to contact " + handlerClass.getName() + ".
" +
+ "But for the given input in the schedule,
the service engine returned a null message." +
+ "SchedulerAction cannot continue with this
schedule.");
+
return;
}
-
+
Map metadataMap = requestMessage.getMetadataMap();
Collection metadataCollection = metadataMap.values();
-
+
Iterator metadataIterator =
metadataCollection.iterator();
-
- if(metadataCollection.isEmpty()) {
-
+
+ if (metadataCollection.isEmpty()) {
+
logger.error("SchedulerAction: Due to unknown
errors," +
- "SchedulerAction was unable to create a
message object " +
- "for the given Schedule. Metadata for
such a message couldn't " +
- "be determined.");
-
+ "SchedulerAction was unable to create a
message object " +
+ "for the given Schedule. Metadata for such a
message couldn't " +
+ "be determined.");
+
return;
-
+
}
- String metadataIdref=null;
-
+ String metadataIdref = null;
+
// link data to the last metadata element's id
-
- while(metadataIterator.hasNext()) {
+
+ while (metadataIterator.hasNext()) {
Metadata metadataElements = (Metadata)
metadataIterator.next();
- metadataIdref= metadataElements.getId();
+ metadataIdref = metadataElements.getId();
}
-
+
// set the request message for the next leg (if
any).
// change its datablock into a datablock got from
the reply
-
+
requestMessage.clearData();
-
+
Map dataMap = replyMessage.getDataMap();
Collection dataCollection = dataMap.values();
-
+
Iterator itr = dataCollection.iterator();
-
- if(!(dataCollection.isEmpty()) ) {
-
+
+ if (!(dataCollection.isEmpty())) {
+
int dataCount = 1;
- while(itr.hasNext()) {
-
- Data readDataElement = (Data)itr.next();
- System.out.println("Data got from leg
contains: "+readDataElement);
-
readDataElement.setMetadataIdRef(metadataIdref);
- readDataElement.setId("data"+dataCount);
- requestMessage.setData(readDataElement);
- dataCount++;
- }
-
- }
- else {
+ while (itr.hasNext()) {
+
+ Data readDataElement = (Data) itr.next();
+ System.out.println("Data got from leg
contains: " + readDataElement);
+
readDataElement.setMetadataIdRef(metadataIdref);
+ readDataElement.setId("data" + dataCount);
+ requestMessage.setData(readDataElement);
+ dataCount++;
+ }
+
+ } else {
logger.debug("SchedulerAction: A configured
schedule instructed scheduler " +
- "to contact "+handlerClass.getName()+".
" +
- "But for the given input in the
schedule, the service engine returned no " +
- "data elements. A blank data element
will be passed on to the next part of " +
- "this schedule (if any)");
-
+ "to contact " + handlerClass.getName() + ".
" +
+ "But for the given input in the schedule,
the service engine returned no " +
+ "data elements. A blank data element will be
passed on to the next part of " +
+ "this schedule (if any)");
+
Data blankDataElement = new Data();
blankDataElement.setId("data1");
blankDataElement.setMetadataIdRef("");
-
-
+
+
}
-
+
} catch (InstantiationException e2) {
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction " +
- "(generic) is unable to " +
- "instantiate this class.
InstantiationException " +
- "was encoutered :"+e2.getMessage());
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction " +
+ "(generic) is unable to " +
+ "instantiate this class. InstantiationException
" +
+ "was encoutered :" + e2.getMessage());
return;
-
+
} catch (IllegalAccessException e2) {
-
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction " +
- "(generic) is unable to " +
- "instantiate this class.
IllegalAccessException " +
- "was encoutered :"+e2.getMessage());
+
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction " +
+ "(generic) is unable to " +
+ "instantiate this class. IllegalAccessException
" +
+ "was encoutered :" + e2.getMessage());
return;
-
+
} catch (PerfSONARException e) {
- logger.error("SchedulerAction: The eventType in the
schedule: "+eventTypeString+" "+
- "has been configured to be handled by the " +
- "class: " +handlerClassName+". But
SchedulerAction " +
- "(generic) encountered a System
Exception:"+e.getMessage());
+ logger.error("SchedulerAction: The eventType in the
schedule: " + eventTypeString + " " +
+ "has been configured to be handled by the " +
+ "class: " + handlerClassName + ". But
SchedulerAction " +
+ "(generic) encountered a System Exception:" +
e.getMessage());
return;
-
- }
+
+ }
//catch (RequestException e) {
// logger.error("SchedulerAction: The eventType in
the schedule: "+eventTypeString+" "+
// "has been configured to be handled by the
" +
@@ -482,11 +464,11 @@
// }
//
}
-
-
+
+
}
-
-
+
+
} // end of for
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-09-11 07:41:38 UTC (rev 5999)
+++ trunk/perfsonar_base/src/main/java/org/perfsonar/base/util/XMLUtils.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -501,19 +501,18 @@
Element element = null;
boolean found = false;
- for (int i = 0; i < names.length; i++) {
+ for (String name : names) {
- Iterator it = ht.values().iterator();
- while(it.hasNext()) {
+ for (Object o : ht.values()) {
- element = (Element) it.next();
- String ln = element.getLocalName();
+ element = (Element) o;
+ String ln = element.getLocalName();
- if (ln.equals(names[i])) {
- found = true;
- map.put(element.getId(), element);
- }
- }
+ if (ln.equals(name)) {
+ found = true;
+ map.put(element.getId(), element);
+ }
+ }
}
if (!found) return null;
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/authn/saslca/UserIDCallbackHandler.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -17,19 +17,17 @@
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof NameCallback) {
- NameCallback nc = (NameCallback)callbacks[i];
- nc.setName(userId.getName());
- }
- else if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc =
(PasswordCallback)callbacks[i];
-
pc.setPassword(userId.getPassword().toCharArray());
- }
- else {
- throw new
UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
- }
- }
+ for (Callback callback : callbacks) {
+ if (callback instanceof NameCallback) {
+ NameCallback nc = (NameCallback) callback;
+ nc.setName(userId.getName());
+ } else if (callback instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback) callback;
+ pc.setPassword(userId.getPassword().toCharArray());
+ } else {
+ throw new UnsupportedCallbackException(callback,
"Unrecognized Callback");
+ }
+ }
}
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AttrEERequestGenerator.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AttrEERequestGenerator.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/base/requests/authService/AttrEERequestGenerator.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -104,22 +104,19 @@
"<saml:Issuer>"+attrReq.getIssuer()+"</saml:Issuer>" +
"<saml:Subject><saml:NameID
Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\">"+attrReq.getSubject()+"</saml:NameID></saml:Subject>";
Map<String, Map<String, List<String>>> attrs =
attrReq.getAttributes();
- Iterator<String> it=attrs.keySet().iterator();
- while (it.hasNext()) {
- String urn=it.next();
- Map<String, List<String>> data = attrs.get(urn);
- Iterator<String> attrNames=data.keySet().iterator();
- String friendlyName = attrNames.next();
+ for (String urn : attrs.keySet()) {
+ Map<String, List<String>> data = attrs.get(urn);
+ Iterator<String> attrNames = data.keySet().iterator();
+ String friendlyName = attrNames.next();
- samlMessage +="<saml:Attribute
NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\"
Name=\""+urn+"\" FriendlyName=\""+friendlyName+"\">";
+ samlMessage += "<saml:Attribute
NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\" Name=\"" + urn
+ "\" FriendlyName=\"" + friendlyName + "\">";
- List<String> attrsValues=(List<String>)data.get(friendlyName);
- Iterator<String> itValues=attrsValues.iterator();
- while (itValues.hasNext()) {
- samlMessage +="<saml:AttributeValue
xsi:type=\"xsd:string\">"+itValues.next()+"</saml:AttributeValue>";
- }
+ List<String> attrsValues = (List<String>) data.get(friendlyName);
+ for (String attrsValue : attrsValues) {
+ samlMessage += "<saml:AttributeValue
xsi:type=\"xsd:string\">" + attrsValue + "</saml:AttributeValue>";
+ }
- samlMessage +="</saml:Attribute>";
+ samlMessage += "</saml:Attribute>";
}
samlMessage += "</samlp:AttributeQuery>";
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPUbCClient.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPUbCClient.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/SOAPUbCClient.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -114,15 +114,13 @@
System.out.println("Subject DN:
"+certificate.getSubjectDN().toString());
Collection<List<?>> collection = certificate
.getSubjectAlternativeNames();
- Iterator<List<?>> it = collection.iterator();
- while (it.hasNext()) {
- List<?> list = it.next();
- for (int i = 0; i < list.size(); i++) {
- if
(list.get(i).toString().startsWith("http")) {
- System.out.println("Subject
Alternative Name:" +list.get(i).toString());
- }
- }
- }
+ for (List<?> list : collection) {
+ for (Object aList : list) {
+ if (aList.toString().startsWith("http")) {
+ System.out.println("Subject Alternative Name:" +
aList.toString());
+ }
+ }
+ }
System.out.println("Valid from:
"+DateFormat.getInstance().format(certificate.getNotBefore()));
System.out.println("Valid until:
"+DateFormat.getInstance().format(certificate.getNotAfter()));
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCMDSTest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCMDSTest.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCMDSTest.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -17,14 +17,13 @@
defaultMDS=args[0];
}
List<BEMetaData>
bes=EduGAINMetadataService.getOrganizationList(defaultMDS,"/tmp/eduGAINtruststore.jks","12345678","/tmp/ValidComponentsFile");
- for (int i=0; i<bes.size(); i++) {
- BEMetaData be=bes.get(i);
- System.out.println("Bridging Element
"+be.getComponentID());
- CAInterface caonline=be.getCAInterface();
- if (caonline!=null) {
- System.out.println("*** CA online:
"+caonline.getContactURL());
- }
- }
+ for (BEMetaData be : bes) {
+ System.out.println("Bridging Element " +
be.getComponentID());
+ CAInterface caonline = be.getCAInterface();
+ if (caonline != null) {
+ System.out.println("*** CA online: " +
caonline.getContactURL());
+ }
+ }
} catch (PerfSONARException e) {
}
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCSaslTest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCSaslTest.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/client/testHarness/UbCSaslTest.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -135,15 +135,13 @@
System.out.println("Subject DN:
"+certificate.getSubjectDN().toString());
Collection<List<?>> collection = certificate
.getSubjectAlternativeNames();
- Iterator<List<?>> it = collection.iterator();
- while (it.hasNext()) {
- List<?> list = it.next();
- for (int i = 0; i < list.size(); i++) {
- if
(list.get(i).toString().startsWith("http")) {
- System.out.println("Subject
Alternative Name:" +list.get(i).toString());
- }
- }
- }
+ for (List<?> list : collection) {
+ for (Object aList : list) {
+ if (aList.toString().startsWith("http")) {
+ System.out.println("Subject Alternative Name:" +
aList.toString());
+ }
+ }
+ }
System.out.println("Valid from:
"+DateFormat.getInstance().format(certificate.getNotBefore()));
System.out.println("Valid until:
"+DateFormat.getInstance().format(certificate.getNotAfter()));
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AADispatchSOAPProtocol.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -107,15 +107,15 @@
Parameters params=null;
Parameter parameter=null;
Metadata[] mds=requestMessage.getMetadataArray();
- for (int i=0; i<mds.length; i++) {
- params=mds[i].getParameters();
- Parameter[] pars=params.getParameterArray();
- for (int j=0; j<pars.length; j++) {
- if
(pars[j].getParameterName().equals("SecurityToken")) {
- parameter=pars[j];
- }
- }
- }
+ for (Metadata md : mds) {
+ params = md.getParameters();
+ Parameter[] pars = params.getParameterArray();
+ for (Parameter par : pars) {
+ if (par.getParameterName().equals("SecurityToken")) {
+ parameter = par;
+ }
+ }
+ }
javax.xml.soap.SOAPHeader
header=(javax.xml.soap.SOAPHeader)token.getSecToken();
Iterator<?> it=header.examineAllHeaderElements();
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AttrResponse.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -71,10 +71,10 @@
Metadata responseMetadata = null;
EventType et = null;
Metadata[] metadatas=message.getMetadataArray();
- for (int i=0; i<metadatas.length; i++) {
- et=metadatas[i].getEventType();
- responseMetadata = metadatas[i];
- }
+ for (Metadata metadata : metadatas) {
+ et = metadata.getEventType();
+ responseMetadata = metadata;
+ }
if (et != null) {
if (et.getEventType().trim().contains("success.as.attr")) {
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthNResponse.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -36,16 +36,15 @@
AuthNResponse res=new AuthNResponse();
Metadata[] metadatas=message.getMetadataArray();
- for (int i=0; i<metadatas.length; i++) {
- EventType et=metadatas[i].getEventType();
- res.setResultCode(et.getEventType());
- if (et.getEventType().equals("success.as.authn")) {
- res.setStatus(AuthNResponse.AUTHENTICATED);
- }
- else {
-
res.setStatus(AuthNResponse.NOT_AUTHENTICATED);
- }
- }
+ for (Metadata metadata : metadatas) {
+ EventType et = metadata.getEventType();
+ res.setResultCode(et.getEventType());
+ if (et.getEventType().equals("success.as.authn")) {
+ res.setStatus(AuthNResponse.AUTHENTICATED);
+ } else {
+ res.setStatus(AuthNResponse.NOT_AUTHENTICATED);
+ }
+ }
return res;
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthRResponse.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthRResponse.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/AuthRResponse.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -12,16 +12,15 @@
AuthRResponse res=new AuthRResponse();
Metadata[] metadatas=message.getMetadataArray();
- for (int i=0; i<metadatas.length; i++) {
- EventType et=metadatas[i].getEventType();
- res.setResultCode(et.getEventType());
- if (et.getEventType().equals("success.as.authr")) {
- res.setStatus(AuthRResponse.AUTHORIZED);
- }
- else {
- res.setStatus(AuthRResponse.NOT_AUTHORIZED);
- }
- }
+ for (Metadata metadata : metadatas) {
+ EventType et = metadata.getEventType();
+ res.setResultCode(et.getEventType());
+ if (et.getEventType().equals("success.as.authr")) {
+ res.setStatus(AuthRResponse.AUTHORIZED);
+ } else {
+ res.setStatus(AuthRResponse.NOT_AUTHORIZED);
+ }
+ }
return res;
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/authn/tokens/SecTokenSOAPManager.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -171,14 +171,13 @@
X509Certificate cert=(X509Certificate)stValue;
Collection subjectAltNames =
cert.getSubjectAlternativeNames();
if (subjectAltNames != null) {
- Iterator names = subjectAltNames.iterator();
- while (names.hasNext()) {
- List<?> values = (List<?>)names.next();
+ for (Object subjectAltName : subjectAltNames) {
+ List<?> values = (List<?>) subjectAltName;
if (values.size() == 2) {
- Integer type = (Integer)values.get(0);
- String name = (String)values.get(1);
+ Integer type = (Integer) values.get(0);
+ String name = (String) values.get(1);
if ((type == 6) &&
(name.startsWith(BaseDefinitions.EDUGAIN_CID_RESOLVER))) {
- return
URLDecoder.decode(name.substring(name.indexOf('=')+1),"UTF-8");
+ return
URLDecoder.decode(name.substring(name.indexOf('=') + 1), "UTF-8");
}
}
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/DataRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/DataRequest.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/DataRequest.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -127,28 +127,28 @@
logger.warn("DataRequest.metaToKey: empty request?");
}
- for (Iterator i = dataCollection.iterator(); i.hasNext(); ) {
- Data reqdata = (Data)i.next();
- Metadata reqmd = (Metadata)metadataMap.get(
- reqdata.getMetadataIdRef());
+ for (Object aDataCollection : dataCollection) {
+ Data reqdata = (Data) aDataCollection;
+ Metadata reqmd = (Metadata) metadataMap.get(
+ reqdata.getMetadataIdRef());
- if(reqmd == null){
+ if (reqmd == null) {
logger.fatal(
- "DataRequest.metaToKey: Data element must refer to "
+
+ "DataRequest.metaToKey: Data element must refer to " +
"a metadata element.");
throw new PerfSONARException(
- "DataRequest.metaToKey: Data element must refer to "
+
+ "DataRequest.metaToKey: Data element must refer to " +
"a metadata element.");
}
logger.debug(
- "DataRequest.metaToKey: Build chain from metadataIdRef="
+
+ "DataRequest.metaToKey: Build chain from metadataIdRef=" +
reqdata.getMetadataIdRef());
// clear ArrayList to build new chain
mdChain.clear();
// build array out of metadata chain refered to by this data.
- addChainList(reqmd,metadataMap,mdChain,false);
+ addChainList(reqmd, metadataMap, mdChain, false);
// Put current md chain and data in request bean
logger.debug("DataRequest.metaToKey:
atomReq.addChild(metadata)");
@@ -157,65 +157,65 @@
atomReq.clearData();
atomReq.clearMetadata();
- for (int j=0; j < mdChain.size(); j++){
+ for (Metadata aMdChain : mdChain) {
/*
* ignore return - this md was already in another message
* no worries about adding it in another.
*/
- atomReq.addChild(mdChain.get(j));
+ atomReq.addChild(aMdChain);
}
logger.debug(
- "DataRequest.metaToKey: atomReq.addChild(metadata)");
+ "DataRequest.metaToKey: atomReq.addChild(metadata)");
atomReq.addChild(reqdata);
// call action for GET_KEY
logger.debug("DataRequest.metaToKey: Calling GET_KEY action");
- atomResp = serviceEngine.takeAction("GET_KEY",atomReq);
+ atomResp = serviceEngine.takeAction("GET_KEY", atomReq);
- logger.debug("DataRequest.metaToKey: Back from
GET_KEY action");
+ logger.debug("DataRequest.metaToKey: Back from GET_KEY action");
// pull out data and metadata elements from atomResp
// and put them in the response message.
- int hasData=0;
- for(Iterator j =
atomResp.getDataIterator();j.hasNext();hasData++){
- respMessage.addChild((Data)j.next());
+ int hasData = 0;
+ for (Iterator j = atomResp.getDataIterator(); j.hasNext();
hasData++) {
+ respMessage.addChild((Data) j.next());
}
// simplistic sanity checks
- if (hasData < 1){
+ if (hasData < 1) {
logger.fatal(
- "DataRequest.metaToKey: returned no data");
+ "DataRequest.metaToKey: returned no data");
throw new PerfSONARException(
- "DataRequest.metaToKey: returned no data");
+ "DataRequest.metaToKey: returned no data");
}
- int hasMd=0;
- for(Iterator j
=atomResp.getMetadataIterator();j.hasNext();hasMd++){
- respMessage.addChild((Metadata)j.next());
+ int hasMd = 0;
+ for (Iterator j = atomResp.getMetadataIterator(); j.hasNext();
hasMd++) {
+ respMessage.addChild((Metadata) j.next());
}
// simplistic sanity checks
- if (hasMd < 1){
+ if (hasMd < 1) {
logger.fatal(
- "DataRequest.metaToKey: returned no Metadata");
+ "DataRequest.metaToKey: returned no Metadata");
throw new PerfSONARException(
- "DataRequest.metaToKey: returned no Metadata");
+ "DataRequest.metaToKey: returned no Metadata");
}
- if(hasData > hasMd){
+ if (hasData > hasMd) {
logger.fatal("MetadataKeyRequest: Invalid data/metadata " +
+ "mapping returned from service");
+ throw new PerfSONARException(
+ "MetadataKeyRequest: Invalid data/metadata " +
"mapping returned from service");
- throw new PerfSONARException (
- "MetadataKeyRequest: Invalid data/metadata " +
- "mapping returned from service");
}
- logger.debug("DataRequest.metaToKey: respMessage: " +
- respMessage.toString());
- }
+ logger.debug("DataRequest.metaToKey: respMessage: " +
+ respMessage.toString());
+ }
logger.debug("DataRequest.metaToKey: returning respMessage");
return respMessage;
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LinkRequest.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -73,11 +73,11 @@
Node[] nodeArray = (Node[]) link.getNodeArray();
if (nodeArray.length > 0) {
- for (int i = 0; i < nodeArray.length; i++)
+ for (Node aNodeArray : nodeArray)
this.getChaining(
- inputMessage,
-
getNodeMetadataId(nodeArray[i].getNodeIdRef(), inputMessage),
- metadatas);
+ inputMessage,
+ getNodeMetadataId(aNodeArray.getNodeIdRef(),
inputMessage),
+ metadatas);
}
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/MessageHandlerFactory.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -98,10 +98,10 @@
String serviceType =
configManager.getProperty("service.r.type");
String messageTypes =
configManager.getProperty("service." + serviceType + ".message_types");
String[] allowedMesgTypes =
messageTypes.split("\\s*,\\s*");
-
- for(int i=0; i < allowedMesgTypes.length; i++) {
- m2c.put(allowedMesgTypes[i],
"org.perfsonar.service.base.messages." + allowedMesgTypes[i]);
- }
+
+ for (String allowedMesgType : allowedMesgTypes) {
+ m2c.put(allowedMesgType,
"org.perfsonar.service.base.messages." + allowedMesgType);
+ }
}
}
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/registration/LSSummaryServiceContent.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -543,12 +543,10 @@
}
private void showSummary(Map<String, ServiceSummary> summaries) {
- Iterator<Entry<String, ServiceSummary>> i =
summaries.entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry e = i.next();
- logger.debug("\n==== "+e.getKey()+" ====\n");
+ for (Entry<String, ServiceSummary> e : summaries.entrySet()) {
+ logger.debug("\n==== " + e.getKey() + " ====\n");
logger.debug(e.getValue().toString());
-
+
}
}
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-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/storage/xmldb/XmlDbResult.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -54,8 +54,7 @@
if (results.length==1) return results[0];
else {
StringWriter sw = new StringWriter();
- for (int i=0; i<results.length; i++)
- sw.append(results[i]);
+ for (String result : results) sw.append(result);
return sw.toString();
}
}
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/metadataConfig/MetadataConfigurationStorageManager.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -107,17 +107,17 @@
+ "No metadata in the metadata configuration");
- for (int i = 0; i < xmlResults.length; i++) {
+ for (String xmlResult1 : xmlResults) {
//logger.debug("MetadataConfigurationStorageManager.fetch: xml
result: "
// + xmlResults[i]);
- if (xmlResults[i].trim().equals("")) continue;
+ if (xmlResult1.trim().equals("")) continue;
- String xmlResult =
+ String xmlResult =
"<nmwg:message
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"> "
- + xmlResults[i]
- + "</nmwg:message>";
+ + xmlResult1
+ + "</nmwg:message>";
String[] tagNames = {"metadata", "data"};
Map<String, Element> elements =
@@ -125,8 +125,8 @@
if (elements == null)
throw new PerfSONARException(
- "warning.ma.metadata_configuration",
- "MetadataConfigurationStorageManager.fetch: "
+ "warning.ma.metadata_configuration",
+ "MetadataConfigurationStorageManager.fetch: "
+ "No metadata or data elements in the fetch result "
+ "sent from xml database");
Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-09-11 07:41:38 UTC (rev 5999)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-09-11 07:41:39 UTC (rev 6000)
@@ -128,9 +128,9 @@
registrator.initRegistrator();
if (lsURLArray != null) {
- for (int i = 0; i < lsURLArray.length; i++) {
- if (!lsURLArray[i].trim().equals("")) {
- registrator.register(lsURLArray[i]);
+ for (String aLsURLArray : lsURLArray) {
+ if (!aLsURLArray.trim().equals("")) {
+ registrator.register(aLsURLArray);
}
}
}
- [pS-dev] [GEANT/SA2/ps-java-services] r6000 - 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/compone nts/authn perfsonar_base/src/main/java/org/perfsonar/bas e/auxiliary/components/scheduler perfsonar_base/src/main /java/org/perfsonar/base/auxiliary/components/scheduler/ac tions perfsonar_base/src/main/java/org/perfsonar/base/ut il perfsonar_base/src/main/java/org/perfsonar/client/bas e/authn/saslca perfsonar_base/src/main/java/org/perfsona r/client/base/requests/authService perfsonar_base/src/ma in/java/org/perfsonar/client/testHarness perfsonar_base/ src/main/java/org/perfsonar/service/base/authn perfsonar _base/src/main/java/org/perfsonar/service/base/authn/tok ens perfsonar_base/src/main/java/org/per fsonar/service/ base/messages perfsonar_base/src/main/java/org/perfsonar /service/base/registration perfsonar_base/src/main/java/ org/perfsonar/service/base/storage/xmldb perfsonar_base/ src/main/java/org/perfsonar/service/measurementArchive/met adataConfig perfsonar_base/src/main/java/org/perfsonar/s ervice/measurementArchive/register, svn-noreply, 09/11/2012
Archive powered by MHonArc 2.6.16.