public class ApiMethodBasedApiInterface extends Object implements ApiInterface
ApiInterface implementation that uses ApiMethod| Constructor and Description |
|---|
ApiMethodBasedApiInterface(InterfaceIdentifier iface)
Constructor.
|
ApiMethodBasedApiInterface(String iface)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
InterfaceDefinition |
getDefinition()
Returns the details for this interface.
|
InterfaceIdentifier |
getIdentifier()
Returns the identifier for this interface.
|
MethodDefinition |
getMethodDefinition(MethodIdentifier methodId)
Returns method definition for the specified method identifier.
|
void |
invoke(ExecutionContext ctx,
MethodIdentifier methodId,
DataValue input,
AsyncHandle<MethodResult> asyncHandle)
Invokes a method and returns the result of that method invocation.
|
protected void |
registerMethod(ApiMethod method)
Registers an
ApiMethod with this ApiInterface. |
public ApiMethodBasedApiInterface(InterfaceIdentifier iface)
iface - interface identifierpublic ApiMethodBasedApiInterface(String iface)
iface - interface namepublic InterfaceIdentifier getIdentifier()
ApiInterfacegetIdentifier in interface ApiInterfacepublic InterfaceDefinition getDefinition()
ApiInterfacegetDefinition in interface ApiInterfacepublic MethodDefinition getMethodDefinition(MethodIdentifier methodId)
ApiInterfacegetMethodDefinition in interface ApiInterfacemethodId - identifier of the methodMethodDefinition representing details for the
requested method; or null method is not availablepublic void invoke(ExecutionContext ctx, MethodIdentifier methodId, DataValue input, AsyncHandle<MethodResult> asyncHandle)
ApiInterfaceinvoke in interface ApiInterfacectx - execution context for method invocationmethodId - identifier of the method to invoke; if there is no
such method, an error will be returnedinput - input data valueasyncHandle - handle used to return result or errorprotected void registerMethod(ApiMethod method)
ApiMethod with this ApiInterface.method - the API method to registerCopyright © 2023. All rights reserved.