Class EventDispatcherFactory
- java.lang.Object
-
- org.jenkinsci.plugins.ssegateway.sse.EventDispatcherFactory
-
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class EventDispatcherFactory extends Object
- Author:
- tom.fennelly@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static String
DISPATCHER_SESSION_KEY
-
Constructor Summary
Constructors Constructor Description EventDispatcherFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EventDispatcher
getDispatcher(String dispatcherId, javax.servlet.http.HttpSession session)
Get the specifiedEventDispatcher
instance from theHttpSession
.static Map<String,EventDispatcher>
getDispatchers(javax.servlet.http.HttpSession session)
Get the sessionEventDispatcher
s from theHttpSession
.static EventDispatcher
newDispatcher(String clientId, javax.servlet.http.HttpSession session)
Create a newEventDispatcher
instance and attach it to the user session.static EventDispatcher
start(String clientId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
-
-
Field Detail
-
DISPATCHER_SESSION_KEY
public static final String DISPATCHER_SESSION_KEY
-
-
Method Detail
-
start
public static EventDispatcher start(@Nonnull String clientId, @Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response)
-
getDispatchers
public static Map<String,EventDispatcher> getDispatchers(@Nonnull javax.servlet.http.HttpSession session)
Get the sessionEventDispatcher
s from theHttpSession
.- Parameters:
session
- TheHttpSession
.- Returns:
- The session
EventDispatcher
s.
-
newDispatcher
public static EventDispatcher newDispatcher(@Nonnull String clientId, @Nonnull javax.servlet.http.HttpSession session)
Create a newEventDispatcher
instance and attach it to the user session.- Parameters:
clientId
- The dispatcher client Id.session
- TheHttpSession
.- Returns:
- The new
EventDispatcher
instance.
-
getDispatcher
@CheckForNull public static EventDispatcher getDispatcher(@Nonnull String dispatcherId, @Nonnull javax.servlet.http.HttpSession session)
Get the specifiedEventDispatcher
instance from theHttpSession
.- Parameters:
dispatcherId
- The dispatcher ID.session
- TheHttpSession
.- Returns:
- The
EventDispatcher
, ornull
if no such dispatcher is known.
-
-