Package org.opennms.core.rpc.api
Interface RpcModule<S extends RpcRequest,T extends RpcResponse>
-
- All Superinterfaces:
RpcClient<S,T>
- All Known Implementing Classes:
AbstractXmlRpcModule
,CollectorClientRpcModule
,DetectorClientRpcModule
,DnsLookupClientRpcModule
,EchoRpcModule
,HealthTrackingEchoRpcModule
,PingProxyRpcModule
,PingSweepRpcModule
,PollerClientRpcModule
,RequisitionRpcModule
,SnmpProxyRpcModule
public interface RpcModule<S extends RpcRequest,T extends RpcResponse> extends RpcClient<S,T>
Provides the ability to execute the RPCs and defines how the requests/responses will be marshaled/unmarshaled over the wire.- Author:
- jwhite
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MINION_HEADERS_MODULE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
createResponseWithException(java.lang.Throwable ex)
Called when theRpcModule
throws an exception while executing a request.java.lang.String
getId()
Used to route the request/responses to the appropriate module.java.lang.String
marshalRequest(S request)
Marshals the request to a string.java.lang.String
marshalResponse(T response)
Marshals the response to a string.S
unmarshalRequest(java.lang.String request)
Unmarshals the request from a string.T
unmarshalResponse(java.lang.String response)
Unmarshals the response from a string.
-
-
-
Field Detail
-
MINION_HEADERS_MODULE
static final java.lang.String MINION_HEADERS_MODULE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
java.lang.String getId()
Used to route the request/responses to the appropriate module. This ID should be unique for every RpcModule implementation.
-
marshalRequest
java.lang.String marshalRequest(S request)
Marshals the request to a string.
-
unmarshalRequest
S unmarshalRequest(java.lang.String request)
Unmarshals the request from a string.
-
marshalResponse
java.lang.String marshalResponse(T response)
Marshals the response to a string.
-
unmarshalResponse
T unmarshalResponse(java.lang.String response)
Unmarshals the response from a string.
-
createResponseWithException
T createResponseWithException(java.lang.Throwable ex)
Called when theRpcModule
throws an exception while executing a request. This function should return a newRpcResponse
that stores a string-based representation of the exception that occurred and make this available viaRpcResponse.getErrorMessage()
once un-marshaled.- Parameters:
ex
- the exception that occurred- Returns:
- a
RpcResponse
that stores the exception
-
-