Helper methods for creating Rx responses
Type | Name and description |
---|---|
java.util.Observable |
bindData(java.lang.Object object, java.lang.Object bindingSource, java.util.Map arguments = Collections.emptyMap(, java.lang.String filter = null) Implements the bind data method for Rx responses |
NewObservableResult<T> |
create(groovy.lang.Closure<T> callable) Create a new observable result for the given closure. |
NewObservableResult<T> |
create(java.lang.Long timeout, java.util.concurrent.TimeUnit unit, groovy.lang.Closure<T> callable) Create a new observable result for the given closure. |
NewObservableResult<T> |
create(java.lang.Long timeout, groovy.lang.Closure<T> callable) Create a new observable result for the given closure. |
SseResult |
event(java.util.Map sseOptions) Create a Server Sent Event without data |
SseResult |
event(java.util.Map sseOptions, groovy.lang.Writable writable) Use a writable to create a Server Sent Event |
SseResult |
event(groovy.lang.Writable writable) Use a writable to create a Server Sent Event |
SseResult |
event(java.util.Map sseOptions, groovy.lang.GString gString) Use a GString to create a Server Sent Event |
SseResult |
event(groovy.lang.GString gString) Use a GString to create a Server Sent Event |
SseResult |
event(java.util.Map sseOptions, org.codehaus.groovy.runtime.GStringImpl gString) Use a GString to create a Server Sent Event |
SseResult |
event(org.codehaus.groovy.runtime.GStringImpl gString) Use a GString to create a Server Sent Event |
SseResult |
event(java.util.Map sseOptions, java.lang.CharSequence charSequence) Use a CharSequence to create a Server Sent Event |
SseResult |
event(java.lang.CharSequence charSequence) Use a CharSequence to create a Server Sent Event |
SseResult |
event(java.util.Map sseOptions, groovy.lang.Closure closure) Use a Closure to create a Server Sent Event. |
SseResult |
event(groovy.lang.Closure closure) Use a Closure to create a Server Sent Event. |
RxResult<java.util.Map> |
forward(java.util.Map argMap) Executes a forward |
java.util.Observable<java.io.InputStream> |
fromBody(javax.servlet.http.HttpServletRequest request) Creates an observable from the request body |
RxResult<java.lang.Object> |
render(java.lang.Object object) Render the given object using asynchronous request processing |
RxResult<java.lang.CharSequence> |
render(java.lang.CharSequence text) Render the given text using asynchronous request processing |
RxResult<java.lang.CharSequence> |
render(java.util.Map arguments, java.lang.CharSequence text) Render the given text using asynchronous request processing |
RxResult<groovy.lang.Closure> |
render(groovy.lang.Closure callable) Render the given closure using asynchronous request processing |
RxResult<java.util.Map> |
render(java.util.Map arguments) Execute render for the given named arguments |
RxResult<groovy.lang.Closure> |
render(java.util.Map arguments, groovy.lang.Closure callable) Execute render for the given named arguments and closure |
RxResult<groovy.lang.Writable> |
render(java.util.Map arguments, groovy.lang.Writable writable) Executes render for the given arguments and writable |
RxResult<java.lang.Object> |
respond(java.util.Map args, java.lang.Object value) The respond method will attempt to delivery an appropriate response for the requested response format and Map value. |
RxResult<java.lang.Object> |
respond(java.util.Map value) The respond method will attempt to delivery an appropriate response for the requested response format and Map value. |
RxResult<java.lang.Object> |
respond(java.util.Map namedArgs, java.util.Map value) Same as respond(java.util.Map), but here to support Groovy named arguments |
RxResult<java.lang.Object> |
respond(java.lang.Object value, java.util.Map args = [:]) The respond method will attempt to delivery an appropriate response for the requested response format and value. |
StreamingObservableResult<T> |
stream(java.util.Observable<T> observable, java.lang.Long timeout = -1, java.util.concurrent.TimeUnit unit = TimeUnit.MILLISECONDS) Start a streaming Server-Send event response for the given observable |
StreamingObservableResult<T> |
stream(java.lang.String eventName, java.util.Observable<T> observable, java.lang.Long timeout = -1, java.util.concurrent.TimeUnit unit = TimeUnit.MILLISECONDS) Start a streaming Server-Send event response for the given observable |
StreamingNewObservableResult<T> |
stream(java.lang.Long timeout, java.util.concurrent.TimeUnit unit, groovy.lang.Closure callable) Start a streaming Server-Send event response for the given closure which is converted to an asynchronous task |
StreamingNewObservableResult<T> |
stream(java.lang.Long timeout, groovy.lang.Closure callable) Start a streaming Server-Send event response for the given closure which is converted to an asynchronous task |
StreamingNewObservableResult<T> |
stream(groovy.lang.Closure callable) Start a streaming Server-Send event response for the given closure which is converted to an asynchronous task |
ObservableResult<T> |
withTimeout(java.util.Observable<T> observable, java.lang.Long timeout, java.util.concurrent.TimeUnit unit = TimeUnit.MILLISECONDS) Return an observable with the given timeout to be used with the container. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Implements the bind data method for Rx responses
object
- The object to bind tobindingSource
- The binding sourceCreate a new observable result for the given closure. The closure should accept an argument of type rx.Subscriber
callable
- The closureCreate a new observable result for the given closure. The closure should accept an argument of type rx.Subscriber
callable
- The closureCreate a new observable result for the given closure. The closure should accept an argument of type rx.Subscriber
callable
- The closureCreate a Server Sent Event without data
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)Use a writable to create a Server Sent Event
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)writable
- The writableUse a writable to create a Server Sent Event
writable
- The writableUse a GString to create a Server Sent Event
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)gString
- The GStringUse a GString to create a Server Sent Event
gString
- The GStringUse a GString to create a Server Sent Event
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)gString
- The GStringUse a GString to create a Server Sent Event
gString
- The GStringUse a CharSequence to create a Server Sent Event
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)charSequence
- The CharSequenceUse a CharSequence to create a Server Sent Event
charSequence
- The CharSequenceUse a Closure to create a Server Sent Event. The closure will be passed a java.io.Writer as the only argument which it can use to write the data for the event to.
sseOptions
- optional Server Sent Event arguments (comment, id, event, retry)closure
- The closureUse a Closure to create a Server Sent Event. The closure will be passed a java.io.Writer as the only argument which it can use to write the data for the event to.
closure
- The closureExecutes a forward
argMap
- The forward argumentsCreates an observable from the request body
The
- requestRender the given object using asynchronous request processing
object
- The text to renderRender the given text using asynchronous request processing
text
- The text to renderRender the given text using asynchronous request processing
arguments
- The argumentstext
- The text to renderRender the given closure using asynchronous request processing
callable
- The closureExecute render for the given named arguments
arguments
- The named argumentsExecute render for the given named arguments and closure
arguments
- The named argumentscallable
- The closureExecutes render for the given arguments and writable
arguments
- The argumentswritable
- The writableThe respond method will attempt to delivery an appropriate response for the requested response format and Map value. If the value is null then a 404 will be returned. Otherwise the grails.rest.render.RendererRegistry will be consulted for an appropriate response renderer for the requested response format.
args
- the argumentsvalue
- The valueThe respond method will attempt to delivery an appropriate response for the requested response format and Map value. If the value is null then a 404 will be returned. Otherwise the grails.rest.render.RendererRegistry will be consulted for an appropriate response renderer for the requested response format.
value
- The valueSame as respond(java.util.Map), but here to support Groovy named arguments
The respond method will attempt to delivery an appropriate response for the requested response format and value. If the value is null then a 404 will be returned. Otherwise the grails.rest.render.RendererRegistry will be consulted for an appropriate response renderer for the requested response format.
value
- The valueargs
- The argumentsStart a streaming Server-Send event response for the given observable
observable
- The observabletimeout
- The timeoutunit
- The timeout unitStart a streaming Server-Send event response for the given observable
eventName
- The event nameobservable
- The observabletimeout
- The timeoutunit
- The timeout unitStart a streaming Server-Send event response for the given closure which is converted to an asynchronous task
timeout
- The timeoutunit
- The timeout unitcallable
- The closure, it should accept a single argument which is the rx.Subscriber instanceStart a streaming Server-Send event response for the given closure which is converted to an asynchronous task
timeout
- The timeout in millisecondscallable
- The closure, it should accept a single argument which is the rx.Subscriber instanceStart a streaming Server-Send event response for the given closure which is converted to an asynchronous task
callable
- The closure, it should accept a single argument which is the rx.Subscriber instanceReturn an observable with the given timeout to be used with the container. In the event the timeout is reached the containers onTimeout event handler will be invoked and an error response returned
observable
- The observabletimeout
- The timeoutunit
- The timeout unit