// Path: server/src/main/java/com/cloudwise/sap/niping/filter/NiPingAuthFilter.java
// @Provider
// public class NiPingAuthFilter implements ContainerRequestFilter {
// 
//     private static final String attributeName = "niping";
// 
//     @Context
//     private HttpServletRequest httpServletRequest;
// 
//     @Override
//     public void filter(ContainerRequestContext requestContext) throws IOException {
//         final HttpSession session = httpServletRequest.getSession(false);
//         if (null == session || null == session.getAttribute(attributeName)) {
//             requestContext.abortWith(Response.seeOther(URI.create("/")).build());
//         }
//     }
// 
//     public static void setSession(HttpSession session, User user) {
//         session.setAttribute(attributeName, user);
//     }
// 
//     public static void removeSession(HttpSession session) {
//         session.removeAttribute(attributeName);
//     }
// 
//     public static User getUser(HttpSession session) {
//         return (User)(session.getAttribute(attributeName));
//     }
// 
//     public static String getAccountId(HttpSession session) {
//         return ((User)(session.getAttribute(attributeName))).getAccountId();
//     }
// }


import com.cloudwise.sap.niping.filter.NiPingAuthFilter;
import io.dropwizard.jersey.sessions.Session;
import javax.ws.rs.container.DynamicFeature;
import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.FeatureContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
package com.cloudwise.sap.niping.resource;



public class AuthFilterDynamicBinding implements DynamicFeature {

    @Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        Method method = resourceInfo.getResourceMethod();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (Annotation[] annotations : parameterAnnotations) {
            for (Annotation annotation : annotations) {
                if (annotation.annotationType().equals(Session.class) && !method.getName().startsWith("log")) {
// Path: server/src/main/java/com/cloudwise/sap/niping/filter/NiPingAuthFilter.java
// @Provider
// public class NiPingAuthFilter implements ContainerRequestFilter {
// 
//     private static final String attributeName = "niping";
// 
//     @Context
//     private HttpServletRequest httpServletRequest;
// 
//     @Override
//     public void filter(ContainerRequestContext requestContext) throws IOException {
//         final HttpSession session = httpServletRequest.getSession(false);
//         if (null == session || null == session.getAttribute(attributeName)) {
//             requestContext.abortWith(Response.seeOther(URI.create("/")).build());
//         }
//     }
// 
//     public static void setSession(HttpSession session, User user) {
//         session.setAttribute(attributeName, user);
//     }
// 
//     public static void removeSession(HttpSession session) {
//         session.removeAttribute(attributeName);
//     }
// 
//     public static User getUser(HttpSession session) {
//         return (User)(session.getAttribute(attributeName));
//     }
// 
//     public static String getAccountId(HttpSession session) {
//         return ((User)(session.getAttribute(attributeName))).getAccountId();
//     }
// }


// Path: server/src/main/java/com/cloudwise/sap/niping/resource/AuthFilterDynamicBinding.java
import com.cloudwise.sap.niping.filter.NiPingAuthFilter;
import io.dropwizard.jersey.sessions.Session;
import javax.ws.rs.container.DynamicFeature;
import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.FeatureContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

package com.cloudwise.sap.niping.resource;



public class AuthFilterDynamicBinding implements DynamicFeature {

    @Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        Method method = resourceInfo.getResourceMethod();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (Annotation[] annotations : parameterAnnotations) {
            for (Annotation annotation : annotations) {
                if (annotation.annotationType().equals(Session.class) && !method.getName().startsWith("log")) {
                    context.register(NiPingAuthFilter.class);