java.lang.Object
tech.deplant.java4ever.binding.ffi.EverSdkContext
-
Constructor Summary
ConstructorsConstructorDescriptionEverSdkContext(int id, Client.ClientConfig clientConfig) Instantiates a new Ever sdk context. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponse(int requestId, tech.deplant.java4ever.binding.ffi.EverSdkContext.RequestData request, String responseString) Add response.voidapply(int request_id, MemorySegment params_json, int response_type, boolean finished) <R,P, AP, AR>
CompletableFuture<R> callAsync(String functionName, P functionInputs, Class<R> resultClass, Consumer<com.fasterxml.jackson.databind.JsonNode> eventConsumer, AppObject appObject) Most used call to EVER-SDK with some output objectconfig()Config client . client config.intid()Id int.intRequest count int.intRequest count next val int.
-
Constructor Details
-
EverSdkContext
Instantiates a new Ever sdk context.- Parameters:
id- the idclientConfig- the client config
-
-
Method Details
-
callAsync
public <R,P, CompletableFuture<R> callAsyncAP, AR> (String functionName, P functionInputs, Class<R> resultClass, Consumer<com.fasterxml.jackson.databind.JsonNode> eventConsumer, AppObject appObject) Most used call to EVER-SDK with some output object- Type Parameters:
R- Class of the result objectP- Class of the function params objectAP- Class of the AppObject param callsAR- Class of the AppObject result callbacks- Parameters:
functionName- the function namefunctionInputs- record of input type, usually ParamsOf...resultClass- class of output type record, usually ResultOf...classeventConsumer- the event consumerappObject- the app object- Returns:
- output type record, usually ResultOf...
- Throws:
EverSdkException- the ever sdk exception
-
requestCountNextVal
public int requestCountNextVal()Request count next val int.- Returns:
- the int
-
addResponse
public void addResponse(int requestId, tech.deplant.java4ever.binding.ffi.EverSdkContext.RequestData request, String responseString) Add response.- Parameters:
requestId- the request idresponseString- the response string
-
id
public int id()Id int.- Returns:
- the int
-
requestCount
public int requestCount()Request count int.- Returns:
- the int
-
config
Config client . client config.- Returns:
- the client . client config
-
apply
- Specified by:
applyin interfacetc_response_handler_t.Function- Parameters:
request_id- id of the request in this context that this answer applies toparams_json- memory segment with native response stringresponse_type- Type of response with following possible values: RESULT = 1, real response. NOP = 2, no operation. In combination with finished = true signals that the request handling was finished. APP_REQUEST = 3, request some data from application. See Application objects APP_NOTIFY = 4, notify application with some data. See Application objects RESERVED = 5..99 – reserved for protocol internal purposes. Application (or binding) must ignore this response. CUSTOM >= 100 - additional function data related to request handling. Depends on the function.finished- is this a final answer for this request_id
-