Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5969 - in trunk/perfsonar-java-rrd-ma-SQL_backend: . src/ma in/java/org/perfsonar/service/measurementArchive/rrdType s rc/main/java/org/perfsonar/service/measurementArchive/rrdT ype/storage/exist src/main/java/org/perfsonar/service/meas urementArchive/rrdType/storage/persistence src/main/java/o rg/perfsonar/service/measurementArchive/rrdType/storage/sq l/query

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r5969 - in trunk/perfsonar-java-rrd-ma-SQL_backend: . src/ma in/java/org/perfsonar/service/measurementArchive/rrdType s rc/main/java/org/perfsonar/service/measurementArchive/rrdT ype/storage/exist src/main/java/org/perfsonar/service/meas urementArchive/rrdType/storage/persistence src/main/java/o rg/perfsonar/service/measurementArchive/rrdType/storage/sq l/query


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5969 - in trunk/perfsonar-java-rrd-ma-SQL_backend: . src/ma in/java/org/perfsonar/service/measurementArchive/rrdType s rc/main/java/org/perfsonar/service/measurementArchive/rrdT ype/storage/exist src/main/java/org/perfsonar/service/meas urementArchive/rrdType/storage/persistence src/main/java/o rg/perfsonar/service/measurementArchive/rrdType/storage/sq l/query
  • Date: Tue, 21 Aug 2012 11:48:09 +0100 (BST)

Author: nordunet.behrmann
Date: 2012-08-21 11:48:09 +0100 (Tue, 21 Aug 2012)
New Revision: 5969

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml

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

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

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

trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/ExistMetadataStorageDAOImpl.java

trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/QueryGeneratorManager.java

trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/MetadaKeyResponse.java

trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/SetupDataKeyResponse.java

trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
Log:
perfsonar-java-rrd-ma-SQL_backend: Use slf4j API

Rather than calling the log4j API directly, this patch updates the
code to use slf4j. This decouples the code from the logging library.

Modified: trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml
===================================================================
--- trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml 2012-08-21 10:48:08
UTC (rev 5968)
+++ trunk/perfsonar-java-rrd-ma-SQL_backend/pom.xml 2012-08-21 10:48:09
UTC (rev 5969)
@@ -237,13 +237,13 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.6.1</version>
+ <version>1.6.4</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.6.1</version>
+ <version>1.6.4</version>
</dependency>

<dependency>

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/EchoServiceEngine.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/EchoServiceEngine.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/EchoServiceEngine.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -20,7 +20,8 @@
import
org.perfsonar.service.measurementArchive.rrdType.storage.DataStorageDAOFactory;

import java.util.Collection;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* $Id$
@@ -31,7 +32,7 @@
// ------------------------------------------------------------- class
fields


- private static final Logger logger =
Logger.getLogger(EchoServiceEngine.class.getName());
+ private static final Logger logger =
LoggerFactory.getLogger(EchoServiceEngine.class);

public static final String ECHO_RANDOM_FETCH_TEST =
"http://schemas.perfsonar.net/tools/admin/selftest/1.0/random-fetch-test";;
public static final String ECHO_XMLDB_ACCESS_TEST =
"http://schemas.perfsonar.net/tools/admin/selftest/1.0/xmldb-access-test";;

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/MetadataKeyMessageHandler.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -12,7 +12,8 @@
import java.util.List;
import java.util.Map;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.perfsonar.base2.service.authn.component.AuthNComponent;
import org.perfsonar.base2.service.configuration.Configuration;
import org.perfsonar.base2.service.configuration.ConfigurationManager;
@@ -38,7 +39,7 @@
public class MetadataKeyMessageHandler implements MessageHandler {


- private static final Logger logger =
Logger.getLogger(MetadataKeyMessageHandler.class.getName());
+ private static final Logger logger =
LoggerFactory.getLogger(MetadataKeyMessageHandler.class);


public MetadataKeyMessageHandler() throws PerfSONARException {
@@ -138,9 +139,9 @@
} catch (RuntimeException rex) {
//just in case of unexpected runtime exception such as
//null, indexoutofbounds, classcast, etc.
- logger.error(rex,rex);
+ logger.error("Service engine failed", rex);
throw new PerfSONARException(
- "runtime_exception", "Runtime exception in
ServiceEngine: "+rex.getMessage());
+ "runtime_exception", "Runtime exception in
ServiceEngine: "+rex.getMessage(), rex);
}
} catch (PerfSONARException e) {


Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -21,7 +21,8 @@
import java.util.HashMap;
import java.util.Map;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* $Id: SetupDataServiceEngine.java 4684 2008-11-03 13:07:33Z roman $
@@ -34,7 +35,7 @@

protected static final String SELECT_NAMESPACE =
"http://ggf.org/ns/nmwg/ops/select/2.0";;

- private static final Logger logger =
Logger.getLogger(SetupDataServiceEngine.class.getName());
+ private static final Logger logger =
LoggerFactory.getLogger(SetupDataServiceEngine.class);


// ------------------------------------------------------------- methods
@@ -103,8 +104,7 @@
}


- logger.debug("ResponseToString");
- logger.debug(response);
+ logger.debug("Response: {}", response);
serviceResponse.setElement(response);
}


Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/ExistMetadataStorageDAOImpl.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/ExistMetadataStorageDAOImpl.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/ExistMetadataStorageDAOImpl.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -21,7 +21,8 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* $Id: ExistMetadataStorageDAOImpl.java 4684 2008-11-03 13:07:33Z roman $
@@ -32,7 +33,7 @@
// ------------------------------------------------------------- class
fields


- private static final Logger logger =
Logger.getLogger(ExistMetadataStorageDAOImpl.class.getName());
+ private static final Logger logger =
LoggerFactory.getLogger(ExistMetadataStorageDAOImpl.class);

private XMLDataStorage dataStorage = null;
private String dataCollection = null;

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/QueryGeneratorManager.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/QueryGeneratorManager.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/exist/QueryGeneratorManager.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -1,7 +1,8 @@
package org.perfsonar.service.measurementArchive.rrdType.storage.exist;


-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

import org.perfsonar.base2.service.configuration.Component;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
@@ -20,7 +21,7 @@
// ----------------------------------------------------------- Variables


- protected static final Logger logger =
Logger.getLogger(QueryGeneratorManager.class.getName());
+ protected static final Logger logger =
LoggerFactory.getLogger(QueryGeneratorManager.class);


// -------------------------------------------------------------
constructor

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/MetadaKeyResponse.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/MetadaKeyResponse.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/MetadaKeyResponse.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -2,7 +2,8 @@

import java.util.Iterator;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
import
org.perfsonar.service.measurementArchive.rrdType.storage.persistence.entity.Interfaces;

@@ -13,7 +14,7 @@
*/
public class MetadaKeyResponse {

- private static final Logger logger =
Logger.getLogger(MetadaKeyResponse.class.getName());
+ private static final Logger logger =
LoggerFactory.getLogger(MetadaKeyResponse.class);

private final String EVENT_TYPE_UTIL =
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/";;
private final String EVENT_TYPE_ERRORS =
"http://ggf.org/ns/nmwg/characteristic/errors/2.0/";;

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/SetupDataKeyResponse.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/SetupDataKeyResponse.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/persistence/SetupDataKeyResponse.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -4,7 +4,8 @@
import java.util.Collection;
import java.util.Iterator;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
import org.perfsonar.base2.xml.Element;
import org.perfsonar.base2.xml.nmwg.Data;
@@ -28,7 +29,7 @@
private final String NAMESPACE_ERRORS =
"http://ggf.org/ns/nmwg/characteristic/errors/2.0/";;
private final String NAMESPACE_DISCARDS =
"http://ggf.org/ns/nmwg/characteristic/discards/2.0/";;

- protected static final Logger logger =
Logger.getLogger(SetupDataKeyResponse.class.getName());
+ protected static final Logger logger =
LoggerFactory.getLogger(SetupDataKeyResponse.class);


public Collection<Element> fetchElements(Iterator iterator) throws
PerfSONARException{

Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
2012-08-21 10:48:08 UTC (rev 5968)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/query/QueryGenerator.java
2012-08-21 10:48:09 UTC (rev 5969)
@@ -7,7 +7,8 @@
import javax.persistence.Query;

import org.perfsonar.base2.xml.nmwg.EventType;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
import org.perfsonar.base2.xml.Element;
import org.perfsonar.base2.xml.nmwg.Metadata;
@@ -23,7 +24,7 @@
*/
public class QueryGenerator {

- protected static final Logger logger =
Logger.getLogger(QueryGeneratorManager.class.getName());
+ protected static final Logger logger =
LoggerFactory.getLogger(QueryGeneratorManager.class);


public Query getQuery(EntityManager em, Metadata metadata, String
tableName) throws PerfSONARException{



  • [pS-dev] [GEANT/SA2/ps-java-services] r5969 - in trunk/perfsonar-java-rrd-ma-SQL_backend: . src/ma in/java/org/perfsonar/service/measurementArchive/rrdType s rc/main/java/org/perfsonar/service/measurementArchive/rrdT ype/storage/exist src/main/java/org/perfsonar/service/meas urementArchive/rrdType/storage/persistence src/main/java/o rg/perfsonar/service/measurementArchive/rrdType/storage/sq l/query, svn-noreply, 08/21/2012

Archive powered by MHonArc 2.6.16.

Top of Page