Class EventDispatcher
- java.lang.Object
-
- org.jenkinsci.plugins.ssegateway.sse.EventDispatcher
-
- All Implemented Interfaces:
Serializable
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public abstract class EventDispatcher extends Object implements Serializable
- Author:
- tom.fennelly@gmail.com
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventDispatcher.SSEHttpSessionListener
Http session listener.
-
Field Summary
Fields Modifier and Type Field Description static long
RETRY_QUEUE_EVENT_LIFETIME
static long
RETRY_QUEUE_PROCESSING_DELAY
static String
SESSION_SYNC_OBJ
static long
TIMEOUT_DISPATCHERFAIL
-
Constructor Summary
Constructors Constructor Description EventDispatcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
dispatchEvent(String name, String data)
Writes a message toHttpServletResponse
String
getId()
abstract javax.servlet.http.HttpServletResponse
getResponse()
Map<org.jenkinsci.plugins.pubsub.EventFilter,org.jenkinsci.plugins.pubsub.ChannelSubscriber>
getSubscribers()
protected User
getUser()
void
setId(String id)
abstract void
start(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
stop()
boolean
subscribe(org.jenkinsci.plugins.pubsub.EventFilter filter)
String
toString()
boolean
unsubscribe(org.jenkinsci.plugins.pubsub.EventFilter filter)
void
unsubscribeAll()
-
-
-
Field Detail
-
SESSION_SYNC_OBJ
public static final String SESSION_SYNC_OBJ
- See Also:
- Constant Field Values
-
RETRY_QUEUE_EVENT_LIFETIME
public static long RETRY_QUEUE_EVENT_LIFETIME
-
RETRY_QUEUE_PROCESSING_DELAY
public static long RETRY_QUEUE_PROCESSING_DELAY
-
TIMEOUT_DISPATCHERFAIL
public static long TIMEOUT_DISPATCHERFAIL
-
-
Method Detail
-
start
public abstract void start(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
getResponse
public abstract javax.servlet.http.HttpServletResponse getResponse()
-
getSubscribers
public Map<org.jenkinsci.plugins.pubsub.EventFilter,org.jenkinsci.plugins.pubsub.ChannelSubscriber> getSubscribers()
-
getId
public final String getId()
-
setId
public void setId(String id)
-
dispatchEvent
public boolean dispatchEvent(String name, String data) throws IOException, javax.servlet.ServletException
Writes a message toHttpServletResponse
- Parameters:
name
- event-namedata
- event-data- Returns:
- false if the response is not writable
- Throws:
IOException
- io-exceptionjavax.servlet.ServletException
- servlet-exception
-
stop
public void stop()
-
subscribe
public boolean subscribe(@NonNull org.jenkinsci.plugins.pubsub.EventFilter filter)
-
getUser
protected User getUser()
-
unsubscribe
public boolean unsubscribe(@NonNull org.jenkinsci.plugins.pubsub.EventFilter filter)
-
unsubscribeAll
public void unsubscribeAll()
-
-