Package org.atmosphere.jersey
Class SuspendResponse.SuspendResponseBuilder<E>
java.lang.Object
com.sun.jersey.api.JResponse.AJResponseBuilder<E,SuspendResponse.SuspendResponseBuilder<E>>
org.atmosphere.jersey.SuspendResponse.SuspendResponseBuilder<E>
- Type Parameters:
E-
- Enclosing class:
SuspendResponse<E>
public static class SuspendResponse.SuspendResponseBuilder<E>
extends com.sun.jersey.api.JResponse.AJResponseBuilder<E,SuspendResponse.SuspendResponseBuilder<E>>
A Builder for
SuspendResponse-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<org.atmosphere.cpr.AtmosphereResourceEventListener> protected booleanprotected booleanprotected org.atmosphere.annotation.Suspend.SCOPEprotected SuspendResponse.TimeSpanFields inherited from class com.sun.jersey.api.JResponse.AJResponseBuilder
entity, headers, statusType -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Construct a shallow copy. -
Method Summary
Modifier and TypeMethodDescriptionaddListener(org.atmosphere.cpr.AtmosphereResourceEventListener e) AddAtmosphereResourceEventListenerbroadcaster(org.atmosphere.cpr.Broadcaster broadcaster) Set theBroadcasterbuild()Build theSuspendResponseoutputComments(boolean outputComments) Set true to tell Atmosphere to write comments when suspending.Set the timeout period.resumeOnBroadcast(boolean resumeOnBroadcast) Set to true to resume the connection on the firstBroadcaster.broadcast(Object)scope(org.atmosphere.annotation.Suspend.SCOPE scope) Set theSuspend.SCOPEvaluewriteEntity(boolean writeEntity) Write the returned entity back to the calling connection.Methods inherited from class com.sun.jersey.api.JResponse.AJResponseBuilder
cacheControl, contentLocation, cookie, encoding, entity, expires, getEntity, getMetadata, getStatus, getStatusType, header, header, headerSingle, language, language, lastModified, location, reset, status, status, status, tag, tag, type, type, variant, variants
-
Field Details
-
suspendTimeout
-
scope
protected org.atmosphere.annotation.Suspend.SCOPE scope -
outputComments
protected boolean outputComments -
resumeOnBroadcast
protected boolean resumeOnBroadcast -
listeners
-
-
Constructor Details
-
SuspendResponseBuilder
public SuspendResponseBuilder()Default constructor. -
SuspendResponseBuilder
Construct a shallow copy. The metadata map will be copied but not the key/value references.- Parameters:
that- the AJResponseBuilder to copy from.
-
-
Method Details
-
scope
public SuspendResponse.SuspendResponseBuilder<E> scope(org.atmosphere.annotation.Suspend.SCOPE scope) Set theSuspend.SCOPEvalue- Parameters:
scope-Suspend.SCOPEvalue- Returns:
- this
-
period
Set the timeout period.- Parameters:
suspendTimeout- the periodtimeUnit- theTimeUnit- Returns:
- this
-
outputComments
Set true to tell Atmosphere to write comments when suspending.- Parameters:
outputComments- true to tell Atmosphere to write comments when suspending- Returns:
- this
-
resumeOnBroadcast
Set to true to resume the connection on the firstBroadcaster.broadcast(Object)- Parameters:
resumeOnBroadcast- true to resume the connection on the firstBroadcaster.broadcast(Object)- Returns:
- this
-
broadcaster
public SuspendResponse.SuspendResponseBuilder<E> broadcaster(org.atmosphere.cpr.Broadcaster broadcaster) Set theBroadcaster- Parameters:
broadcaster-Broadcaster- Returns:
- this
-
writeEntity
Write the returned entity back to the calling connection. Default is false. -
addListener
public SuspendResponse.SuspendResponseBuilder<E> addListener(org.atmosphere.cpr.AtmosphereResourceEventListener e) AddAtmosphereResourceEventListener- Parameters:
e-AtmosphereResourceEventListener- Returns:
- this
-
build
Build theSuspendResponse- Returns:
- an instance of
SuspendResponse
-