Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6430 - in trunk: . perfsonar-base/base/src/main/java/net/gean t/perfsonar/response perfsonar-base/ls/src/main/java/net/g eant/perfsonar/ls perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/authn perfsonar-java-base2/src/main /java/org/perfsonar/base2/service/authn/component/wssec pe rfsonar-java-base2/src/main/java/org/perfsonar/base2/servi ce/axis2interface perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/configuration perfsonar-java-base2/ src/main/java/org/perfsonar/base2/service/configuration/mi gration perfsonar-java-base2/src/main/java/org/perfsonar/b ase2/service/messages perfsonar-java-base2/src/main/java/o rg/perfsonar/base2/service/registration perfsonar-java-bas e2/src/main/java/org/perfsonar/base2/service/requesthandle r perfsonar-java-base2/src/main/java/org/perfsonar/base2/s ervice/requesthandler/axis2 perfsonar-java-base2/src/main/ java/org/perfsonar/base2/service/scheduler perfsonar-java- base2/src/main/java/ org/perfsonar/base2/service/scheduler /singleThread perfsonar-java-base2/src/main/java/org/perfs onar/base2/service/storage/xml perfsonar-java-base2/src/ma in/java/org/perfsonar/base2/servlets perfsonar-java-base2/ src/main/java/org/perfsonar/test perfsonar-java-rrd-ma per fsonar-java-rrd-ma/soapUI perfsonar-java-rrd-ma/src/main/j ava/org/perfsonar/service/measurementArchive/rrdType perfs onar-java-rrd-ma/src/main/java/org/perfsonar/service/measu rementArchive/rrdType/storage/rrd perfsonar-java-rrd-ma/sr c/main/java/org/perfsonar/service/measurementArchive/rrdTy pe/storage/sql/query perfsonar-java-rrd-ma/src/main/java/o rg/perfsonar/service/measurementArchive/servlets perfsonar -java-xml-ls/soapUI perfsonar-java-xml-ls/src/main/java/or g/perfsonar/service/lookupservice perfsonar-java-xml-ls/sr c/main/java/org/perfsonar/service/lookupservice/components perfsonar-java-xml-ls/src/main/java/org/perfsonar/service /lookupservice/schedulerActions perfsonar-java-xml-ls/src/ main/java/org/perfsonar/ service/lookupservice/servlets pe rfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lo okupservice/storage/exist/dao perfsonar-java-xml-ls/src/ma in/java/org/perfsonar/service/lookupservice/summarization perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/co mponents perfsonar-java-xml-ls/src/test/java/org/perfsonar /tests/dao

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6430 - in trunk: . perfsonar-base/base/src/main/java/net/gean t/perfsonar/response perfsonar-base/ls/src/main/java/net/g eant/perfsonar/ls perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/authn perfsonar-java-base2/src/main /java/org/perfsonar/base2/service/authn/component/wssec pe rfsonar-java-base2/src/main/java/org/perfsonar/base2/servi ce/axis2interface perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/configuration perfsonar-java-base2/ src/main/java/org/perfsonar/base2/service/configuration/mi gration perfsonar-java-base2/src/main/java/org/perfsonar/b ase2/service/messages perfsonar-java-base2/src/main/java/o rg/perfsonar/base2/service/registration perfsonar-java-bas e2/src/main/java/org/perfsonar/base2/service/requesthandle r perfsonar-java-base2/src/main/java/org/perfsonar/base2/s ervice/requesthandler/axis2 perfsonar-java-base2/src/main/ java/org/perfsonar/base2/service/scheduler perfsonar-java- base2/src/main/java/ org/perfsonar/base2/service/scheduler /singleThread perfsonar-java-base2/src/main/java/org/perfs onar/base2/service/storage/xml perfsonar-java-base2/src/ma in/java/org/perfsonar/base2/servlets perfsonar-java-base2/ src/main/java/org/perfsonar/test perfsonar-java-rrd-ma per fsonar-java-rrd-ma/soapUI perfsonar-java-rrd-ma/src/main/j ava/org/perfsonar/service/measurementArchive/rrdType perfs onar-java-rrd-ma/src/main/java/org/perfsonar/service/measu rementArchive/rrdType/storage/rrd perfsonar-java-rrd-ma/sr c/main/java/org/perfsonar/service/measurementArchive/rrdTy pe/storage/sql/query perfsonar-java-rrd-ma/src/main/java/o rg/perfsonar/service/measurementArchive/servlets perfsonar -java-xml-ls/soapUI perfsonar-java-xml-ls/src/main/java/or g/perfsonar/service/lookupservice perfsonar-java-xml-ls/sr c/main/java/org/perfsonar/service/lookupservice/components perfsonar-java-xml-ls/src/main/java/org/perfsonar/service /lookupservice/schedulerActions perfsonar-java-xml-ls/src/ main/java/org/perfsonar/ service/lookupservice/servlets pe rfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lo okupservice/storage/exist/dao perfsonar-java-xml-ls/src/ma in/java/org/perfsonar/service/lookupservice/summarization perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/co mponents perfsonar-java-xml-ls/src/test/java/org/perfsonar /tests/dao


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6430 - in trunk: . perfsonar-base/base/src/main/java/net/gean t/perfsonar/response perfsonar-base/ls/src/main/java/net/g eant/perfsonar/ls perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/authn perfsonar-java-base2/src/main /java/org/perfsonar/base2/service/authn/component/wssec pe rfsonar-java-base2/src/main/java/org/perfsonar/base2/servi ce/axis2interface perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/configuration perfsonar-java-base2/ src/main/java/org/perfsonar/base2/service/configuration/mi gration perfsonar-java-base2/src/main/java/org/perfsonar/b ase2/service/messages perfsonar-java-base2/src/main/java/o rg/perfsonar/base2/service/registration perfsonar-java-bas e2/src/main/java/org/perfsonar/base2/service/requesthandle r perfsonar-java-base2/src/main/java/org/perfsonar/base2/s ervice/requesthandler/axis2 perfsonar-java-base2/src/main/ java/org/perfsonar/base2/service/scheduler perfsonar-java- base2/src/main/java/ org/perfsonar/base2/service/scheduler /singleThread perfsonar-java-base2/src/main/java/org/perfs onar/base2/service/storage/xml perfsonar-java-base2/src/ma in/java/org/perfsonar/base2/servlets perfsonar-java-base2/ src/main/java/org/perfsonar/test perfsonar-java-rrd-ma per fsonar-java-rrd-ma/soapUI perfsonar-java-rrd-ma/src/main/j ava/org/perfsonar/service/measurementArchive/rrdType perfs onar-java-rrd-ma/src/main/java/org/perfsonar/service/measu rementArchive/rrdType/storage/rrd perfsonar-java-rrd-ma/sr c/main/java/org/perfsonar/service/measurementArchive/rrdTy pe/storage/sql/query perfsonar-java-rrd-ma/src/main/java/o rg/perfsonar/service/measurementArchive/servlets perfsonar -java-xml-ls/soapUI perfsonar-java-xml-ls/src/main/java/or g/perfsonar/service/lookupservice perfsonar-java-xml-ls/sr c/main/java/org/perfsonar/service/lookupservice/components perfsonar-java-xml-ls/src/main/java/org/perfsonar/service /lookupservice/schedulerActions perfsonar-java-xml-ls/src/ main/java/org/perfsonar/ service/lookupservice/servlets pe rfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lo okupservice/storage/exist/dao perfsonar-java-xml-ls/src/ma in/java/org/perfsonar/service/lookupservice/summarization perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/co mponents perfsonar-java-xml-ls/src/test/java/org/perfsonar /tests/dao
  • Date: Fri, 31 May 2013 17:44:18 +0100 (BST)
  • Authentication-results: sfpop-ironport02.merit.edu; dkim=neutral (message not signed) header.i=none

Author: dante.delvaux
Date: 2013-05-31 17:44:18 +0100 (Fri, 31 May 2013)
New Revision: 6430

Modified:
trunk/README.txt

trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/response/SelfTestResponse.java

trunk/perfsonar-base/ls/src/main/java/net/geant/perfsonar/ls/LSRegistrationTask.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/wssec/WSSecAuthNComponent.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/axis2interface/PerfsonarService.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/messages/GenericMessageHandler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/AbstractRegistrationAction.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/GenericLSRegistrator.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/RequestHandler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/axis2/Axis2RequestHandler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulerTask.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleAction.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleScheduler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/singleThread/SingleThreadScheduler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBComponent.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/ExistDBInitServlet.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
trunk/perfsonar-java-rrd-ma/pom.xml

trunk/perfsonar-java-rrd-ma/soapUI/perfsonar-RRD-MA-base2-soapui-project.xml

trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java

trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/rrd/RRDDataStorageDAOImpl.java

trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java

trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/servlets/DbInitializerServlet.java
trunk/perfsonar-java-xml-ls/soapUI/perfsonar-LS-base2-soapui-project.xml

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/AbstractRegisterServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/GenericLSServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDiscoveryAction.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSKeepaliveServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryAction.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/DataSourceComponent.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/ModificationCounterComponent.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/XMLDBComponent.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/CleanupSchedulerAction.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/GLSRegistrationAction.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/dao/MultipleFilesDAOImpl.java

trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/SummarizationBuilder.java

trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/DataSourceComponentTest.java

trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/ModificationCounterComponentTest.java

trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/XMLDBComponentTest.java

trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/dao/MultipleFilesDAOImplTests.java
Log:
pSbase2, pSbase3, RRD-MA, XML-LS: Improve logging by not constructing string
(+) but passing parameters to logger.

Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2013-05-31 16:42:52 UTC (rev 6429)
+++ trunk/README.txt 2013-05-31 16:44:18 UTC (rev 6430)
@@ -16,8 +16,12 @@

Syntactic conventions are described and enforced using checkstyle and pmd.
Please consult the checkstyle and pmd configuration, in the parent/pom.xml
-and in parent/checkstyle/checkstyle.xml.
+and in parent/common/checkstyle.xml (this file is then available for each
sub-
+project by using a svn:externals link).

+You should also use this CheckStyle configuration file in your IDE. In
Eclipse
+this is done through a plugin.
+
Due to plenty of legacy code, some modules use a slightly relaxed set of
rules.
This is only to accommodate legacy code and any checkstyle warning should be
considered a violation in new code.

Modified:
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/response/SelfTestResponse.java
===================================================================
---
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/response/SelfTestResponse.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-base/base/src/main/java/net/geant/perfsonar/response/SelfTestResponse.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -41,8 +41,8 @@
TemplateEngine.put("message", successMessage);
try {
TemplateEngine.evaluate(writer, SelfTestResponse.class,
"SelfTest_success.template");
- } catch (IOException e) {
- logger.error("Could not fill in the template with self test
results.", e);
+ } catch (IOException ex) {
+ logger.error("Could not fill in the template with self test
results. {}: {}", ex.getClass(), ex.getMessage());
}
}

@@ -51,8 +51,8 @@
TemplateEngine.put("message", message);
try {
TemplateEngine.evaluate(writer, SelfTestResponse.class,
"SelfTest_failure.template");
- } catch (IOException e) {
- logger.error("Could not fill in the template with self test
results.", e);
+ } catch (IOException ex) {
+ logger.error("Could not fill in the template with self test
results. {}: {}", ex.getClass(), ex.getMessage());
}
}
}

Modified:
trunk/perfsonar-base/ls/src/main/java/net/geant/perfsonar/ls/LSRegistrationTask.java
===================================================================
---
trunk/perfsonar-base/ls/src/main/java/net/geant/perfsonar/ls/LSRegistrationTask.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-base/ls/src/main/java/net/geant/perfsonar/ls/LSRegistrationTask.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -85,7 +85,7 @@
try {
registerToLookupService(address);
} catch (Exception ex) {
- logger.error("Could not register to Lookup Service at: " +
address, ex);
+ logger.error("Could not register to Lookup Service at {}.
{}: {}", address, ex.getClass(), ex.getMessage());
}
}
}
@@ -113,8 +113,8 @@
if (msg.getKey() != null) {
keys.put(address, msg.getKey());
}
- } catch (Exception e) {
- logger.error("Could not deserialize key from Lookup Service
response.", e);
+ } catch (Exception ex) {
+ logger.error("Could not deserialize key from Lookup Service
response. {}: {}", ex.getClass(), ex.getMessage());
}
} else {
getLSClient(address).invoke(new StreamSource(in));
@@ -140,7 +140,7 @@
writer.close();
out.close();
} catch (Exception ex) {
- logger.error("Could not register in LookupService.", ex);
+ logger.error("Could not register in LookupService. {}:
{}", ex.getClass(), ex.getMessage());
}
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -157,7 +157,7 @@
Element response = responseMsg.getElement();

resp = AuthNResponse.getAuthNResponse(response);
- LOGGER.debug("Authentication response: (" + resp.getResultCode()
+ "," + resp.getStatus() + ")");
+ LOGGER.debug("Authentication response: ({}, {})",
resp.getResultCode(), resp.getStatus());

} catch (ClassCastException e) {
e.printStackTrace();
@@ -207,7 +207,7 @@
Element response = responseMsg.getElement();

AuthRResponse respAuth =
AuthRResponse.getAuthRResponse(response);
- LOGGER.debug("Authorization response: (" +
respAuth.getResultCode() + "," + respAuth.getStatus() + ")");
+ LOGGER.debug("Authorization response: ({}, {})",
respAuth.getResultCode(), respAuth.getStatus());

return respAuth;
} catch (ClassCastException e) {
@@ -234,8 +234,8 @@
Element response = responseMsg.getElement();

AttrResponse respAttr = AttrResponse.getAttrResponse(response);
- LOGGER.debug("Attribte response: (" + respAttr.getResultCode() +
"," + respAttr.getStatus() + ")");
- LOGGER.debug("SAML Response: " + respAttr.getSAMLResponse());
+ LOGGER.debug("Attribte response: ({}, {})",
respAttr.getResultCode(), respAttr.getStatus());
+ LOGGER.debug("SAML Response: {}", respAttr.getSAMLResponse());

return respAttr;


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/wssec/WSSecAuthNComponent.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/wssec/WSSecAuthNComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/wssec/WSSecAuthNComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -47,7 +47,7 @@
AADispatchManager aadm = new AADispatchManager(aadp);
AuthNResponse authnRes = aadm.getAuthentication(authnReq);
if (authnRes.getStatus() != AuthNResponse.AUTHENTICATED) {
- logger.error("WSSecAuthNComponent: Authentication failed (" +
authnRes.getResultCode() + ")");
+ logger.error("WSSecAuthNComponent: Authentication failed ({})",
authnRes.getResultCode());
throw new PerfSONARException(authnRes.getResultCode());
}
}
@@ -87,7 +87,7 @@
AADispatchManager aadm = new AADispatchManager(prot);
AuthRResponse authrRes = aadm.getAuthorization(authrReq);
if (authrRes.getStatus() != AuthRResponse.AUTHORIZED) {
- logger.error("WSSecAuthNComponent: Authentication failed (" +
authrRes.getResultCode() + ")");
+ logger.error("WSSecAuthNComponent: Authentication failed ({})",
authrRes.getResultCode());
throw new PerfSONARException(authrRes.getResultCode());
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/axis2interface/PerfsonarService.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/axis2interface/PerfsonarService.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/axis2interface/PerfsonarService.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -41,7 +41,6 @@
* Run by Axis2 while starting
*/
public void init(ServiceContext sc) {
- // runs while starting
// TODO: Does perfSONAR services work with Java 7?
final JREVersion jreVersion = new JREVersion();
if (!jreVersion.isJRECompatibleWith(1, 6)) {
@@ -53,16 +52,28 @@
}
serviceContext = sc;
try {
- // init manager for the first time while starting service
+ // We initialise the configuration manager for the first time
when starting the service
ConfigurationManager.getInstance();
} catch (Exception ex) {
+ LoggerFactory.getLogger(PerfsonarService.class).warn(
+ "Problem when instanciating the
ConfigurationManager({}): {}", ex.getClass(), ex.getMessage());
}
}

+ public void doInOnly() {
+
+ }
+
+ public String noParameters() {
+ return "Hello";
+ }
+
/**
* Run by Axis2 while shutting down
*/
public void destroy(ServiceContext serviceContext) {
}
+
+

} // PerfsonarService

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -1,7 +1,3 @@
-/**
- * $Id: Actions.java 4698 2008-11-20 13:26:25Z roman $
- * Project: perfSONAR
- */
package org.perfsonar.base2.service.configuration;

import java.util.LinkedHashMap;
@@ -22,9 +18,8 @@
// ----------------------------------------------------------- Methods

public void addAction(Action action) {
-
actions.put(action.getName(), action);
- logger.debug("Action " + action.getName() + " to the scheduler");
+ logger.debug("Add action {} to the scheduler", action.getName());
}

public Action getAction(String name) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -123,7 +123,7 @@

} catch (Exception ex) {

- LOGGER.error("Can not parse " + digesterInput + ", " +
ex.toString());
+ LOGGER.error("Can not parse {}, {}", digesterInput,
ex.toString());
// TODO: url event types
throw new PerfSONARException("error.configuration", "Can not
parse " + digesterInput
+ ". Nested exception was: " + ex.toString());
@@ -138,7 +138,7 @@

private URL getDigesterRulesURL() throws PerfSONARException {

- LOGGER.debug("Read ibatis configuration rules from the file [" +
digesterRules + "]");
+ LOGGER.debug("Read ibatis configuration rules from the file [{}]",
digesterRules);

URL digesterRulesURL = null;
try {
@@ -151,7 +151,7 @@
throw new IOException("Can not find resource " +
digesterRulesURL);
}
} catch (Exception ex) {
- LOGGER.error("Can not find xml config file, " + ex.toString());
+ LOGGER.error("Can not find xml config file: {}", ex.toString());
}

if (digesterRulesURL == null) {
@@ -163,7 +163,7 @@

private InputStream getDigesterInputStream() throws PerfSONARException {

- LOGGER.debug("Read configuration settings from the file [" +
digesterInput + "]");
+ LOGGER.debug("Read configuration settings from the file [{}]",
digesterInput);

InputStream digesterInputStream = null;
try {
@@ -176,7 +176,7 @@
throw new IOException("Can not find resource " +
digesterInput);
}
} catch (Exception ex) {
- LOGGER.error("Can not find xml file, " + ex.toString());
+ LOGGER.error("Can not find xml file: {}", ex.toString());
}

if (digesterInputStream == null) {
@@ -208,15 +208,14 @@
for (Component c : ac.getComponents().values()) {

try {
- LOGGER.info("Initialize component [" + c.getName() + "] as
[" + c.getClassName() + "]");
+ LOGGER.info("Initialize component [{}] as [{}]",
c.getName(), c.getClassName());
c.init();
if (runComponents) {
c.run();
}

} catch (Exception ex) {
- LOGGER.error("Can not initialize auxiliary component [" +
c.getClass() + "]. Nested exception is: "
- + ex.toString());
+ LOGGER.error("Can not initialize auxiliary component [{}].
Nested exception is: {}", c.getClass(), ex.toString());
}

}
@@ -254,12 +253,11 @@
for (Component c : components) {

try {
- LOGGER.info("Destroy component [" + c.getName() + "]");
+ LOGGER.info("Destroy component [{}]", c.getName());
c.destroy();
components.remove(c);
} catch (Exception ex) {
- LOGGER.error("Can not destroy auxiliary component [" +
c.getClass() + "]. Nested exception is: "
- + ex.toString());
+ LOGGER.error("Can not destroy auxiliary component [{}].
Nested exception is: {}", c.getClass(), ex.toString());
}

}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -36,13 +36,12 @@
public void init() throws PerfSONARException {
if (getConfigDirectory() == null) {
configFiles = new ConfigFilesCollection();
- logger.info("The directory for configuration files that should
be "
- + "rewritten to the new format was not specified. The
directory " + getDefaultConfigDirectory()
- + " will be used instead.");
+ logger.info("The directory for rewritten configuration files was
not specified. {} will be used instead."
+ , getDefaultConfigDirectory());
} else {
configFiles = new ConfigFilesCollection(getConfigDirectory());
- logger.debug("Configuration files from " +
getConfigDirectory().getAbsolutePath()
- + " will be rewritten to the new format.");
+ logger.debug("Configuration files from {} will be rewritten to
the new format."
+ , getConfigDirectory().getAbsolutePath());
}

try {
@@ -81,19 +80,18 @@
public void run() throws PerfSONARException {
try {
if (configFiles.getFiles().size() <= 0) {
- logger.debug("psbase-1 configuration files were not found.");
+ logger.debug("pSbase-1 configuration files were not found.");
return;
}
final String templateFilePath =
getFullPath("configuration.xml.template");
final String configurationFile =
getFullPath("configuration.xml");
- logger.debug("Creating configuration file: " + configurationFile
+ " from template: " + templateFilePath
- + "...");
+ logger.debug("Creating configuration file: {} from template:
{}", configurationFile, templateFilePath);

engine.createFileFromTemplate(new File(templateFilePath),
configurationFile);

- logger.info("Old configuration files were successfully rewritten
"
- + "to the new format. Please check, if the rewritten
configuration file (" + configurationFile
- + ") is valid." + " You must restart the service for the
changes to take effect.");
+ logger.info("Old configuration files were successfully rewritten
to the new format. Please check, if the "
+ + "rewritten configuration file ({}) is valid. You must
restart the service for the changes to take effect."
+ , configurationFile);

configFiles.removeFiles();
} catch (IOException ex) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/messages/GenericMessageHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/messages/GenericMessageHandler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/messages/GenericMessageHandler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -51,13 +51,13 @@
protected void checkAuth(Configuration c, String messageType) throws
PerfSONARException {
try {
String authR =
c.getMessageHandler(messageType).getOption("authR").getValue();
- logger.debug("Checking authorization: " + authR);
+ logger.debug("Checking authorization: {}", authR);
if ("yes".equals(authR)) {
AuthNComponent authComponent = (AuthNComponent)
c.getAuxiliaryComponent("auth");
authComponent.requestAuthR(messageType, null);
} else {
String authN =
c.getMessageHandler(messageType).getOption("authN").getValue();
- logger.debug("Checking authentication: " + authN);
+ logger.debug("Checking authentication: {}", authN);
if ("yes".equals(authN)) {
AuthNComponent authComponent = (AuthNComponent)
c.getAuxiliaryComponent("auth");
authComponent.requestAuthN(messageType);
@@ -71,7 +71,7 @@

Message reqMessage = (Message) request.getElement();

- logger.debug("Message Handler started for message type [" +
reqMessage.getType() + "]");
+ logger.debug("Message Handler started for message type [{}]",
reqMessage.getType());

// get Service engine for this message
String messageType = null;
@@ -136,7 +136,7 @@

// if an exception was thrown, convert it to result code
// and add as a new message (to be joined) to array
- logger.info("Message handler result code: " + e);
+ logger.info("Message handler result code: {}", e);

resSM.setElement(ResultCodesUtil.generateResultMessage(e.getResultCode(),
e.getMessage()));

}
@@ -185,8 +185,8 @@

} catch (NoSuchMetadataException e) {
// wrong MetadataIdRef, remove it
- logger.warn("metadataIdRef is empty or there is no Metadata
with the given metadataIdRef, metadataIdRef="
- + metadataIdRef);
+ logger.warn("metadataIdRef is empty or there is no Metadata
with the given metadataIdRef, metadataIdRef= {}"
+ , metadataIdRef);
}
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/AbstractRegistrationAction.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/AbstractRegistrationAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/AbstractRegistrationAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -182,10 +182,10 @@
protected String getRegistrationEventType() {
String evt = getOption("registerEventType").getValue();
if (evt != null) {
- logger.debug("Found [registerEventType] option value [" + evt +
"]");
+ logger.debug("Found [registerEventType] option value [{}]", evt);
return evt;
} else {
- logger.debug("Taking default [registerEventType] value [" +
DEFAULT_REGISTRATION_EVENT_TYPE + "]");
+ logger.debug("Taking default [registerEventType] value [{}]",
DEFAULT_REGISTRATION_EVENT_TYPE);
return DEFAULT_REGISTRATION_EVENT_TYPE;
}
}
@@ -245,8 +245,8 @@
URL url = new URL(getOption(optName).getValue());
addressesList.add(url);
} catch (MalformedURLException ex) {
- logger.warn("Unable to convert LS address [" + optName +
"] into URL object. Exception was: "
- + ex.getMessage());
+ logger.warn("Unable to convert LS address [{}] into URL
object. Exception was: {}",
+ optName, ex.getMessage());
}

// Then handles lsList-1, lsList-2, ...
@@ -256,11 +256,11 @@
String remoteResource = getOption(optName).getValue();
addLSAddressesFromURL(addressesList, remoteResource);
} catch (MalformedURLException ex) {
- logger.warn("Unable to read LS list from URL address ["
+ optName
- + "] into URL object. Exception was: " +
ex.getMessage());
+ logger.warn("Unable to read LS list from URL address
[{}] into URL object. Exception was: {}",
+ optName, ex.getMessage());
} catch (IOException ex) {
- logger.warn("Unable to read LS list from URL address ["
+ optName
- + "] into URL object. Exception was: " +
ex.getMessage());
+ logger.warn("Unable to read LS list from URL address
[{}] into URL object. Exception was: {}",
+ optName, ex.getMessage());
}

}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/GenericLSRegistrator.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/GenericLSRegistrator.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/GenericLSRegistrator.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -68,7 +68,7 @@
Element responseElement = client.send(lsUrl.toString(), element);
ServiceMessage serviceResponseMessage = new
ServiceMessage(responseElement.getCopy());

- LOGGER.debug("LS request sent to the LS " + lsUrl.toString());
+ LOGGER.debug("LS request sent to the LS {}", lsUrl.toString());
return serviceResponseMessage;
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -55,7 +55,7 @@
URL glsAddress = lsAddresses.getFirst();
try {
response = registrator.keepalive(registeredKey,
glsAddress);
- logger.debug("KeepAlive message registered " +
glsAddress);
+ logger.debug("KeepAlive message registered {}",
glsAddress);

if (isResponseSuccess(getResponseMetadata(response))) {
logger.debug("KEEP ALIVE accepted");
@@ -65,7 +65,7 @@
}

} catch (PerfSONARException e) {
- logger.debug("Problem with sending KeepAlive message to
:" + glsAddress.toString());
+ logger.debug("Problem with sending KeepAlive message to:
{}", glsAddress.toString());
poolElement(lsAddresses);
registeredKeys.remove(registeredKey);
}
@@ -111,7 +111,7 @@
}
}
} catch (PerfSONARException e) {
- logger.warn("Problem with sending registration
message to :" + glsAddress.toString());
+ logger.warn("Problem with sending registration
message to: {}", glsAddress.toString());
poolElement(lsAddresses);
}
nrOfAddresses--;
@@ -122,7 +122,7 @@
}

if (registeredKeys.isEmpty()) {
- logger.warn("Registration to LS failed !!");
+ logger.warn("Registration to LS failed!");
} else {
logger.debug("Registration completed");
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/RequestHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/RequestHandler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/RequestHandler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -72,7 +72,7 @@
"No message type in request. Cannot find
MessageHandler");
}

- LOGGER.debug("Message type is [" + type + "]");
+ LOGGER.debug("Message type is [{}]", type);

// get Message Handler for message type (from mapping)
String className = null;
@@ -81,7 +81,7 @@
className =
ConfigurationManager.getInstance().getConfiguration().getMessageHandlerClassName(type);

} catch (Exception ex) {
- LOGGER.warn("Message type [" + type + "] not supported or
missing mapping/configuration.");
+ LOGGER.warn("Message type [{}] not supported or missing
mapping/configuration.", type);
}

if (className == null) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/axis2/Axis2RequestHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/axis2/Axis2RequestHandler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/requesthandler/axis2/Axis2RequestHandler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -60,12 +60,11 @@

if (serviceContext != null) {
// print data taken from ServiceContext
- LOGGER.debug("PerfSONAR Request Handler for Axis2 started.
Service name is [" + serviceContext.getName()
- + "], URL is [" + serviceContext.getMyEPR() + "]");
+ LOGGER.debug("PerfSONAR Request Handler for Axis2 started.
Service name is [{}], URL is [{}]",
+ serviceContext.getName(), serviceContext.getMyEPR());
} else {
- LOGGER.debug("PerfSONAR Request Handler for Axis2 started. "
- + "WARNING: Axis2 ServiceContext is null, perhaps
service is "
- + "just tested without Axis2 or Axis2 is misconfigured");
+ LOGGER.debug("PerfSONAR Request Handler for Axis2 started.
WARNING: Axis2 ServiceContext is null, "
+ + "perhaps service is just tested without Axis2 or Axis2
is misconfigured");
}
// get configuration
try {
@@ -73,7 +72,7 @@
configurationManager = ConfigurationManager.getInstance();
Configuration configuration =
configurationManager.getConfiguration();
Service service = configuration.getService();
- LOGGER.debug("Service name from perfSONAR configuration is [" +
service.getName() + "]");
+ LOGGER.debug("Service name from perfSONAR configuration is
[{}]", service.getName());

// response object
OMElement outOMElement = null;
@@ -119,7 +118,7 @@

// stop time measurement
long t2 = System.currentTimeMillis();
- LOGGER.debug("Service done successfuly in [" + (t2 - t1) +
"ms]");
+ LOGGER.debug("Service done successfuly in [{} ms]", t2 - t1);

// return successful response
return outOMElement;
@@ -129,7 +128,7 @@

// perfSONAR result code if request message cannot be server
// (parsing, etc.)
- LOGGER.error("Parse error: " + excp.toString());
+ LOGGER.error("Parse error: {}", excp.toString());

// return error response
// TODO: URL event types

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulerTask.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulerTask.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulerTask.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -33,11 +33,11 @@

// check whether interval isn't lower than minimal
if (interval < MIN_INTERVAL) {
- LOGGER.debug("Requested interval for action [" +
action.getClass() + "] too low. Taking [" + MIN_INTERVAL
- + "] seconds");
+ LOGGER.debug("Requested interval for action [{}] too low. Taking
[{}] seconds.",
+ action.getClass(), MIN_INTERVAL);
this.interval = MIN_INTERVAL;
} else {
- LOGGER.debug("Interval for action [" + action.getClass() + "]
set to [" + interval + "] seconds");
+ LOGGER.debug("Interval for action [{}] set to [{}] seconds.",
action.getClass(), interval);
this.interval = interval;
}
this.action = action;
@@ -84,11 +84,11 @@
*/
public boolean runAction() {

- LOGGER.debug("Scheduler Task [" + this.getClass() + "] - interval ["
+ interval + "] seconds");
+ LOGGER.debug("Scheduler Task [{}] - interval [{}] seconds",
this.getClass(), interval);

// if timestamp older than current - interval

- LOGGER.debug("Scheduler run action [" + action.getClass() + "]");
+ LOGGER.debug("Scheduler run action [{}]", action.getClass());

timestamp = System.currentTimeMillis();


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -141,8 +141,7 @@
*/
public void registerActions() {

- logger.debug("RegisterActions: Start of registering schedulling
tasks. Default interval is [" + interval
- + "] sec");
+ logger.debug("RegisterActions: Start of registering schedulling
tasks. Default interval is [{}] sec", interval);

if (scheduler != null) {

@@ -157,7 +156,7 @@
actionInterval =
Integer.parseInt(action.getOption("interval").getValue());
} catch (Exception ex) {
// NullPointer if no option or NumberFormatException
- logger.warn("Taking default [" + actionInterval + "]
value of action interval");
+ logger.warn("Taking default [{}] value of action
interval", actionInterval);
}

// get option status - on/off
@@ -169,11 +168,10 @@

if ("on".equals(actionStatus)) {
scheduler.addTask(actionInterval, (SchedulerAction)
action);
- logger.debug("Action [" + action.getName() + "] class ["
+ action.getClass()
- + "] registered to the scheduler with interval
[" + actionInterval + "] seconds");
+ logger.debug("Action [{}] class [{}] registered to the
scheduler with interval [{}] sec",
+ action.getName(), action.getClass(),
actionInterval);
} else {
- logger.info("Action [" + action.getName() + "] class ["
+ action.getClass()
- + "] not loaded, status set to [OFF]");
+ logger.info("Action [{}] class [{}] not loaded, status
set to [OFF]", action.getName(), action.getClass());
}

}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleAction.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -32,7 +32,7 @@

public void runAction() {

- LOGGER.info("This is simple SchedulerAction called [" + getName() +
"]" + " and run [" + counter + "] time");
+ LOGGER.info("This is simple SchedulerAction called [{}] and run [{}]
time", getName(), counter);

}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleScheduler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleScheduler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/SimpleScheduler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -64,8 +64,7 @@
int iteration = 0;
paused = false;
try {
- LOGGER.info("Scheduler run. Waiting [" + startDelayTime
- + "] sec for initialization of other components...");
+ LOGGER.info("Scheduler run. Waiting [{}] sec for initialization
of other components...", startDelayTime);
Thread.sleep(startDelayTime * 1000); // seconds
} catch (Exception ex) {
LOGGER.warn(ex.toString());
@@ -76,8 +75,7 @@
// if paused - not schedule any tasks
if (!paused) {

- LOGGER.debug("Scheduler iteration [#" + iteration + "].
Running [" + tasks.size()
- + "] Scheduled Tasks");
+ LOGGER.debug("Scheduler iteration [#{}]. Running [{}]
Scheduled Tasks", iteration, tasks.size());
// Let's protect iteration over tasks by
// corrupted iterator exception catcher,
// which prevents this thread from dieing

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/singleThread/SingleThreadScheduler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/singleThread/SingleThreadScheduler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/scheduler/singleThread/SingleThreadScheduler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -53,8 +53,7 @@

int iteration = 0;
try {
- LOGGER.debug("Scheduler run. Waiting [" + startDelayTime
- + "] sec for initialization of other components...");
+ LOGGER.debug("Scheduler run. Waiting [{}] sec for
initialization of other components...", startDelayTime);
Thread.sleep(startDelayTime * 1000);
} catch (InterruptedException e1) {
LOGGER.warn(e1.toString());
@@ -65,7 +64,7 @@
while (true) {
for (SchedulerTask task : tasks) {
if (task.canRun()) {
- LOGGER.debug("task " + task.getAction() + " can run");
+ LOGGER.debug("task {} can run", task.getAction());
if (lastSchedulerTask != null &&
lastSchedulerTask.isThreadAlive()) {
LOGGER.debug("Queue is not empty");
if (!waitQueue.contains(task)) {
@@ -84,14 +83,14 @@
lastSchedulerTask.runAction();
}
} else {
- LOGGER.debug("task " + task.getAction() + " CAN'T run");
+ LOGGER.debug("task {} CAN'T run", task.getAction());
}
}
try {
Thread.sleep(interval * 1000);
iteration++;
} catch (InterruptedException e) {
- LOGGER.warn("Sleep error after " + iteration + "
iterations.");
+ LOGGER.warn("Sleep error after {} iterations.", iteration);
}

}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBComponent.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -26,7 +26,7 @@
loadSettings();
createCredential();
createDataStorage();
- logger.debug("XMLDB Component created with [" +
dataStorage.getClass() + "] XML data storage");
+ logger.debug("XMLDB Component created with [{}] XML data storage",
dataStorage.getClass());
checkConfiguration();

}
@@ -52,12 +52,12 @@
protected void checkConfiguration() {

logger.debug("Checking DB configuration:");
- logger.debug(" - uri: " + uri);
- logger.debug(" - username: " + username);
- logger.debug(" - password: " + password);
- logger.debug(" - dataStorageClassName: " + dataStorageClassName);
- logger.debug(" - dataStorage: " + dataStorage);
- logger.debug(" - dataCredential: " + credential);
+ logger.debug(" - uri: {}", uri);
+ logger.debug(" - username: {}", username);
+ logger.debug(" - password: {}", password);
+ logger.debug(" - dataStorageClassName: {}", dataStorageClassName);
+ logger.debug(" - dataStorage: {}", dataStorage);
+ logger.debug(" - dataCredential: {}", credential);

}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -22,7 +22,7 @@
@SuppressWarnings("serial")
public abstract class AuthServlet extends HttpServlet {

- private Logger logger = LoggerFactory.getLogger(AuthServlet.class);
+ protected Logger logger = LoggerFactory.getLogger(getClass());

private String username;
private String password;

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/ExistDBInitServlet.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/ExistDBInitServlet.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/ExistDBInitServlet.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -2,8 +2,6 @@

import java.io.File;

-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.exist.security.User;
import org.exist.xmldb.UserManagementService;
import org.xmldb.api.DatabaseManager;
@@ -22,8 +20,6 @@
@SuppressWarnings("serial")
public abstract class ExistDBInitServlet extends AuthServlet {

- private Logger logger =
LoggerFactory.getLogger(ExistDBInitServlet.class);
-
/**
*
* upload file to eXistDatabase
@@ -52,7 +48,7 @@
Database database = (Database) cl.newInstance();
// The following is needed in case of embedded DB
// database.setProperty("create-database", "true");
- logger.debug("••• Connecting to eXist DB as \"" + getUsername()
+ "\" •••");
+ logger.debug("••• Connecting to eXist DB as \"{}\" •••",
getUsername());
DatabaseManager.registerDatabase(database);
Collection collection = DatabaseManager.getCollection(dbUrl,
getUsername(), getPassword());
if (collection == null) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -74,7 +74,7 @@
for (int event = staxXmlReader.next(); event !=
XMLStreamConstants.END_DOCUMENT; event = staxXmlReader.next()) {

if (event == XMLStreamConstants.START_ELEMENT) {
- logger.debug("\n== BEGIN: " + staxXmlReader.getLocalName());
+ logger.debug("\n== BEGIN: {}", staxXmlReader.getLocalName());
try {
log("* [" + staxXmlReader.getText() + "]");
} catch (Exception ex) {
@@ -85,14 +85,14 @@
// end START_ELEMENT

} else if (event == XMLStreamConstants.END_ELEMENT) {
- logger.debug("\n == END: " + staxXmlReader.getLocalName());
+ logger.debug("\n == END: {}", staxXmlReader.getLocalName());

// end END_ELEMENT

} else if (event == XMLStreamConstants.CHARACTERS) {


logger.debug("-----------------------------------------------------------------------\n");
- logger.debug("\n== CHARACTERS <" + elementName + ">:");
+ logger.debug("\n== CHARACTERS <{}>:", elementName);

if (rememberIndex) {
rememberIndex = false;

Modified: trunk/perfsonar-java-rrd-ma/pom.xml
===================================================================
--- trunk/perfsonar-java-rrd-ma/pom.xml 2013-05-31 16:42:52 UTC (rev 6429)
+++ trunk/perfsonar-java-rrd-ma/pom.xml 2013-05-31 16:44:18 UTC (rev 6430)
@@ -140,7 +140,7 @@
<dependency>
<groupId>net.geant.perfsonar</groupId>
<artifactId>perfsonar-java-base2</artifactId>
- <version>1.1.2</version>
+ <version>1.1.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.geant.perfsonar</groupId>

Modified:
trunk/perfsonar-java-rrd-ma/soapUI/perfsonar-RRD-MA-base2-soapui-project.xml
===================================================================
---
trunk/perfsonar-java-rrd-ma/soapUI/perfsonar-RRD-MA-base2-soapui-project.xml
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-rrd-ma/soapUI/perfsonar-RRD-MA-base2-soapui-project.xml
2013-05-31 16:44:18 UTC (rev 6430)
@@ -148,7 +148,7 @@
<http:address
location="http://192.168.1.214:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService.MeasurementArchiveServiceHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
-</wsdl:definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://rrdma-old:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://rrdma:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://rrdma-new:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://localhost:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint></con:endpoints><con:operation
isOneWay="false" action="urn:message" name="message"
bindingOperationName="message" type="Request-Response" inputName=""
receivesAttachments="false" sendsAttachments="false"
anonymous="optional"><con:settings/><con:call name="Request 1" outgoingWss=""
incomingWss=""><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://rrdma-old:8080/perfsonar-java-rrd-ma/services/MeasurementArc
hiveService</con:endpoint><con:request>&lt;soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
+</wsdl:definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://rrdma-old:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://rrdma:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://rrdma-new:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint><con:endpoint>http://localhost:8080/perfsonar-java-rrd-ma/services/MeasurementArchiveService</con:endpoint></con:endpoints><con:operation
isOneWay="false" action="urn:message" name="message"
bindingOperationName="message" type="Request-Response" inputName=""
receivesAttachments="false" sendsAttachments="false"
anonymous="optional"><con:settings/><con:call name="Request 1" outgoingWss=""
incomingWss=""><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/perfsonar-java-rrd-ma/services/MeasurementArc
hiveService</con:endpoint><con:request>&lt;soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
&lt;soapenv:Header/>
&lt;soapenv:Body/>
&lt;/soapenv:Envelope></con:request><con:credentials><con:username
xsi:nil="true"/><con:password xsi:nil="true"/><con:domain
xsi:nil="true"/><con:authType>Global HTTP
Settings</con:authType></con:credentials><con:jmsConfig
JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig
mustUnderstand="NONE" version="200508" action="urn:message"/><con:wsrmConfig
version="1.2"/></con:call></con:operation></con:interface><con:testSuite
name="Echo"><con:description>Echo Requests messages.

Modified:
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
===================================================================
---
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -26,7 +26,6 @@
import org.perfsonar.base2.xml.nmwg.Message;
import org.perfsonar.base2.xml.nmwg.Metadata;

-
/**
* Abstract class that does all the things that a "request" message
* handler will need to do.
@@ -59,20 +58,20 @@
{
try {
String authR =
c.getMessageHandler(messageType).getOption("authR").getValue();
- LOGGER.debug("Checking authorization: " + authR);
+ LOGGER.debug("Checking authorization: {}", authR);
if ("yes".equals(authR)) {
AuthNComponent authComponent = (AuthNComponent)
c.getAuxiliaryComponent("auth");
authComponent.requestAuthR(messageType, null);
} else {
String authN =
c.getMessageHandler(messageType).getOption("authN").getValue();
- LOGGER.debug("Checking authentication: " + authN);
+ LOGGER.debug("Checking authentication: {}", authN);
if ("yes".equals(authN)) {
AuthNComponent authComponent = (AuthNComponent)
c.getAuxiliaryComponent("auth");
authComponent.requestAuthN(messageType);
}
}
} catch (RuntimeException ex) {
- LOGGER.warn("Runtime exception ignored: " + ex.getMessage());
+ LOGGER.warn("Runtime exception ignored: {}", ex.getMessage());
}
}

@@ -81,7 +80,7 @@

Message reqMessage = (Message) request.getElement();

- LOGGER.debug("Message Handler started for message type [" +
reqMessage.getType() + "]");
+ LOGGER.debug("Message Handler started for message type [{}]",
reqMessage.getType());

//get Service engine for this message
String messageType = null;

Modified:
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/rrd/RRDDataStorageDAOImpl.java
===================================================================
---
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/rrd/RRDDataStorageDAOImpl.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/rrd/RRDDataStorageDAOImpl.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -270,7 +270,7 @@
try {
responseGenerator = (ResponseGenerator)
Class.forName(responseGeneratorClassName).newInstance();
} catch (Exception ex) {
- logger.warn("can not create an object of " + className +
"class");
+ logger.warn("Cannot create an object of {} class", className);
throw new PerfSONARException("object_creation_exception",
"can not create an object of " +
className + "class");
}

Modified:
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
===================================================================
---
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -37,7 +37,7 @@
*/
public Query getQuery(EntityManager em, Metadata metadata, String
tableName) throws PerfSONARException {
Map<String, String> parametersMap = getParametersMap(metadata,
tableName);
- logger.info("SQL query: " + parametersMap.get("query"));
+ logger.info("SQL query: {}", parametersMap.get("query"));

Query query = em.createNativeQuery(parametersMap.get("query"),
Interfaces.class);
for (String parameter : parametersMap.keySet()) {
@@ -212,7 +212,7 @@
throw new PerfSONARException("query_exception", msg);
}

- logger.debug("EventType: " + et);
+ logger.debug("EventType: {}", et);
return et;
}


Modified:
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/servlets/DbInitializerServlet.java
===================================================================
---
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/servlets/DbInitializerServlet.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/servlets/DbInitializerServlet.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -56,7 +56,7 @@
}

} catch (PerfSONARException e) {
- logger.warn("DB initialization failed: " + e.getMessage());
+ logger.warn("DB initialization failed: {}", e.getMessage());
}

getServletConfig().getServletContext().getRequestDispatcher(

Modified:
trunk/perfsonar-java-xml-ls/soapUI/perfsonar-LS-base2-soapui-project.xml
===================================================================
--- trunk/perfsonar-java-xml-ls/soapUI/perfsonar-LS-base2-soapui-project.xml
2013-05-31 16:42:52 UTC (rev 6429)
+++ trunk/perfsonar-java-xml-ls/soapUI/perfsonar-LS-base2-soapui-project.xml
2013-05-31 16:44:18 UTC (rev 6430)
@@ -4309,7 +4309,7 @@
initscript.run(null, false)
</con:setupScript></con:testSuite><con:testSuite name="Echo"
id="737cc852-3a97-439e-a52e-416664706e62"><con:description>Echo Requests
messages. GEANT service support DBConnection and DBSchema tests, but I2
services don't.

-The invalid data request actually gives no errored result... not sure it is
intended.</con:description><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase
failOnError="false" failTestCaseOnErrors="true" keepSession="true"
maxResults="0" name="Correct requests" searchProperties="true" timeout="0"
wsrmEnabled="false" wsrmVersion="1.0" wsrmAckTo=""
id="6a908806-14bd-43c0-a930-c286101f7e67" amfAuthorisation="false"
amfEndpoint="" amfLogin=""
amfPassword=""><con:description/><con:settings/><con:testStep type="request"
name="2.5.2.1.1 - Echo Request"
id="788efbc0-de8e-47de-adc7-99b16fdaf4e4"><con:settings/><con:config
xsi:type="con:RequestStep"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><con:interface>LookupServiceSoap12Binding</con:interface><con:operation>message</con:operation><con:request
name="2.5.2.1.1 - Echo Request" outgoingWss=""
incomingWss=""><con:settings><con:setting
id="com.eviware.soapui.impl.wsdl.WsdlRequest@inline-response-attachments">fal
se</con:setting><con:setting
id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://ls-1-6:8080/perfsonar-java-xml-ls/services/LookupService</con:endpoint><con:request><![CDATA[<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+The invalid data request actually gives no errored result... not sure it is
intended.</con:description><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase
failOnError="false" failTestCaseOnErrors="true" keepSession="true"
maxResults="0" name="Correct requests" searchProperties="true" timeout="0"
wsrmEnabled="false" wsrmVersion="1.0" wsrmAckTo=""
id="6a908806-14bd-43c0-a930-c286101f7e67" amfAuthorisation="false"
amfEndpoint="" amfLogin=""
amfPassword=""><con:description/><con:settings/><con:testStep type="request"
name="2.5.2.1.1 - Echo Request"
id="788efbc0-de8e-47de-adc7-99b16fdaf4e4"><con:settings/><con:config
xsi:type="con:RequestStep"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><con:interface>LookupServiceSoap12Binding</con:interface><con:operation>message</con:operation><con:request
name="2.5.2.1.1 - Echo Request" outgoingWss=""
incomingWss=""><con:settings><con:setting
id="com.eviware.soapui.impl.wsdl.WsdlRequest@inline-response-attachments">fal
se</con:setting><con:setting
id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://ls.perfsonar.pionier.net.pl:9990/perfSONAR_PS/services/gLS</con:endpoint><con:request><![CDATA[<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<soapenv:Header/>
<soapenv:Body>


Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/AbstractRegisterServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/AbstractRegisterServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/AbstractRegisterServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -29,7 +29,7 @@

// Updating to the current time in seconds
long now = System.currentTimeMillis() / 1000;
- logger.debug("Update time... [" + now + " sec]");
+ logger.debug("Update time... [{} sec]", now);

//run setControlParameter, modify control schema of the LS
dao.setControlParameter(key, "timestamp", Long.toString(now));

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/DiscoveryQueryGenerator.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -115,17 +115,17 @@
} else if ("eventType".equals(name)) {
addEventType(value);
} else {
- logger.info("Unrecognized and
ignored parameter: " + p.toString());
+ logger.info("Unrecognized and
ignored parameter: {}", p.toString());
}
}
}
}
} else {
- logger.warn("Unsupported element in the query
subject: " + elementName);
+ logger.warn("Unsupported element in the query
subject: {}", elementName);
throw new PerfSONARException("error.ls.query",
"Unsupported element: " + elementName);
}
} else {
- logger.warn("Unsupported namespace for the query
subject: " + namespaceUri);
+ logger.warn("Unsupported namespace for the query
subject: {}", namespaceUri);
throw new PerfSONARException("error.ls.query",
"Unsupported namespace: " + namespaceUri);
}
}
@@ -148,7 +148,7 @@
*/
private void addEventType(String eventType) {
if (eventType != null) {
- logger.trace(" we add an eventType: " + eventType);
+ logger.trace(" we add an eventType: {}", eventType);
eventTypes.add(eventType.trim());
}
}
@@ -159,7 +159,7 @@
*/
private void addKeyword(String keyword) {
if (keyword != null) {
- logger.trace(" we add a keyword: " + keyword);
+ logger.trace(" we add a keyword: {}", keyword);
keywords.add(keyword.trim());
}
}
@@ -172,7 +172,7 @@
Element name = domain.getFirstChild("name");
if (name != null) {
String n = name.getText();
- logger.trace(" we add a domain: " + n);
+ logger.trace(" we add a domain: {}", n);
if (n != null) {
domains.add(n.trim());
}
@@ -185,7 +185,7 @@
*/
private void addIpAddress(Element ipAddress) {
String ip = ipAddress.getText();
- logger.trace(" we add an IP address: " + ip);
+ logger.trace(" we add an IP address: {}", ip);
if (ip != null) {
ipAddresses.add(ip.trim());
}
@@ -222,7 +222,7 @@
q.append("]\nreturn data($d/@metadataIdRef)");

query = q.toString();
- logger.debug("Generated XQuery is:\n" + query);
+ logger.debug("Generated XQuery is:\n{}", query);

} else {
logger.warn("The Discovery query should contain at least one
search condition on ip, domain, eventType or keyword.");

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/GenericLSServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/GenericLSServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/GenericLSServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -107,9 +107,8 @@
for (Element p : params.getChildren("parameter")) {
String parameterValue = extractParameterValue(p);
if (parameterName.equals(p.getAttribute("name"))) {
- logger.debug("Found Parameter [" + parameterName
- + "] in metadata [" + requestMetadata.getId()
- + "]");
+ logger.debug("Found Parameter [{}] in metadata [{}]",
+ parameterName, requestMetadata.getId());
return parameterValue; // if key has keyId and
}
}

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -43,7 +43,7 @@
// Get Key from Metadata

String keyValue = getParameterFromKey(requestMetadata, LS_KEY);
- logger.debug("LSDeregisterAction: LS key=[" + keyValue + "]");
+ logger.debug("LSDeregisterAction: LS key=[{}]", keyValue);

if (keyValue == null) {
String m = "LSDeregisterAction: No key in metadata";
@@ -59,11 +59,9 @@
if (elementsRemoved < 1) {
// given key not found !
// TODO: url event types
- msg = ResultCodesUtil.generateResultMessage(
- "error.ls.key_not_found",
- "There were no metadata and data for key [" + keyValue
- + "]");
- logger.debug("given key " + keyValue + " not found in DB");
+ msg =
ResultCodesUtil.generateResultMessage("error.ls.key_not_found",
+ "There were no metadata and data for key [" + keyValue +
"]");
+ logger.debug("given key [{}] not found in DB", keyValue);
} else {
// metadata with key existed - deregistration successful


Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDiscoveryAction.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDiscoveryAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSDiscoveryAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -68,7 +68,7 @@

} else {
// fill the response with the results
- logger.debug("Got list of " + resultSet.size() + " unique
services");
+ logger.debug("Got list of {} unique services", resultSet.size());

// query for services metadata, omit when empty
Collection<Element> results =
queryForServicesMetadata(resultSet);
@@ -78,8 +78,7 @@
if (results != null) {
for (Element e : results) {
if ("metadata".equals(e.getName())) {
- logger.debug("Add result metadata [" + e.getId()
- + "] to data [" + data.getId() + "]");
+ logger.debug("Add result metadata [{}] to data
[{}]", e.getId(), data.getId());
data.addChild(e);
}
}
@@ -144,8 +143,8 @@
qb.append("return $m \n");

String query = qb.toString();
-
logger.debug("\n------------------------------------------------\nQUERY
2:\n------------------------------------------------\n"
- + query + "\n");
+
logger.debug("\n------------------------------------------------\nQUERY
2:\n------------------------------------------------\n{}\n",
+ query);

XMLDBResult results = dao.performXQuery(query);
return results.getResults();
@@ -163,8 +162,8 @@

/* XQuery. Will return string array containing metadata blocks */
/* Query 1 - service names */
-
logger.debug("\n------------------------------------------------\nQUERY
1:\n------------------------------------------------\n"
- + query + "\n");
+
logger.debug("\n------------------------------------------------\nQUERY
1:\n------------------------------------------------\n{}\n",
+ query);

XMLDBResult dbres = dao.performXQuery(query);
String[] resultArr = dbres.getTextResults();

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSKeepaliveServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSKeepaliveServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSKeepaliveServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -69,7 +69,7 @@
throws PerfSONARException {

String keyValue = getParameterFromKey(requestMetadata, LS_KEY);
- logger.debug("LSKeepaliveAction: LS key=[" + keyValue + "]");
+ logger.debug("LSKeepaliveAction: LS key=[{}]", keyValue);

if (keyValue == null) {
String m = "No key in metadata";

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryAction.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -37,12 +37,12 @@
// get subject query
String query = subject.getText();

- logger.debug("Query=[" + query + "]");
+ logger.debug("Query=[{}]", query);

// Performing XQuery operation on the database
logger.debug("Perform query");
XMLDBResult results = dao.performXQuery(query);
- logger.debug("Got [" + results.getElementsCount() + "] results from
DB");
+ logger.debug("Got [{}] results from DB", results.getElementsCount());

// create ServiceEngineResponse and put there the results
// TODO: url event types

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSQueryServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -76,24 +76,21 @@
} else {
// subject and eventTypes occur - process
eventType = et.getEventType();
- logger.debug("Found eventType [+eventType+]");
+ logger.debug("Found eventType [{}]", eventType);

// try to get subject
subject = subjectElement.iterator().next();

metadataWithSubject = m;
- logger.debug("Found subject (namespace "
- + subject.getNamespacePrefix() + ")");
+ logger.debug("Found subject (namespace {})",
subject.getNamespacePrefix());

// try to get parameters
Parameters parameters = m

.getParameters("http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/";);
if (parameters != null
&& parameters.getChildren("parameters") != null)
{
- lsOutput = parameters.getFirstParameter("lsOutput")
- .getValue();
- logger.debug("Found lsOutput parameter [" + lsOutput
- + "]");
+ lsOutput =
parameters.getFirstParameter("lsOutput").getValue();
+ logger.debug("Found lsOutput parameter [{}]",
lsOutput);
}
}
}
@@ -101,7 +98,7 @@

// Dispatch on eventType
if (isLookupQuery(eventType)) {
- logger.debug("EventType [" + eventType + "] accepted, taking RAW
LSQuery action");
+ logger.debug("EventType [{}] accepted, taking RAW LSQuery
action", eventType);

// Perform a plain query
LSQueryAction queryAction = new LSQueryAction(dao);
@@ -109,16 +106,16 @@
requestMessage, subject, lsOutput);

} else if (isLookupDiscovery(eventType)) {
- logger.debug("EventType [" + eventType + "] accepted, taking
LSDiscovery action");
+ logger.debug("EventType [{}] accepted, taking LSDiscovery
action", eventType);

// Perform a discovery query
LSDiscoveryAction discovery = new LSDiscoveryAction(dao);
- logger.debug("subject:" + subject);
+ logger.debug("Subject: {}", subject);
discovery.performAction(serviceRequest, serviceResponse,
requestMessage, metadataWithSubject, subject);

} else {
- logger.warn("Unsupported query message eventType: " + eventType);
+ logger.warn("Unsupported query message eventType: {}",
eventType);
throw new PerfSONARException("error/unsupported query message",
"Unsupported query message");
}

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -40,7 +40,7 @@
long clientTTL =
getLSTTLFromParameters(parametersNodes.get(0));
setClientTTL(clientTTL);
if (clientTTL != 0) {
- logger.debug("TTL parameters are set, suggested TTL
param by client: " + clientTTL);
+ logger.debug("TTL parameters are set, suggested TTL
param by client: {}", clientTTL);
if (isBetweenTTLBound(clientTTL)) {

setTtlParameterStatus(LsTTLParameterStatus.ACCEPTED);
setClientTTL(clientTTL);
@@ -51,10 +51,10 @@
setClientTTL(0);
}
} else {
- logger.info("Ignoring TTL parameter of " +
clientTTL);
+ logger.info("Ignoring TTL parameter of {}",
clientTTL);
}
} catch (PerfSONARException ex) {
- logger.info("Ignoring TTL parameter: " +
ex.getMessage());
+ logger.info("Ignoring TTL parameter: {}",
ex.getMessage());
setTtlParameterStatus(LsTTLParameterStatus.NOT_A_NUMBER);
}
}
@@ -70,7 +70,7 @@
// TODO: url event types
throw new PerfSONARException("error.ls.no_metadata", m);
}
- logger.debug("Getting metadata from request: [" +
requestMetadata.getId() + "]");
+ logger.debug("Getting metadata from request: [{}]",
requestMetadata.getId());

// Check eventType
EventType reqEvT = null;
@@ -80,14 +80,14 @@
// if no eventType and home LS -- use Service evt. for backward
compatibility
if ((!isGLS()) && (reqEventType == null)) {
reqEventType = SERVICE_EVENT_TYPE;
- logger.debug("Taking default eventType [" + SERVICE_EVENT_TYPE +
"]");
+ logger.debug("Taking default eventType [{}]",
SERVICE_EVENT_TYPE);
}

// check GLS
if ((SERVICE_EVENT_TYPE.equals(reqEventType) && !isGLS())
|| (SUMMARY_EVENT_TYPE.equals(reqEventType) && isGLS())) {
// OK - no action
- logger.debug("eventType accepted [" + reqEventType + "]");
+ logger.debug("eventType accepted [{}]", reqEventType);
} else {
String m = "[LS Registration] no service event type or wrong
eventType! Service is "
+ ((isGLS()) ? "[global-LS] and accepts [" +
SUMMARY_EVENT_TYPE + "]"
@@ -111,7 +111,7 @@

// Try to get Key from Metadata
String keyValue = getParameterFromKey(requestMetadata, LS_KEY);
- logger.debug("Key from metadata=[" + keyValue + "]");
+ logger.debug("Key from metadata=[{}]", keyValue);

// ========check metadata========

@@ -153,16 +153,15 @@
Data[] dataElements = getDataElements(request);

// process with register/update
- logger.debug("check whether lookup info [" + metadataId + "] exists
in DB");
+ logger.debug("check whether lookup info [{}] exists in DB",
metadataId);

// check if there is metadata with the same key:
// if so, check if you're allowed to update data (to remove them)
// throw exception if you're not allowed
if (dao.isLookupInfo(metadataId)) {
// insert-update
- logger.debug("Such Lookup Info (" + metadataId
- + " is already registered in DB. Allow_update is set to
["
- + allowReplaceIfAlreadyRegistered + "]");
+ logger.debug("Such Lookup Info [{}] is already registered in DB.
Allow_update is set to [{}]",
+ metadataId, allowReplaceIfAlreadyRegistered);

if (allowReplaceIfAlreadyRegistered) {
logger.debug("Old data will be replaced by new set of data");
@@ -190,16 +189,16 @@

// remove old lookup information if there is any
if (doRemove) {
- logger.info("Remove old Lookup Info (" + metadataId + ")");
+ logger.info("Remove old Lookup Info ({})", metadataId);
int num = dao.removeLookupInfo(metadataId);
- logger.debug("Removed [" + num + "] old entries");
+ logger.debug("Removed [{}] old entries", num);
}

// remove old Lookup Info as well - if update and there is lookup
info with different key
if (doRemoveOldKey && (!keyValue.equals(metadataId))) {
- logger.info("Remove old Lookup Info - other key (" + keyValue +
")");
+ logger.info("Remove old Lookup Info - other key ({})", keyValue);
int num = dao.removeLookupInfo(keyValue);
- logger.debug("Removed [" + num + "] old entries");
+ logger.debug("Removed [{}] old entries", num);
}

logger.debug("Now, let's insert the data into the DB");
@@ -209,7 +208,7 @@
ModificationCounterComponent component =
getModificationCounterComponent();
component.incrementCounter();

- logger.info("Put new Lookup Info (" + metadataId + ") metadata + " +
dataElements.length + " data elements");
+ logger.info("Put new Lookup Info ({}) metadata + {} data elements",
metadataId, dataElements.length);
// update control time - last modification
updateTime(metadataId);
if (getTtlParameterStatus().equals(LsTTLParameterStatus.ACCEPTED)) {

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/DataSourceComponent.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/DataSourceComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/DataSourceComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -102,7 +102,7 @@
splitedURL[0] = m.group(1);
splitedURL[1] = m.group(2);
} else {
- logger.error("Cannot split eXist DB url: " + url);
+ logger.error("Cannot split eXist DB url: {}", url);
throw new PerfSONARException("Cannot split eXist DB url: " +
url);
}
return splitedURL;

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/ModificationCounterComponent.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/ModificationCounterComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/ModificationCounterComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -44,7 +44,7 @@
public void incrementCounter() {
counter.incrementAndGet();
diffsBetweenRegistrationCounter.incrementAndGet();
- logger.trace("Counter increased " + counter + " diffs " +
diffsBetweenRegistrationCounter);
+ logger.trace("Counter increased by {} diffs, now at {}",
diffsBetweenRegistrationCounter, counter);
}
/**
* resets counter. This method is invoked after summarization process

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/XMLDBComponent.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/XMLDBComponent.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/components/XMLDBComponent.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -108,12 +108,12 @@
col.setProperty(OutputKeys.INDENT, "no");
myService = (LocalXPathQueryService)
col.getService("XPathQueryService", "1.0");
myService.setProperty("indent", "yes");
- logger.trace(" Service instanciated: " + myService);
+ logger.trace(" Service instanciated: {}", myService);
} catch (XMLDBException e) {
throw new PerfSONARException("error.ls.no_storage", "Cannot
initialize Db access - wrong datasource or issue with eXist DB");
}
} else {
- logger.trace(" myService was already instanciated, we
re-use it: " + myService);
+ logger.trace(" myService was already instanciated, we
re-use it: {}", myService);
}
}

@@ -148,7 +148,7 @@
if (myMainCollection == null) {
myMainCollection = getDBCollectionAs(url, username, password);
} else {
- logger.trace(" myMainCollection was already instanciated,
we re-use it: " + myMainCollection);
+ logger.trace(" myMainCollection was already instanciated,
we re-use it: {}", myMainCollection);
}
return myMainCollection;
}
@@ -161,7 +161,7 @@
* @throws PerfSONARException
*/
public synchronized Collection getDBCollectionAs(String connectionURL,
String username, String password) throws PerfSONARException {
- logger.debug("Getting " + connectionURL + " Collection as \"" +
username + "\"");
+ logger.debug("Getting {} Collection as \"{}\"", connectionURL,
username);
try {
Collection collection =
DatabaseManager.getCollection(connectionURL, username, password);
if (collection == null) {
@@ -173,12 +173,12 @@
collection = DatabaseManager.getCollection(connectionURL,
username, password);
if (collection == null) {
// We got a null twice, let's raise an exception this
time
- logger.error("Renewing DB registration, still no
collection (" + connectionURL + ") returned!");
+ logger.error("Renewing DB registration, still no
collection ({}) returned!", connectionURL);
// Whenever an XMLDBException is raised, it is better to
reset the DB connection
throw new PerfSONARException("error.ls.no_storage",
"Cannot get collection - wrong datasource or db is not initialized");
}
}
- logger.trace(" Collection correctly instanciated: " +
collection);
+ logger.trace(" Collection correctly instanciated: {}",
collection);
return collection;
} catch (XMLDBException e) {
logger.error("Getting collection (" + connectionURL + ") as \""
+ username + "\" failed: " + e.getMessage());
@@ -197,7 +197,7 @@
if (myStoreCollection == null) {
myStoreCollection = getDBCollectionAs(url + mainCollection +
"/store", username, password);
} else {
- logger.trace(" store Collection was already instanciated,
we re-use it: " + myStoreCollection);
+ logger.trace(" store Collection was already instanciated,
we re-use it: {}", myStoreCollection);
}
}

@@ -217,7 +217,7 @@
res.setContent(content);
myStoreCollection.storeResource(res);
} catch (XMLDBException e) {
- logger.warn("File upload XMLDB error (file may or may not be
uploaded): " + e.getMessage());
+ logger.warn("File upload XMLDB error (file may or may not be
uploaded): {}", e.getMessage());
if (e.getMessage().matches("Failed to (parse|read) servers
response: .*")
|| e.getMessage().startsWith("Failed to create input
stream: ")) {
logger.warn("We'll try to recover...");
@@ -230,7 +230,7 @@
throw new PerfSONARException("error.ls.query", "Error trying
to upload file (file may or may not be uploaded): " + e.getMessage());
}
} catch (NullPointerException e) {
- logger.warn("File couldn't be uploaded because of: " + e);
+ logger.warn("File couldn't be uploaded because of: {}", e);
if
(e.getStackTrace()[1].toString().contains("HttpURLConnection")) {
logger.warn("This is probably a transport error, we'll try
to recover...");
resetDBElements();
@@ -241,7 +241,7 @@
throw new PerfSONARException("error.ls.query", "Error trying
to upload file (file may or may not be uploaded): " + e.getMessage());
}
} catch (IllegalStateException e) {
- logger.warn("XQuery result couldn't be performed because of a
transport error: " + e);
+ logger.warn("XQuery result couldn't be performed because of a
transport error: {}", e);
if (e.getMessage().contentEquals("Already connected")) {
logger.warn("We'll try to recover...");
resetDBElements();
@@ -268,7 +268,7 @@
myStoreCollection.removeResource(res);
}
} catch (XMLDBException e) {
- logger.warn("File removal error (file may or may not be
removed): " + e.getMessage());
+ logger.warn("File removal error (file may or may not be
removed): {}", e.getMessage());
if (e.getMessage().matches("Failed to (parse|read) servers
response: .*")
|| e.getMessage().startsWith("Failed to create input
stream: ")) {
logger.warn("We'll try to recover...");
@@ -279,7 +279,7 @@
throw new PerfSONARException("error.ls.query", "Error trying
to remove file (file may or may not be removed): " + e.getMessage());
}
} catch (NullPointerException e) {
- logger.warn("File couldn't be removed because of: " + e);
+ logger.warn("File couldn't be removed because of: {}",
e.getMessage());
if
(e.getStackTrace()[1].toString().contains("HttpURLConnection")) {
logger.warn("This is probably a transport error, we'll try
to recover...");
resetDBElements();
@@ -290,7 +290,7 @@
throw new PerfSONARException("error.ls.query", "Error trying
to remove file (file may or may not be removed): " + e.getMessage());
}
} catch (IllegalStateException e) {
- logger.warn("XQuery result couldn't be performed because of a
transport error: " + e);
+ logger.warn("XQuery result couldn't be performed because of a
transport error: {}", e.getMessage());
if (e.getMessage().contentEquals("Already connected")) {
logger.warn("We'll try to recover...");
resetDBElements();
@@ -329,7 +329,7 @@
}

// CompiledExpression compiled = service.compile(xquery);
- logger.trace("Ask the XMLDB XQueryService to perform the
following query for us: \n" + xquery);
+ logger.trace("Ask the XMLDB XQueryService to perform the
following query for us: \n{}", xquery);
ResourceSet rs = myService.query(xquery);
ResourceIterator i = rs.getIterator();

@@ -362,7 +362,7 @@
existResult.getBytes()), count);
}
} catch (XMLDBException e) {
- logger.warn("XQuery couldn't be performed because of an XMLDB
error: " + e.getMessage());
+ logger.warn("XQuery couldn't be performed because of an XMLDB
error: {}", e.getMessage());
logger.debug("------------------------------------");
logger.debug(xquery);
logger.debug("------------------------------------");
@@ -381,7 +381,7 @@
logger.error("XQuery result couldn't be parsed because of an
XMLStream error: " + e);
throw new PerfSONARException("error.ls.query", "Problem
executing XQuery: " + e.getMessage());
} catch (NullPointerException e) {
- logger.warn("XQuery result couldn't be performed because of: " +
e);
+ logger.warn("XQuery result couldn't be performed because of:
{}", e.getMessage());
if
(e.getStackTrace()[1].toString().contains("HttpURLConnection")) {
logger.warn("This is probably a transport error, we'll try
to recover...");
resetDBElements();
@@ -391,7 +391,7 @@
throw new PerfSONARException("error.ls.query", "Problem
executing XQuery: " + e.getMessage());
}
} catch (IllegalStateException e) {
- logger.warn("XQuery result couldn't be performed because of a
transport error: " + e);
+ logger.warn("XQuery result couldn't be performed because of a
transport error: {}", e.getMessage());
if (e.getMessage().contentEquals("Already connected")) {
logger.warn("We'll try to recover...");
resetDBElements();
@@ -419,7 +419,7 @@

StaxParser sp = new ConfigurationStaxParser();
Element e = sp.parse(inputStream);
- logger.trace("Parsing the XML stream resulted in: " + e.toString());
+ logger.trace("Parsing the XML stream resulted in: {}", e.toString());

if (count >= 0) {
return new XMLDBResult(e.getChildren(), count, count, 0);

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/CleanupSchedulerAction.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/CleanupSchedulerAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/CleanupSchedulerAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -38,7 +38,7 @@
if (lsTTLOption != null) {
try {
lsTTL = Integer.parseInt(lsTTLOption.getValue());
- logger.debug("Setting LS TTL to [" + lsTTL + "]");
+ logger.debug("Setting LS TTL to [{}]", lsTTL);
} catch (NumberFormatException ex) {
logger.debug("Taking default LS TTL");
}
@@ -70,7 +70,7 @@
// current timestamp in sec
long now = System.currentTimeMillis() / 1000;

- logger.debug("[LSCleanup] cleanup action started, timestamp=[" + now
+ "]s lsTTL=[" + lsTTL + "]s");
+ logger.debug("[LSCleanup] cleanup action started, timestamp=[{}]s
lsTTL=[{}]s", now, lsTTL);

// perform cleanup operation
int elementRemoved = dao.cleanupLookupInfo(now, lsTTL);

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/GLSRegistrationAction.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/GLSRegistrationAction.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/schedulerActions/GLSRegistrationAction.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -70,18 +70,18 @@
URL glsAddress = glsAddresses.getFirst();
try {
response = registrator.keepalive(registeredKey,
glsAddress);
- logger.trace("KeepAlive message sent to gLS: " +
glsAddress);
+ logger.trace("KeepAlive message sent to gLS: {}",
glsAddress);

if (isResponseSuccess(getResponseMetadata(response))) {
- logger.debug(glsAddress + " accepted our KeepAlive");
+ logger.debug("{} accepted our KeepAlive",
glsAddress);
} else {
- logger.debug(glsAddress + " refused our KeepAlive");
+ logger.debug("{} refused our KeepAlive", glsAddress);
// We remove the key as it seems it doesn't exist in
the gLS cloud anymore
registeredKeys.remove(registeredKey);
}

} catch (PerfSONARException e) {
- logger.warn("Problem with sending KeepAlive message to:
" + glsAddress.toString());
+ logger.warn("Problem with sending KeepAlive message to:
{}", glsAddress);
poolElement(glsAddresses);
registeredKeys.remove(registeredKey);
}
@@ -108,23 +108,23 @@
try {
// Send registration message to gLS
response = registrator.register(requestMessage,
glsAddress);
- logger.trace("Registration message sent to gLS: " +
glsAddress.toString());
+ logger.trace("Registration message sent to gLS: {}",
glsAddress);

// Check the registration is actually done
Element registeredKey = getKeyFromResponse(response);
if (registeredKey == null) {
- logger.debug(glsAddress + " didn't return a
registration key, trying with another gLS");
+ logger.debug("{} didn't return a registration
key, trying with another gLS", glsAddress);
poolElement(glsAddresses);
} else {
// The element is registered
- logger.debug(glsAddress + " returned a valid
registration key, we store it");
+ logger.debug("{} returned a valid registration
key, we store it", glsAddress);
registeredKeys.add(registeredKey);
if (registeredKeys.size() ==
nrOfGLSRegistration) {
break;
}
}
} catch (PerfSONARException e) {
- logger.warn("Problem with sending registration
message to: " + glsAddress.toString());
+ logger.warn("Problem with sending registration
message to: {}", glsAddress.toString());
poolElement(glsAddresses);
}
nrOfGls--;

Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -157,7 +157,7 @@
logger.info("Successful eXist DB initialization.");
result = "ok=yes";
} catch (PerfSONARException e) {
- logger.warn("eXist DB initiliazation failed: " + e.getMessage());
+ logger.warn("eXist DB initiliazation failed: {}",
e.getMessage());
result = "ko";
}


Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/dao/MultipleFilesDAOImpl.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/dao/MultipleFilesDAOImpl.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/dao/MultipleFilesDAOImpl.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -49,21 +49,21 @@
try {
ser.write(os, m);
for (int i = 0; i < d.length; i++) {
- logger.trace("Serialize data: " + d[i]);
+ logger.trace("Serialize data: {}", d[i]);
ser.write(os, d[i]);
}
} catch (XMLStreamException e1) {
- logger.error("Cannot serialize elements: " + e1.getMessage());
+ logger.error("Cannot serialize elements: {}", e1.getMessage());
throw new PerfSONARException("error/parse", "Cannot serialize
elements: " + e1.getMessage());
} catch (IOException e1) {
- logger.error("Cannot serialize elements: " + e1.getMessage());
+ logger.error("Cannot serialize elements: {}", e1.getMessage());
throw new PerfSONARException("error/parse", "Cannot serialize
elements: " + e1.getMessage());
}
sb.append(LS_STORE_FOOTER);

// Create an md5 ID to identify the XML document and store it
String xmlFileName = md5(m.getId()) + ".xml";
- logger.debug("Now uploading XML file to the store: " + xmlFileName);
+ logger.debug("Now uploading XML file to the store: {}", xmlFileName);
uploadStoreFile(xmlFileName, sb.toString());

}
@@ -115,7 +115,7 @@

XMLDBResult res = performXQuery(xquery);
result = res.getResults().size();
- logger.debug(result + " files will be removed from the store");
+ logger.debug("{} files will be removed from the store", result);

// Then we remove the XML files in the store
for (Element e : res.getResults()) {
@@ -137,7 +137,7 @@
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
- logger.error("md5 algorithm not found: " + e.getMessage());
+ logger.error("md5 algorithm not found: {}", e.getMessage());
throw new PerfSONARException("md5 - algorithm not found", e);
}


Modified:
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/SummarizationBuilder.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/SummarizationBuilder.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/SummarizationBuilder.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -145,9 +145,9 @@
String[] keywordResults = dao.queryKeywordResults();

logger.debug("LSSummaryServiceContent.getAllServicesSummaries: got
summary from database. Number of: ");
- logger.debug("- IP: [" + ipResults.length + "]");
- logger.debug("- domains: [" + domainResults.length + "]");
- logger.debug("- eventvTypes: [" + eventTypeResults.length + "]");
+ logger.debug("- IP: [{}]", ipResults.length);
+ logger.debug("- domains: [{}]", domainResults.length);
+ logger.debug("- eventvTypes: [{}]", eventTypeResults.length);

populateSummary(summaries, ipResults, SummarizationVariableType.IP);
populateSummary(summaries, domainResults,
@@ -204,7 +204,7 @@
String[] params = line.split(",", 2);

if (params.length != 2) {
- logger.debug("suppressing line; invalid format(value='" +
line + "')");
+ logger.debug("suppressing line; invalid format
(value='{}')", line);
break;
}

@@ -246,7 +246,7 @@
.iterator();
while (i.hasNext()) {
Map.Entry<String, ServiceSummaryBean> e = i.next();
- logger.debug("\n==== " + e.getKey() + " ====\n");
+ logger.debug("\n==== {} ====\n", e.getKey());
logger.debug(e.getValue().toString());

}

Modified:
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/DataSourceComponentTest.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/DataSourceComponentTest.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/DataSourceComponentTest.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -43,7 +43,7 @@

// Check URL splitting
String url = dsc.getOption("url").getValue();
- logger.info("Extracted DB URL: " + url);
+ logger.info("Extracted DB URL: {}", url);
assertEquals(url, dsc.getUrl() + dsc.getMainCollection());
logger.info("•• existDataSource component is ok");
}

Modified:
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/ModificationCounterComponentTest.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/ModificationCounterComponentTest.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/ModificationCounterComponentTest.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -37,7 +37,7 @@
logger.info("•••• Testing ModificationCounterComponent");

// Incrementing and testing increment count
- logger.debug("Counting up to " + LOOP_COUNT);
+ logger.debug("Counting up to {}", LOOP_COUNT);
int last = 0;
for (int i = 0; i < LOOP_COUNT; i++) {
cp.incrementCounter();
@@ -67,7 +67,7 @@
* Multi-threaded test of the ModificationCounterComponent increment
*/
public void testThreadedCounterIncrement() throws InterruptedException {
- logger.info("•••• Testing threaded incrementation of
ModificationCounterComponent with " + THREADS_COUNT + " threads");
+ logger.info("•••• Testing threaded incrementation of
ModificationCounterComponent with {} threads", THREADS_COUNT);
AsynchTester[] testers = new AsynchTester[THREADS_COUNT];
cp.resetCounter();
cp.resetDiffsBetweenRegistrationCounter();
@@ -88,7 +88,7 @@
}
}
});
- logger.debug("Starting thread " + i + " and counting up to " +
LOOP_COUNT);
+ logger.debug("Starting thread {} and counting up to {}", i,
LOOP_COUNT);
testers[i].start();
}

@@ -106,7 +106,7 @@
* Multi-threaded test of the ModificationCounterComponent reset
*/
public void testThreadedCounterReset() throws InterruptedException {
- logger.info("•••• Testing threaded reset of
ModificationCounterComponent with " + THREADS_COUNT + " threads");
+ logger.info("•••• Testing threaded reset of
ModificationCounterComponent with {} threads", THREADS_COUNT);
AsynchTester[] testers = new AsynchTester[THREADS_COUNT];
// We reset the diffs counter
cp.resetDiffsBetweenRegistrationCounter();
@@ -127,7 +127,7 @@
assertTrue(cp.getDiffsBetweenRegistrationCounter() >=
LOOP_COUNT);
}
});
- logger.debug("Starting thread " + i + " and counting up to " +
LOOP_COUNT);
+ logger.debug("Starting thread {} and counting up to {}", i,
LOOP_COUNT);
testers[i].start();
}

@@ -145,7 +145,7 @@
* Multi-threaded test of the ModificationCounterComponent diffs reset
*/
public void testThreadedCounterDiffsReset() throws InterruptedException {
- logger.info("•••• Testing threaded diffs reset of
ModificationCounterComponent with " + THREADS_COUNT + " threads");
+ logger.info("•••• Testing threaded diffs reset of
ModificationCounterComponent with {} threads", THREADS_COUNT);
AsynchTester[] testers = new AsynchTester[THREADS_COUNT];
// We reset the counter
cp.resetCounter();
@@ -169,7 +169,7 @@
assertTrue(cp.getCounter() >= LOOP_COUNT);
}
});
- logger.debug("Starting thread " + i + " and counting up to " +
LOOP_COUNT);
+ logger.debug("Starting thread {} and counting up to {}", i,
LOOP_COUNT);
testers[i].start();
}


Modified:
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/XMLDBComponentTest.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/XMLDBComponentTest.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/components/XMLDBComponentTest.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -112,7 +112,7 @@
if (tryAgain) {
// We're not sure what happened, let's try again
try {
- logger.debug(name + ": Let's try to count again");
+ logger.debug("{}: Let's try to count again", name);
XMLDBResult result =
dbcomp.performXQuery("count(collection('/db/ls/store/')/a)");
count = Integer.valueOf(result.getFirstElement().getText());
} catch (PerfSONARException e) {
@@ -120,7 +120,7 @@
fail();
}
}
- logger.debug("Documents count: " + count);
+ logger.debug("Documents count: {}", count);
return count;
}

@@ -154,7 +154,7 @@
* The XQuery run is a simple count() on an existing collection
*/
public void testThreadedUpload() throws InterruptedException,
PerfSONARException {
- logger.info("•••• Testing threaded concurrent upload of files with "
+ THREADS_COUNT + " threads");
+ logger.info("•••• Testing threaded concurrent upload of files with
{} threads", THREADS_COUNT);

// Initializing and clearing the DB thanks to the servlet
ExistDbInitializerServlet servlet = new ExistDbInitializerServlet();
@@ -197,7 +197,7 @@
assertTrue(newCount > docsCount);
docsCount = newCount;
}
- logger.info(name + ": " + docsCount + " documents
present in DB");
+ logger.info("{}: {} documents present in DB", name,
docsCount);
}
});
testers[i].start();

Modified:
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/dao/MultipleFilesDAOImplTests.java
===================================================================
---
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/dao/MultipleFilesDAOImplTests.java
2013-05-31 16:42:52 UTC (rev 6429)
+++
trunk/perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/dao/MultipleFilesDAOImplTests.java
2013-05-31 16:44:18 UTC (rev 6430)
@@ -180,7 +180,7 @@
logger.error("Our count() XQuery returned an error: " +
ex.getMessage());
}

- logger.debug(count + " documents found!");
+ logger.debug("{} documents found!", count);
return count;
}
}



  • [pS-dev] [GEANT/SA2/ps-java-services] r6430 - in trunk: . perfsonar-base/base/src/main/java/net/gean t/perfsonar/response perfsonar-base/ls/src/main/java/net/g eant/perfsonar/ls perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/authn perfsonar-java-base2/src/main /java/org/perfsonar/base2/service/authn/component/wssec pe rfsonar-java-base2/src/main/java/org/perfsonar/base2/servi ce/axis2interface perfsonar-java-base2/src/main/java/org/p erfsonar/base2/service/configuration perfsonar-java-base2/ src/main/java/org/perfsonar/base2/service/configuration/mi gration perfsonar-java-base2/src/main/java/org/perfsonar/b ase2/service/messages perfsonar-java-base2/src/main/java/o rg/perfsonar/base2/service/registration perfsonar-java-bas e2/src/main/java/org/perfsonar/base2/service/requesthandle r perfsonar-java-base2/src/main/java/org/perfsonar/base2/s ervice/requesthandler/axis2 perfsonar-java-base2/src/main/ java/org/perfsonar/base2/service/scheduler perfsonar-java- base2/src/main/java/ org/perfsonar/base2/service/scheduler /singleThread perfsonar-java-base2/src/main/java/org/perfs onar/base2/service/storage/xml perfsonar-java-base2/src/ma in/java/org/perfsonar/base2/servlets perfsonar-java-base2/ src/main/java/org/perfsonar/test perfsonar-java-rrd-ma per fsonar-java-rrd-ma/soapUI perfsonar-java-rrd-ma/src/main/j ava/org/perfsonar/service/measurementArchive/rrdType perfs onar-java-rrd-ma/src/main/java/org/perfsonar/service/measu rementArchive/rrdType/storage/rrd perfsonar-java-rrd-ma/sr c/main/java/org/perfsonar/service/measurementArchive/rrdTy pe/storage/sql/query perfsonar-java-rrd-ma/src/main/java/o rg/perfsonar/service/measurementArchive/servlets perfsonar -java-xml-ls/soapUI perfsonar-java-xml-ls/src/main/java/or g/perfsonar/service/lookupservice perfsonar-java-xml-ls/sr c/main/java/org/perfsonar/service/lookupservice/components perfsonar-java-xml-ls/src/main/java/org/perfsonar/service /lookupservice/schedulerActions perfsonar-java-xml-ls/src/ main/java/org/perfsonar/ service/lookupservice/servlets pe rfsonar-java-xml-ls/src/main/java/org/perfsonar/service/lo okupservice/storage/exist/dao perfsonar-java-xml-ls/src/ma in/java/org/perfsonar/service/lookupservice/summarization perfsonar-java-xml-ls/src/test/java/org/perfsonar/tests/co mponents perfsonar-java-xml-ls/src/test/java/org/perfsonar /tests/dao, svn-noreply, 05/31/2013

Archive powered by MHonArc 2.6.16.

Top of Page