diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/dbcapi/database/DBSingleton.java | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/onap/dmaap/dbcapi/database/DBSingleton.java b/src/main/java/org/onap/dmaap/dbcapi/database/DBSingleton.java index 9a34f58..2633d70 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/database/DBSingleton.java +++ b/src/main/java/org/onap/dmaap/dbcapi/database/DBSingleton.java @@ -34,7 +34,7 @@ public class DBSingleton<C> extends TableHandler<C> implements Singleton<C> { super(cf, cls, tabname, null); singleton = cls.newInstance(); } - public C get() throws DBException { + public C get() { return((new ConnWrapper<C, Object>() { protected C run(Object junk) throws Exception { ps = c.prepareStatement(getstmt); @@ -49,7 +49,7 @@ public class DBSingleton<C> extends TableHandler<C> implements Singleton<C> { } }).protect(cf, null)); } - public void init(C val) throws DBException { + public void init(C val) { if (get() != null) { return; } @@ -69,7 +69,7 @@ public class DBSingleton<C> extends TableHandler<C> implements Singleton<C> { } }).protect(cf, val); } - public void update(C val) throws DBException { + public void update(C val) { (new ConnWrapper<Void, C>() { protected Void run(C val) throws Exception { ps = c.prepareStatement(insorreplstmt); diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java index ab0e262..9dafb55 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java @@ -25,15 +25,15 @@ import java.io.IOException; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerRequestFilter; +import org.apache.log4j.Logger; import org.onap.dmaap.dbcapi.authentication.AuthenticationErrorException; import org.onap.dmaap.dbcapi.service.ApiService; -import org.onap.dmaap.dbcapi.util.DmaapConfig; @Authorization public class AuthorizationFilter implements ContainerRequestFilter { - + private Logger logger = Logger.getLogger(AuthorizationFilter.class.getName()); @Override public void filter(ContainerRequestContext requestContext) @@ -48,9 +48,11 @@ public class AuthorizationFilter implements ContainerRequestFilter { try { apiResp.checkAuthorization(); } catch ( AuthenticationErrorException ae ) { + logger.error("Error", ae); requestContext.abortWith( apiResp.unauthorized( apiResp.getErr().getMessage() ) ); return ; } catch ( Exception e ) { + logger.error("Error", e); requestContext.abortWith( apiResp.unavailable() ); return; } |