devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wk...@apache.org
Subject svn commit: r1656374 - in /devicemap/trunk: devicemap/java/simpleddr/ devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/ devicemap/java/simpleddr/...
Date Sun, 01 Feb 2015 23:14:19 GMT
Author: wkeil
Date: Sun Feb  1 23:14:18 2015
New Revision: 1656374

URL: http://svn.apache.org/r1656374
Log:
DMAP-118: Replace SLF4J/JUL/System.out with Log4J 2 

Task-Url: https://issues.apache.org/jira/browse/DMAP-118
DMAP-49: W3C integration 

Task-Url: https://issues.apache.org/jira/browse/DMAP-49

Added:
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/DDRService.java
      - copied, changed from r1650192, devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRService.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/VocabularyService.java
      - copied, changed from r1650192, devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRVocabularyService.java
    devicemap/trunk/devicemap/java/simpleddr/src/test/java/test/DDRTestRunner.java
Removed:
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRService.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRVocabularyService.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/vocabulary/
Modified:
    devicemap/trunk/devicemap/java/simpleddr/pom.xml
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/AndroidDeviceBuilder.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/BrowserDatasourceHandler.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/DeviceDatasourceHandler.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/OperatingSystemDatasourceHandler.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/BrowserIdentificator.java
    devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/OSIdentificator.java
    devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.devicemap.properties
    devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.test.properties
    devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
    devicemap/trunk/examples/ddr-service/src/main/java/org/apache/devicemap/simpleddr/web/filter/IdentificationFilter.java

Modified: devicemap/trunk/devicemap/java/simpleddr/pom.xml
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/pom.xml?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/pom.xml (original)
+++ devicemap/trunk/devicemap/java/simpleddr/pom.xml Sun Feb  1 23:14:18 2015
@@ -195,14 +195,6 @@
 			<artifactId>commons-jexl</artifactId>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.logging.log4j</groupId>
-			<artifactId>log4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.logging.log4j</groupId>
-			<artifactId>log4j-core</artifactId>
-		</dependency>
-		<dependency>
 			<groupId>commons-lang</groupId>
 			<artifactId>commons-lang</artifactId>
 		</dependency>

Copied: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/DDRService.java
(from r1650192, devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRService.java)
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/DDRService.java?p2=devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/DDRService.java&p1=devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRService.java&r1=1650192&r2=1656374&rev=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRService.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/DDRService.java
Sun Feb  1 23:14:18 2015
@@ -64,9 +64,10 @@ import org.apache.devicemap.simpleddr.mo
 import org.apache.devicemap.simpleddr.model.os.OperatingSystem;
 import org.apache.devicemap.simpleddr.model.vocabulary.Vocabulary;
 import org.apache.devicemap.simpleddr.model.vocabulary.VocabularyProperty;
-import org.apache.devicemap.simpleddr.vocabulary.VocabularyHolder;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 import org.w3c.ddr.simple.Evidence;
 import org.w3c.ddr.simple.PropertyName;
 import org.w3c.ddr.simple.PropertyRef;
@@ -77,7 +78,12 @@ import org.w3c.ddr.simple.exception.Init
 import org.w3c.ddr.simple.exception.NameException;
 import org.xml.sax.SAXException;
 
-public class ODDRService implements Service {
+/**
+ * 
+ * @author Werner Keil
+ *
+ */
+public class DDRService implements Service {
 
     public static final String ASPECT_DEVICE = "device";
     public static final String ASPECT_WEB_BROWSER = "webBrowser";
@@ -97,8 +103,8 @@ public class ODDRService implements Serv
     public static final String ODDR_UA_OPERATINGSYSTEM_DATASOURCE_STREAM_PROP = "oddr.ua.operatingSystem.datasource.stream";
     public static final String ODDR_THRESHOLD_PROP = "oddr.threshold";
     public static final String ODDR_VOCABULARY_IRI = "oddr.vocabulary.device";
-    private static final String ODDR_API_VERSION = "1.0.0-SNAPSHOT";
-    private static final String ODDR_DATA_VERSION = "1.0.2-SNAPSHOT";
+    private static final String ODDR_API_VERSION = "1.1.0-SNAPSHOT";
+    private static final String ODDR_DATA_VERSION = "1.0.2-SNAPSHOT"; // TODO add actual
discovery from XML
     public static final int ODDR_DEFAULT_THRESHOLD = 70;
     private String defaultVocabularyIRI = null;
     private DeviceIdentificator deviceIdentificator = null;
@@ -108,7 +114,7 @@ public class ODDRService implements Serv
     private int threshold = ODDR_DEFAULT_THRESHOLD;
     private static final String GROUP_REGEXPR = "\\$([^ ]+)";
     private Pattern groupRegexprPattern = Pattern.compile(GROUP_REGEXPR);
-    protected final Logger logger = LogManager.getLogger(getClass());
+    protected final Logger logger = Logger.getLogger(getClass().getName());
 
     public void initialize(String defaultVocabularyIRI, Properties prprts) throws NameException,
InitializationException {
         if (defaultVocabularyIRI == null || defaultVocabularyIRI.trim().length() == 0) {
@@ -116,7 +122,7 @@ public class ODDRService implements Serv
         }
 
         /*Initializing VocabularyHolder*/
-        ODDRVocabularyService oddrVocabularyService = new ODDRVocabularyService();
+        VocabularyService oddrVocabularyService = new VocabularyService();
         oddrVocabularyService.initialize(prprts);
 
         vocabularyHolder = oddrVocabularyService.getVocabularyHolder();
@@ -263,7 +269,7 @@ public class ODDRService implements Serv
             stream.close();
 
         } catch (IOException ex) {
-            logger.warn("", ex);
+            logger.log(Level.WARNING, "", ex);
         }
 
         deviceDatasourceHandler.setPatching(true);
@@ -293,7 +299,7 @@ public class ODDRService implements Serv
                     stream.close();
 
                 } catch (IOException ex) {
-                    logger.warn("", ex);
+                    logger.log(Level.WARNING, "", ex);
                 }
             }
         } else {
@@ -312,7 +318,7 @@ public class ODDRService implements Serv
                     try {
                         stream.close();
                     } catch (IOException ie) {
-                        logger.warn("", ie);
+                        logger.log(Level.WARNING, "", ie);
                     }
                     throw new InitializationException(InitializationException.INITIALIZATION_ERROR,
new IllegalStateException("Can not instantiate SAXParserFactory.newInstance().newSAXParser()"));
 
@@ -320,7 +326,7 @@ public class ODDRService implements Serv
                     try {
                         stream.close();
                     } catch (IOException ie) {
-                        logger.warn("", ie);
+                        logger.log(Level.WARNING, "", ie);
                     }
                     throw new InitializationException(InitializationException.INITIALIZATION_ERROR,
new IllegalStateException("Can not instantiate SAXParserFactory.newInstance().newSAXParser()"));
                 }
@@ -338,7 +344,7 @@ public class ODDRService implements Serv
                     stream.close();
 
                 } catch (IOException ex) {
-                    logger.warn("", ex);
+                    logger.log(Level.WARNING, "", ex);
                 }
             }
 
@@ -382,7 +388,7 @@ public class ODDRService implements Serv
             stream.close();
 
         } catch (IOException ex) {
-            logger.warn("", ex);
+            logger.log(Level.WARNING, "", ex);
         }
 
         if (oddrUaDeviceBuilderPatchStreams != null) {
@@ -410,7 +416,7 @@ public class ODDRService implements Serv
                     stream.close();
 
                 } catch (IOException ex) {
-                    logger.warn("", ex);
+                    logger.log(Level.WARNING, "", ex);
                 }
             }
 
@@ -430,7 +436,7 @@ public class ODDRService implements Serv
                     try {
                         stream.close();
                     } catch (IOException ie) {
-                        logger.warn("", ie);
+                        logger.log(Level.WARNING, "", ie);
                     }
                     throw new InitializationException(InitializationException.INITIALIZATION_ERROR,
new IllegalStateException("Can not instantiate SAXParserFactory.newInstance().newSAXParser()"));
 
@@ -438,7 +444,7 @@ public class ODDRService implements Serv
                     try {
                         stream.close();
                     } catch (IOException ie) {
-                        logger.warn("", ie);
+                        logger.log(Level.WARNING, "", ie);
                     }
                     throw new InitializationException(InitializationException.INITIALIZATION_ERROR,
new IllegalStateException("Can not instantiate SAXParserFactory.newInstance().newSAXParser()"));
                 }
@@ -454,7 +460,7 @@ public class ODDRService implements Serv
                 try {
                     stream.close();
                 } catch (IOException ex) {
-                    logger.warn("", ex);
+                    logger.log(Level.WARNING, "", ex);
                 }
             }
         }
@@ -496,7 +502,7 @@ public class ODDRService implements Serv
             stream.close();
 
         } catch (IOException ex) {
-            logger.warn("", ex);
+            logger.log(Level.WARNING, "", ex);
         }
 
         OperatingSystemDatasourceHandler operatingSystemDatasourceHandler = new OperatingSystemDatasourceHandler(vocabularyHolder);
@@ -535,7 +541,7 @@ public class ODDRService implements Serv
             stream.close();
 
         } catch (IOException ex) {
-            logger.warn("", ex);
+            logger.log(Level.WARNING, "", ex);
         }
         
         deviceIdentificator = new DeviceIdentificator(deviceBuilderHandler.getBuilders(),
deviceDatasourceHandler.getDevices());

Copied: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/VocabularyService.java
(from r1650192, devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRVocabularyService.java)
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/VocabularyService.java?p2=devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/VocabularyService.java&p1=devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRVocabularyService.java&r1=1650192&r2=1656374&rev=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/ODDRVocabularyService.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/VocabularyService.java
Sun Feb  1 23:14:18 2015
@@ -27,16 +27,22 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
+
 import org.apache.devicemap.simpleddr.documenthandler.VocabularyHandler;
 import org.apache.devicemap.simpleddr.model.vocabulary.Vocabulary;
-import org.apache.devicemap.simpleddr.vocabulary.VocabularyHolder;
 import org.w3c.ddr.simple.exception.InitializationException;
 import org.xml.sax.SAXException;
 
-public class ODDRVocabularyService {
+/**
+ * 
+ * @author Werner Keil
+ *
+ */
+public class VocabularyService {
 
     public static final String DDR_CORE_VOCABULARY_PATH_PROP = "ddr.vocabulary.core.path";
     public static final String ODDR_VOCABULARY_PATH_PROP = "oddr.vocabulary.path";
@@ -162,7 +168,7 @@ public class ODDRVocabularyService {
             stream.close();
 
         } catch (IOException ex) {
-            Logger.getLogger(ODDRService.class.getName()).log(Level.WARNING, null, ex);
+            Logger.getLogger(DDRService.class.getName()).log(Level.WARNING, null, ex);
         }
 
         parser = null;
@@ -197,7 +203,7 @@ public class ODDRVocabularyService {
             stream.close();
 
         } catch (IOException ex) {
-            Logger.getLogger(ODDRService.class.getName()).log(Level.WARNING, null, ex);
+            Logger.getLogger(DDRService.class.getName()).log(Level.WARNING, null, ex);
         }
 
         parser = null;

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/AndroidDeviceBuilder.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/AndroidDeviceBuilder.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/AndroidDeviceBuilder.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/builder/device/AndroidDeviceBuilder.java
Sun Feb  1 23:14:18 2015
@@ -19,6 +19,7 @@
 package org.apache.devicemap.simpleddr.builder.device;
 
 import static org.apache.devicemap.simpleddr.model.os.OperatingSystem.ANDROID;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -29,20 +30,25 @@ import java.util.regex.Pattern;
 
 import org.apache.devicemap.simpleddr.model.device.Device;
 import org.apache.devicemap.simpleddr.model.UserAgent;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
+/**
+ * 
+ * @author Werner Keil
+ *
+ */
 public class AndroidDeviceBuilder extends OrderedTokenDeviceBuilder {
 
     private static final String BUILD_HASH_REGEXP = ".*Build/([^ \\)\\(]*).*";
     private Pattern buildHashPattern = Pattern.compile(BUILD_HASH_REGEXP);
     private Map<String, Device> devices;
 //    private static final String[] FUZZY_TOKEN_REGEXPS = { "SM-T5\\d\\d" };
-    protected static final Logger logger = LogManager.getLogger(AndroidDeviceBuilder.class);
+    protected static final Logger logger = Logger.getLogger(AndroidDeviceBuilder.class.getName());
     
     public AndroidDeviceBuilder() {
         super();
-        logger.debug("Constructor");
+        logger.log(Level.FINE, "Constructor");
     }
 
     public boolean canBuild(UserAgent userAgent) {
@@ -55,7 +61,7 @@ public class AndroidDeviceBuilder extend
 
     public Device build(UserAgent userAgent, int confidenceTreshold) {
     	logger.info("Building");
-    	logger.debug("UA: " + userAgent.getCompleteUserAgent() + " :: A=" + userAgent.containsAndroid());
+    	logger.log(Level.FINE, "UA: " + userAgent.getCompleteUserAgent() + " :: A=" + userAgent.containsAndroid());
         final List<Device> foundDevices = new ArrayList<Device>();
         Iterator<String> it = orderedRules.keySet().iterator();
         while (it.hasNext()) {
@@ -63,7 +69,7 @@ public class AndroidDeviceBuilder extend
 //            logger.info("T: " + token);
             Device d = elaborateAndroidDeviceWithToken(userAgent, token);
             if (d != null) {
-            	logger.debug("Token: " + token);
+            	logger.log(Level.FINER, "Token: " + token);
                 if (d.getConfidence() > confidenceTreshold) {
                     return fixFromUserAgent(d, userAgent);
                 } else {

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/BrowserDatasourceHandler.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/BrowserDatasourceHandler.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/BrowserDatasourceHandler.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/BrowserDatasourceHandler.java
Sun Feb  1 23:14:18 2015
@@ -22,10 +22,11 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
-import org.apache.devicemap.simpleddr.ODDRService;
-import org.apache.devicemap.simpleddr.ODDRVocabularyService;
+
+import org.apache.devicemap.simpleddr.DDRService;
+import org.apache.devicemap.simpleddr.VocabularyHolder;
+import org.apache.devicemap.simpleddr.VocabularyService;
 import org.apache.devicemap.simpleddr.model.browser.Browser;
-import org.apache.devicemap.simpleddr.vocabulary.VocabularyHolder;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -62,7 +63,7 @@ public class BrowserDatasourceHandler ex
             }
         });
         try {
-            vocabularyHolder.existVocabulary(ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+            vocabularyHolder.existVocabulary(VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
             this.vocabularyHolder = vocabularyHolder;
 
         } catch (Exception ex) {
@@ -107,7 +108,7 @@ public class BrowserDatasourceHandler ex
 
         if (vocabularyHolder != null) {
             try {
-                vocabularyHolder.existProperty(propertyName, ODDRService.ASPECT_WEB_BROWSER,
ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+                vocabularyHolder.existProperty(propertyName, DDRService.ASPECT_WEB_BROWSER,
VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
                 properties.put(propertyName.intern(), propertyValue);
 
             } catch (Exception ex) {

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/DeviceDatasourceHandler.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/DeviceDatasourceHandler.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/DeviceDatasourceHandler.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/DeviceDatasourceHandler.java
Sun Feb  1 23:14:18 2015
@@ -20,10 +20,11 @@ package org.apache.devicemap.simpleddr.d
 
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.devicemap.simpleddr.ODDRService;
-import org.apache.devicemap.simpleddr.ODDRVocabularyService;
+
+import org.apache.devicemap.simpleddr.DDRService;
+import org.apache.devicemap.simpleddr.VocabularyHolder;
+import org.apache.devicemap.simpleddr.VocabularyService;
 import org.apache.devicemap.simpleddr.model.device.Device;
-import org.apache.devicemap.simpleddr.vocabulary.VocabularyHolder;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -56,7 +57,7 @@ public class DeviceDatasourceHandler ext
     public DeviceDatasourceHandler(Map devices, VocabularyHolder vocabularyHolder) {
         this.devices = devices;
         try {
-            vocabularyHolder.existVocabulary(ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+            vocabularyHolder.existVocabulary(VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
             this.vocabularyHolder = vocabularyHolder;
 
         } catch (Exception ex) {
@@ -112,7 +113,7 @@ public class DeviceDatasourceHandler ext
 
         if (vocabularyHolder != null) {
             try {
-                vocabularyHolder.existProperty(propertyName, ODDRService.ASPECT_DEVICE, ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+                vocabularyHolder.existProperty(propertyName, DDRService.ASPECT_DEVICE, VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
                 properties.put(propertyName.intern(), propertyValue);
 
             } catch (Exception ex) {

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/OperatingSystemDatasourceHandler.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/OperatingSystemDatasourceHandler.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/OperatingSystemDatasourceHandler.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/documenthandler/OperatingSystemDatasourceHandler.java
Sun Feb  1 23:14:18 2015
@@ -22,10 +22,11 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
-import org.apache.devicemap.simpleddr.ODDRService;
-import org.apache.devicemap.simpleddr.ODDRVocabularyService;
+
+import org.apache.devicemap.simpleddr.DDRService;
+import org.apache.devicemap.simpleddr.VocabularyHolder;
+import org.apache.devicemap.simpleddr.VocabularyService;
 import org.apache.devicemap.simpleddr.model.os.OperatingSystem;
-import org.apache.devicemap.simpleddr.vocabulary.VocabularyHolder;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -62,7 +63,7 @@ public class OperatingSystemDatasourceHa
             }
         });
         try {
-            vocabularyHolder.existVocabulary(ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+            vocabularyHolder.existVocabulary(VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
             this.vocabularyHolder = vocabularyHolder;
 
         } catch (Exception ex) {
@@ -107,7 +108,7 @@ public class OperatingSystemDatasourceHa
 
         if (vocabularyHolder != null) {
             try {
-                vocabularyHolder.existProperty(propertyName, ODDRService.ASPECT_OPERATIVE_SYSTEM,
ODDRVocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
+                vocabularyHolder.existProperty(propertyName, DDRService.ASPECT_OPERATIVE_SYSTEM,
VocabularyService.ODDR_LIMITED_VOCABULARY_IRI);
                 properties.put(propertyName.intern(), propertyValue);
 
             } catch (Exception ex) {

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/BrowserIdentificator.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/BrowserIdentificator.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/BrowserIdentificator.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/BrowserIdentificator.java
Sun Feb  1 23:14:18 2015
@@ -24,15 +24,20 @@ import org.apache.devicemap.simpleddr.bu
 import org.apache.devicemap.simpleddr.model.UserAgent;
 import org.apache.devicemap.simpleddr.model.UserAgentFactory;
 import org.apache.devicemap.simpleddr.model.browser.Browser;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.w3c.ddr.simple.Evidence;
 
+/**
+ * 
+ * @author Werner Keil
+ *
+ */
 public class BrowserIdentificator implements Identificator {
 
     private Builder[] builders;
     private Map<String, Browser> browserCapabilities;
-    protected static final Logger logger = LogManager.getLogger(BrowserIdentificator.class);
+    protected static final Logger logger = Logger.getLogger(BrowserIdentificator.class.getName());
 
     public BrowserIdentificator(Builder[] builders, Map<String, Browser> browserCapabilities)
{
         this.builders = builders;
@@ -84,8 +89,8 @@ public class BrowserIdentificator implem
         int idx = actualBrowserID.indexOf(".");
 
         if (idx < 0) {
-            logger.error("SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(1)");
-            logger.debug(actualBrowserID);
+            logger.log(Level.WARNING, "SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(1)");
+            logger.log(Level.FINE, actualBrowserID);
             return null;
 
         } else {
@@ -94,8 +99,8 @@ public class BrowserIdentificator implem
         idx = actualBrowserID.indexOf(".", idx);
 
         if (idx < 0) {
-            logger.error("SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(2)" + idx);
-            logger.debug(actualBrowserID);
+        	logger.log(Level.WARNING, "SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(2)"
+ idx);
+            logger.log(Level.FINE, actualBrowserID);
             return null;
 
         } else {

Modified: devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/OSIdentificator.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/OSIdentificator.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/OSIdentificator.java
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/main/java/org/apache/devicemap/simpleddr/identificator/OSIdentificator.java
Sun Feb  1 23:14:18 2015
@@ -24,15 +24,20 @@ import org.apache.devicemap.simpleddr.bu
 import org.apache.devicemap.simpleddr.model.UserAgent;
 import org.apache.devicemap.simpleddr.model.UserAgentFactory;
 import org.apache.devicemap.simpleddr.model.os.OperatingSystem;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.w3c.ddr.simple.Evidence;
 
+/**
+ * 
+ * @author Werner Keil
+ *
+ */
 public class OSIdentificator implements Identificator {
 
     private Builder[] builders;
     private Map<String, OperatingSystem> operatingSystemCapabilities;
-    protected final Logger logger = LogManager.getLogger(getClass());
+    protected final Logger logger = Logger.getLogger(getClass().getName());
 
     public OSIdentificator(Builder[] builders, Map<String, OperatingSystem> operatingSystemCapabilities)
{
         this.builders = builders;
@@ -81,8 +86,8 @@ public class OSIdentificator implements
         int idx = actualOperatingSystemID.indexOf(".");
 
         if (idx < 0) {
-            logger.error("SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(1)");
-            logger.debug(actualOperatingSystemID);
+            logger.log(Level.WARNING, "SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(1)");
+            logger.log(Level.FINER, actualOperatingSystemID);
             return null;
 
         } else {
@@ -91,8 +96,8 @@ public class OSIdentificator implements
         idx = actualOperatingSystemID.indexOf(".", idx);
 
         if (idx < 0) {
-            logger.error("SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(2)" + idx);
-            logger.debug(actualOperatingSystemID);
+            logger.log(Level.WARNING, "SHOULD NOT BE HERE, PLEASE CHECK BROWSER DOCUMENT(2)"
+ idx);
+            logger.log(Level.FINER, actualOperatingSystemID);
             return null;
 
         } else {

Added: devicemap/trunk/devicemap/java/simpleddr/src/test/java/test/DDRTestRunner.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/test/java/test/DDRTestRunner.java?rev=1656374&view=auto
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/test/java/test/DDRTestRunner.java (added)
+++ devicemap/trunk/devicemap/java/simpleddr/src/test/java/test/DDRTestRunner.java Sun Feb
 1 23:14:18 2015
@@ -0,0 +1,5 @@
+package test;
+
+public class DDRTestRunner {
+
+}

Modified: devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.devicemap.properties
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.devicemap.properties?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.devicemap.properties
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.devicemap.properties
Sun Feb  1 23:14:18 2015
@@ -1,5 +1,5 @@
 # Properties used to test the openddr module with our actual device data
-oddr.service.class=org.apache.devicemap.simpleddr.ODDRService
+oddr.service.class=org.apache.devicemap.simpleddr.DDRService
 
 oddr.ua.device.builder.path=${project.build.directory}/devicemap/devicedata/BuilderDataSource.xml
 oddr.ua.device.datasource.path=${project.build.directory}/devicemap/devicedata/DeviceDataSource.xml

Modified: devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.test.properties
URL: http://svn.apache.org/viewvc/devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.test.properties?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.test.properties
(original)
+++ devicemap/trunk/devicemap/java/simpleddr/src/test/resources/config/openddr.test.properties
Sun Feb  1 23:14:18 2015
@@ -1,5 +1,5 @@
 # Properties used to test the openddr module with a small test data set
-oddr.service.class=org.apache.devicemap.simpleddr.ODDRService
+oddr.service.class=org.apache.devicemap.simpleddr.DDRService
 
 oddr.ua.device.builder.path=${project.build.directory}/test-classes/openddr-test-data/TEST_BuilderDataSource.xml
 oddr.ua.device.datasource.path=${project.build.directory}/test-classes/openddr-test-data/TEST_DeviceDataSource.xml

Modified: devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
(original)
+++ devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
Sun Feb  1 23:14:18 2015
@@ -37,7 +37,7 @@ import org.w3c.ddr.simple.PropertyValues
 import org.w3c.ddr.simple.Service;
 import org.w3c.ddr.simple.ServiceFactory;
 import org.w3c.ddr.simple.exception.NameException;
-import org.apache.devicemap.simpleddr.ODDRService;
+import org.apache.devicemap.simpleddr.DDRService;
 import org.apache.devicemap.simpleddr.model.ODDRHTTPEvidence;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -66,7 +66,7 @@ public class IdentificationFilter implem
 	
 	    try {
 	        initializationProperties.load(context.getResourceAsStream("WEB-INF/classes/oddr.properties"));
-	        identificationService = ServiceFactory.newService("org.apache.devicemap.simpleddr.ODDRService",
initializationProperties.getProperty(ODDRService.ODDR_VOCABULARY_IRI), initializationProperties);
+	        identificationService = ServiceFactory.newService("org.apache.devicemap.simpleddr.DDRService",
initializationProperties.getProperty(DDRService.ODDR_VOCABULARY_IRI), initializationProperties);
 	    } catch (Exception ex) {
 	    	log.error(ex);
 	        throw new RuntimeException(ex);

Modified: devicemap/trunk/examples/ddr-service/src/main/java/org/apache/devicemap/simpleddr/web/filter/IdentificationFilter.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/ddr-service/src/main/java/org/apache/devicemap/simpleddr/web/filter/IdentificationFilter.java?rev=1656374&r1=1656373&r2=1656374&view=diff
==============================================================================
--- devicemap/trunk/examples/ddr-service/src/main/java/org/apache/devicemap/simpleddr/web/filter/IdentificationFilter.java
(original)
+++ devicemap/trunk/examples/ddr-service/src/main/java/org/apache/devicemap/simpleddr/web/filter/IdentificationFilter.java
Sun Feb  1 23:14:18 2015
@@ -31,7 +31,7 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.devicemap.simpleddr.ODDRService;
+import org.apache.devicemap.simpleddr.DDRService;
 import org.apache.devicemap.simpleddr.model.ODDRHTTPEvidence;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -56,7 +56,7 @@ public class IdentificationFilter implem
 
 	    try {
 	        initializationProperties.load(context.getResourceAsStream("/WEB-INF/classes/oddr.properties"));
-	        identificationService = ServiceFactory.newService("org.apache.devicemap.simpleddr.ODDRService",
initializationProperties.getProperty(ODDRService.ODDR_VOCABULARY_IRI), initializationProperties);
+	        identificationService = ServiceFactory.newService("org.apache.devicemap.simpleddr.DDRService",
initializationProperties.getProperty(DDRService.ODDR_VOCABULARY_IRI), initializationProperties);
 	
 	    } catch (Exception ex) {
 	        throw new RuntimeException(ex);



Mime
View raw message