Methods usable with RxJava observable transformations in order to control the final controller response
Type | Name and description |
---|---|
static 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 |
static NewObservableResult<T> |
create(groovy.lang.Closure<T> callable) Create a new observable result for the given closure. |
static 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. |
static NewObservableResult<T> |
create(java.lang.Long timeout, groovy.lang.Closure<T> callable) Create a new observable result for the given closure. |
static SseResult |
event(java.util.Map sseOptions, groovy.lang.Writable writable) Creates a Server Sent Events event for the given groovy.lang.Writable. |
static SseResult |
event(java.util.Map sseOptions, groovy.lang.GString gString) Creates a Server Sent Events event for the given groovy.lang.GString. |
static SseResult |
event(java.util.Map sseOptions, java.lang.CharSequence charSequence) Creates a Server Sent Events event for the given java.lang.CharSequence. |
static SseResult |
event(java.util.Map sseOptions, groovy.lang.Closure closure) Creates a Server Sent Events event using the given groovy.lang.Closure to generate the data. |
static RxResult<java.util.Map> |
forward(java.util.Map argMap) Executes a forward |
static java.util.Observable<java.io.InputStream> |
fromBody(javax.servlet.http.HttpServletRequest request) Creates an observable from the request body |
static void |
redirect(java.util.Map argMap) @throws CannotRedirectException Redirects are not possible in asynchronous requests |
static void |
redirect(java.lang.Object arg) @throws CannotRedirectException Redirects are not possible in asynchronous requests |
static RxResult<java.lang.Object> |
render(java.lang.Object object) Render the given object using asynchronous request processing |
static RxResult<java.lang.CharSequence> |
render(java.lang.CharSequence text) Render the given text using asynchronous request processing |
static RxResult<java.lang.CharSequence> |
render(java.util.Map arguments, java.lang.CharSequence text) Render the given text using asynchronous request processing |
static RxResult<groovy.lang.Closure> |
render(groovy.lang.Closure callable) Render the given closure using asynchronous request processing |
static RxResult<java.util.Map> |
render(java.util.Map arguments) Execute render for the given named arguments |
static RxResult<groovy.lang.Closure> |
render(java.util.Map arguments, groovy.lang.Closure callable) Execute render for the given named arguments and closure |
static RxResult<groovy.lang.Writable> |
render(java.util.Map arguments, groovy.lang.Writable writable) Executes render for the given arguments and writable |
static RxResult<java.lang.Object> |
respond(java.util.Map args, java.lang.Object value) |
static 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. |
static 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 |
static 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. |
static 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 |
static 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 |
static 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 |
static 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 |
static 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 |
static 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 closureCreates a Server Sent Events event for the given groovy.lang.Writable. Optional named params can be used to set a `comment`, `id` and `event` for the SSE event.
sseOptions
- Optional named parameterswritable
- The writable to write as the event dataCreates a Server Sent Events event for the given groovy.lang.GString.
sseOptions
- Optional named parametersgString
- The StringCreates a Server Sent Events event for the given java.lang.CharSequence.
sseOptions
- Optional named parameterscharSequence
- The StringCreates a Server Sent Events event using the given groovy.lang.Closure to generate the data. The closure will receive a writer as the only parameter.
sseOptions
- Optional named parametersclosure
- 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 writable
The 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