U
- the result typepublic static class OortService.Result<U> extends Object
Encapsulates the result of a forwarded request returned by OortService.onForward(Request)
.
Applications must use methods success(Object)
, failure(Object)
or ignore(Object)
to signal to the implementation the result of the forwarded request.
OortService
may forward a request action for an entity to the owner node, but before the request
arrives to the owner node, the entity may be removed from the owner node.
When the owner node receives the request for the entity, the entity is not available anymore.
Similarly, a request that is broadcast to all nodes arrives to nodes that do not own the entity.
The node that receives the request must return a OortService.Result
using the following rules:
success(Object)
or failure(Object)
- never use
ignore(Object)
ignore(Object)
OortService.Request
Modifier and Type | Method and Description |
---|---|
static <S> OortService.Result<S> |
failure(Object failure)
Returns a failed
OortService.Result containing the given failure object. |
static <S> OortService.Result<S> |
ignore(Object data)
Returns an ignored
OortService.Result containing the given data object |
static <S> OortService.Result<S> |
success(S result)
Returns a successful
OortService.Result containing the given result object. |
String |
toString() |
public static <S> OortService.Result<S> success(S result)
OortService.Result
containing the given result object.S
- the type of the result objectresult
- the result objectOortService.Result
instance wrapping the result objectpublic static <S> OortService.Result<S> failure(Object failure)
OortService.Result
containing the given failure object.S
- the type of the resultfailure
- the failure objectOortService.Result
instance wrapping the failure objectpublic static <S> OortService.Result<S> ignore(Object data)
OortService.Result
containing the given data objectS
- the type of the resultdata
- the data objectOortService.Result
instance wrapping the data objectCopyright © 2008–2024 The CometD Project. All rights reserved.