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);
}
}).protect(cf, null));
}
- public void init(C val) throws DBException {
+ public void init(C val) {
if (get() != null) {
return;
}
}
}).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);
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)
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;
}