Package com.pnfsoftware.jeb.client.api
Class OperationRequest
java.lang.Object
com.pnfsoftware.jeb.client.api.OperationRequest
An operation request. Reserved for internal use.
Not thread-safe.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandone()Determine whether processing of this request is complete.longduration()Get the request duration.Get the requested operation.booleanMark an operable object as processing this request.booleanproceed()Determine whether processing should continue.voidsetResult(boolean result) Set the final request result.booleansuccess()Determine whether the request completed successfully.
-
Constructor Details
-
OperationRequest
Create an operation request.- Parameters:
op- requested operation- Throws:
NullPointerException- if the operation is null
-
-
Method Details
-
getOperation
Get the requested operation.- Returns:
- the operation
-
prepare
Mark an operable object as processing this request.- Parameters:
operable- operable object- Returns:
- true if processing may proceed; false if the operable already processed or is processing this request
-
setResult
public void setResult(boolean result) Set the final request result.- Parameters:
result- true if the operation was performed successfully
-
success
public boolean success()Determine whether the request completed successfully.- Returns:
- true if a successful result was set
-
done
public boolean done()Determine whether processing of this request is complete.- Returns:
- true if a result was set
-
proceed
public boolean proceed()Determine whether processing should continue.- Returns:
- true if no result has been set yet
-
duration
public long duration()Get the request duration.- Returns:
- elapsed time, in milliseconds
-