diff options
Diffstat (limited to 'STALService')
4 files changed, 38 insertions, 33 deletions
diff --git a/STALService/pom.xml b/STALService/pom.xml index 7c3ff682..2f1e3ed4 100644 --- a/STALService/pom.xml +++ b/STALService/pom.xml @@ -1,26 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> - <artifactId>bku</artifactId> + <artifactId>mocca</artifactId> <groupId>at.gv.egiz</groupId> - <version>1.2.14-SNAPSHOT</version> + <version>1.3.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>at.gv.egiz</groupId> <artifactId>STALService</artifactId> <name>STAL Service</name> - <version>1.2.14-SNAPSHOT</version> + <version>${project.parent.version}</version> <description /> <dependencies> <dependency> <groupId>at.gv.egiz</groupId> <artifactId>STAL</artifactId> - <version>1.2.14-SNAPSHOT</version> + <version>${project.parent.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> </dependency> - <!--dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>utils</artifactId> - <version>1.0.0-SNAPSHOTOT</version> - </dependency--> </dependencies> </project>
\ No newline at end of file diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java index ba4b541e..ae0e77d3 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java @@ -3,7 +3,6 @@ package at.gv.egiz.stal.service; import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; @@ -24,7 +23,6 @@ public class STALService { // private final static URL STALSERVICE_WSDL_LOCATION; - private final static Logger logger = Logger.getLogger(at.gv.egiz.stal.service.STALService.class.getName()); // static { // URL url = null; diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java index 1e6f4133..88a6fa4c 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java @@ -16,6 +16,16 @@ */ package at.gv.egiz.stal.service.translator; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.JAXBElement; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import at.gv.egiz.stal.ErrorResponse; import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.InfoboxReadResponse; @@ -37,13 +47,6 @@ import at.gv.egiz.stal.service.types.SignRequestType; import at.gv.egiz.stal.service.types.SignResponseType; import at.gv.egiz.stal.service.types.StatusRequestType; import at.gv.egiz.stal.service.types.StatusResponseType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.JAXBElement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * @@ -51,8 +54,8 @@ import org.apache.commons.logging.LogFactory; */ public class STALTranslator { - private static final Log log = LogFactory.getLog(STALTranslator.class); - protected Map<Class, TranslationHandler> handlerMap = new HashMap<Class, TranslationHandler>(); + private final Logger log = LoggerFactory.getLogger(STALTranslator.class); + protected Map<Class<?>, TranslationHandler> handlerMap = new HashMap<Class<?>, TranslationHandler>(); public STALTranslator() { registerTranslationHandler(new DefaultTranslationHandler()); @@ -63,9 +66,9 @@ public class STALTranslator { * @param handler */ public void registerTranslationHandler(TranslationHandler handler) { - for (Class t : handler.getSupportedTypes()) { - if (log.isDebugEnabled()) { - log.debug("register " + t + " with translation handler " + handler.getClass()); + for (Class<?> t : handler.getSupportedTypes()) { + if (log.isTraceEnabled()) { + log.trace("Register {} with translation handler {}.", t, handler.getClass()); } handlerMap.put(t, handler); } @@ -85,7 +88,7 @@ public class STALTranslator { return r; } } - log.error("unknown STAL request type " + request.getClass()); + log.error("Unknown STAL request type {}.", request.getClass()); throw new TranslationException(request.getClass()); } @@ -107,7 +110,7 @@ public class STALTranslator { return stalRequest; } } - log.error("unknown request type " + req.getClass()); + log.error("Unknown request type {}.", req.getClass()); throw new TranslationException(req.getClass()); } @@ -125,7 +128,7 @@ public class STALTranslator { return r; } } - log.error("unknown STAL response type " + response.getClass()); + log.error("Unknown STAL response type {}.", response.getClass()); throw new TranslationException(response.getClass()); } @@ -147,7 +150,7 @@ public class STALTranslator { return stalResponse; } } - log.error("unknown response type " + resp.getClass()); + log.error("Unknown response type {}.", resp.getClass()); throw new TranslationException(resp.getClass()); } @@ -156,7 +159,7 @@ public class STALTranslator { */ public static interface TranslationHandler { - List<Class> getSupportedTypes(); + List<Class<?>> getSupportedTypes(); JAXBElement<? extends RequestType> translate(STALRequest request) throws TranslationException; @@ -173,7 +176,7 @@ public class STALTranslator { */ protected static class DefaultTranslationHandler implements TranslationHandler { - private static final Log log = LogFactory.getLog(DefaultTranslationHandler.class); + private final Logger log = LoggerFactory.getLogger(DefaultTranslationHandler.class); private ObjectFactory of; public DefaultTranslationHandler() { @@ -181,8 +184,8 @@ public class STALTranslator { } @Override - public List<Class> getSupportedTypes() { - return Arrays.asList(new Class[]{InfoboxReadRequest.class, + public List<Class<?>> getSupportedTypes() { + return Arrays.asList(new Class<?>[]{InfoboxReadRequest.class, SignRequest.class, QuitRequest.class, StatusRequest.class, diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/translator/TranslationException.java b/STALService/src/main/java/at/gv/egiz/stal/service/translator/TranslationException.java index fd9da988..5fe3735b 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/translator/TranslationException.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/translator/TranslationException.java @@ -22,13 +22,18 @@ package at.gv.egiz.stal.service.translator; */ public class TranslationException extends Exception { - private Class unknownClass; + /** + * + */ + private static final long serialVersionUID = 1L; + + private Class<?> unknownClass; /** * Creates a new instance of <code>TranslationException</code> without detail message. * @param unknownClass the class that could not be translated */ - public TranslationException(Class unkownClass) { + public TranslationException(Class<?> unkownClass) { this.unknownClass = unkownClass; } |