/*This document list EDS SDK Client Common APIs. Application can utilize any of these listed APIs to get the required functionalities. */



/* EDS SDK Client object creation is a prerequisite for using any of the other EDS SDK Client APIs. */
edsSdkClient edsClient = new edsSdkClient(MainActivity.this);


/* All the below APIs are required to be call with edsSdkClient object instance. */

/* To Get EDS SDK Lib version */
String getEdsSdkLibVersion();


/* To get optimal MEC endpoints for the Application service id. 
 * Application is required to send the AppSrvId for which optimal MEC End points are needed.
 * Application is required to send the timeout_miliseconds. 
 * Due to any issue if request is not sent to the server then EDS SDK Client will return false otherwise true.
 * In case of false, application is required to use its saved/default endpoints to get the service.
 */
boolean sendOptimalMECEndpointReq(String AppSrvId, int Timeout_miliseconds);



/* EDS SDK Client callback Registration is required to get the success/failure response from EDS SDK Client
 * In case of success endpoints are returned by EDS SDK Client in edsSdkRspMsg.
 * In case of failure error will be returned by EDS SDK Client in edsSdkRspMsg, application is required to use its saved/default endpoints to get the service.
 */
void setEdsClientCallback(new edsSdkCallback() {
            @Override
            public void onSuccessResponse(edsSdkRspMsg msg) {
              runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //Check for edsSdkRspMsg msgType and handling
                    }
                });
            }

            @Override
            public void onFailureResponse(edsSdkRspMsg msg) {
                Log.d(TAG, "onFailureResponse: ");
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //Check for edsSdkRspMsg msgType and handling
                    }
                });
            }
 	});



/* EDS SDK Response message */
class edsSdkRspMsg {

   enum msg_type {
        EDS_SUCCESS,
        EDS_REQUEST_TIMEOUT,
        EDS_ENDPOINT_FAILURE_RSP,
        EDS_ENDPOINT_SUCCESS_RSP,
    };

    msg_type msgType;
    String failureMsg; //Failure message String
    int numAccessPoints;
    serviceAccessPoint[] accessPoint;
}


/* Service Access point is the optimal MEC End points for the required AppSrvId */
class serviceAccessPoint {
    String srvId;
    String srvType;
    String uri;
    String ipv4addr;
    String protocol;
    String port;
    String fqdn;
}


/* Gets EDS Proxy URL */
String getEDSProxyUrl();


/* Sets EDS Proxy URL */
/* By default EDS SDK Library points to ThingSpace EDS provider */ 
boolean setEDSProxyUrl(String in_edsproxyurl);




