edu.internet2.middleware.grouper.ws
Class GrouperServiceJ2ee

java.lang.Object
  extended by edu.internet2.middleware.grouper.ws.GrouperServiceJ2ee
All Implemented Interfaces:
javax.servlet.Filter

public class GrouperServiceJ2ee
extends java.lang.Object
implements javax.servlet.Filter

Extend the servlet to get user info

Author:
mchyzer

Constructor Summary
GrouperServiceJ2ee()
           
 
Method Summary
static void assignHttpServlet(javax.servlet.http.HttpServlet httpServlet)
          public method to get the http servlet
 void destroy()
          filter method
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)
           
 void init(javax.servlet.FilterConfig arg0)
          filter method
static java.lang.String parameterValue(java.util.Map<java.lang.String,java.lang.String[]> paramMap, javax.servlet.http.HttpServletRequest httpServletRequest, java.lang.String key)
          get a single parameter value for key.
static java.util.Map<java.lang.String,java.lang.Object> retrieveDebugMap()
           
static javax.servlet.http.HttpServlet retrieveHttpServlet()
          public method to get the http servlet
static javax.servlet.http.HttpServletRequest retrieveHttpServletRequest()
          public method to get the http servlet request
static javax.servlet.http.HttpServletResponse retrieveHttpServletResponse()
          public method to get the http servlet request
static long retrieveRequestStartMillis()
          if in request, get the start time
static Subject retrieveSubjectActAs(WsSubjectLookup actAsLookup)
          retrieve the subject to act as
static Subject retrieveSubjectLoggedIn()
          retrieve the subject logged in to web service If there are four colons, then this is the source and subjectId since overlap in namespace
static java.lang.String retrieveUserPrincipalNameFromRequest()
          retrieve the user principal (who is authenticated) from the (threadlocal) request object
static boolean wssecServlet()
          is this a wssec servlet? must have servlet init param
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrouperServiceJ2ee

public GrouperServiceJ2ee()
Method Detail

retrieveRequestStartMillis

public static long retrieveRequestStartMillis()
if in request, get the start time

Returns:
the start time

parameterValue

public static java.lang.String parameterValue(java.util.Map<java.lang.String,java.lang.String[]> paramMap,
                                              javax.servlet.http.HttpServletRequest httpServletRequest,
                                              java.lang.String key)
get a single parameter value for key. If multiple exist, throw error

Parameters:
paramMap - is the map of params. will get value from here if no request object
httpServletRequest - optional. if there, will make sure no dupes
key - to lookup
Returns:
the value

retrieveUserPrincipalNameFromRequest

public static java.lang.String retrieveUserPrincipalNameFromRequest()
retrieve the user principal (who is authenticated) from the (threadlocal) request object

Returns:
the user principal name

retrieveSubjectLoggedIn

public static Subject retrieveSubjectLoggedIn()
retrieve the subject logged in to web service If there are four colons, then this is the source and subjectId since overlap in namespace

Returns:
the subject

retrieveSubjectActAs

public static Subject retrieveSubjectActAs(WsSubjectLookup actAsLookup)
                                    throws WsInvalidQueryException
retrieve the subject to act as

Parameters:
actAsLookup - that the caller wants to act as
Returns:
the subject
Throws:
WsInvalidQueryException - if there is a problem

retrieveHttpServletRequest

public static javax.servlet.http.HttpServletRequest retrieveHttpServletRequest()
public method to get the http servlet request

Returns:
the http servlet request

retrieveHttpServlet

public static javax.servlet.http.HttpServlet retrieveHttpServlet()
public method to get the http servlet

Returns:
the http servlet

wssecServlet

public static boolean wssecServlet()
is this a wssec servlet? must have servlet init param

Returns:
true if wssec

assignHttpServlet

public static void assignHttpServlet(javax.servlet.http.HttpServlet httpServlet)
public method to get the http servlet

Parameters:
httpServlet - is servlet to assign

retrieveHttpServletResponse

public static javax.servlet.http.HttpServletResponse retrieveHttpServletResponse()
public method to get the http servlet request

Returns:
the http servlet request

destroy

public void destroy()
filter method

Specified by:
destroy in interface javax.servlet.Filter

retrieveDebugMap

public static java.util.Map<java.lang.String,java.lang.Object> retrieveDebugMap()
Returns:
the debug map

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain filterChain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

init

public void init(javax.servlet.FilterConfig arg0)
          throws javax.servlet.ServletException
filter method

Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException