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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
DISPATCHER_SESSION_KEY
-
-
Constructor Details
-
EventDispatcherFactory
public EventDispatcherFactory()
-
-
Method Details
-
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.
-