Package org.cometd.oort
Class OortService.Result<U>
- java.lang.Object
-
- org.cometd.oort.OortService.Result<U>
-
- Type Parameters:
U- the result type
- Enclosing class:
- OortService<R,C>
public static class OortService.Result<U> extends java.lang.ObjectEncapsulates the result of a forwarded request returned by
OortService.onForward(Request).Applications must use methods
success(Object),failure(Object)orignore(Object)to signal to the implementation the result of the forwarded request.OortServicemay 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 aOortService.Resultusing the following rules:- If the node owns the entity, use
success(Object)orfailure(Object)- never useignore(Object) - If the node does not own the entity (it never was the owner, or it was the owner but it is not anymore),
then use
ignore(Object)
- See Also:
OortService.Request
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <S> OortService.Result<S>failure(java.lang.Object failure)Returns a failedOortService.Resultcontaining the given failure object.static <S> OortService.Result<S>ignore(java.lang.Object data)Returns an ignoredOortService.Resultcontaining the given data objectstatic <S> OortService.Result<S>success(S result)Returns a successfulOortService.Resultcontaining the given result object.java.lang.StringtoString()
-
-
-
Method Detail
-
success
public static <S> OortService.Result<S> success(S result)
Returns a successfulOortService.Resultcontaining the given result object.- Type Parameters:
S- the type of the result object- Parameters:
result- the result object- Returns:
- a new
OortService.Resultinstance wrapping the result object
-
failure
public static <S> OortService.Result<S> failure(java.lang.Object failure)
Returns a failedOortService.Resultcontaining the given failure object.- Type Parameters:
S- the type of the result- Parameters:
failure- the failure object- Returns:
- a new
OortService.Resultinstance wrapping the failure object
-
ignore
public static <S> OortService.Result<S> ignore(java.lang.Object data)
Returns an ignoredOortService.Resultcontaining the given data object- Type Parameters:
S- the type of the result- Parameters:
data- the data object- Returns:
- a new
OortService.Resultinstance wrapping the data object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-