Class Request<T extends WritableIdentifier,C extends Request<T,C>>
- java.lang.Object
-
- org.opendaylight.controller.cluster.access.concepts.Message<T,C>
-
- org.opendaylight.controller.cluster.access.concepts.Request<T,C>
-
- Type Parameters:
T
- Target identifier typeC
- Message type
- All Implemented Interfaces:
Serializable
,Immutable
,MutationBehaviour<Immutable>
- Direct Known Subclasses:
ConnectClientRequest
,LocalHistoryRequest
,TransactionRequest
@Beta public abstract class Request<T extends WritableIdentifier,C extends Request<T,C>> extends Message<T,C>
A request message concept. Upon receipt of this message, the recipient will respond with either aRequestSuccess
or aRequestFailure
message.- Author:
- Robert Varga
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
Request.SerialForm<T extends WritableIdentifier,C extends Request<T,C>>
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
Add attributes to the output ofMessage.toString()
.protected abstract Request.SerialForm<T,C>
externalizableProxy(ABIVersion version)
Instantiate a serialization proxy for this object for the target ABI version.@NonNull ActorRef
getReplyTo()
Return the return address where responses to this request should be directed to.abstract @NonNull RequestFailure<T,?>
toRequestFailure(@NonNull RequestException cause)
Return aRequestFailure
for this request, caused by aRequestException
.-
Methods inherited from class org.opendaylight.controller.cluster.access.concepts.Message
cloneAsVersion, getSequence, getTarget, getVersion, toString, toVersion, writeReplace
-
-
-
-
Constructor Detail
-
Request
protected Request(@NonNull C request, @NonNull ABIVersion version)
-
-
Method Detail
-
getReplyTo
public final @NonNull ActorRef getReplyTo()
Return the return address where responses to this request should be directed to.- Returns:
- Original requestor
-
toRequestFailure
public abstract @NonNull RequestFailure<T,?> toRequestFailure(@NonNull RequestException cause)
Return aRequestFailure
for this request, caused by aRequestException
.- Parameters:
cause
- Failure cause- Returns:
RequestFailure
corresponding to this request
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
Description copied from class:Message
Add attributes to the output ofMessage.toString()
. Subclasses wanting to contribute additional information should override this method. Any null attributes will be omitted from the output.- Overrides:
addToStringAttributes
in classMessage<T extends WritableIdentifier,C extends Request<T,C>>
- Parameters:
toStringHelper
- aMoreObjects.ToStringHelper
instance- Returns:
- The
MoreObjects.ToStringHelper
passed in as argument
-
externalizableProxy
protected abstract Request.SerialForm<T,C> externalizableProxy(ABIVersion version)
Description copied from class:Message
Instantiate a serialization proxy for this object for the target ABI version. Implementations should return different objects for incompatibleABIVersion
s. This method should never fail, as any compatibility checks should have been done byMessage.cloneAsVersion(ABIVersion)
.- Specified by:
externalizableProxy
in classMessage<T extends WritableIdentifier,C extends Request<T,C>>
- Parameters:
version
- Requested ABI version- Returns:
- Proxy for this object
-
-