Link

toolkit / com.sas.android.visualanalytics.sdk / SASManager / createFromJson

createFromJson

fun createFromJson(input: Reader, context: Context, onConnectionComplete: ((SASManager.Result) -> Unit)? = null, onSubscribeComplete: ((Server.Result) -> Unit)? = null): Unit

Creates one or more connections to SAS Visual Analytics servers defined in JSON.

Compliant JSON defines a list of servers:

    {
      "servers": [
        {
          "serverHostName": "my.demo.server.com",
          "useSSL": false,
          "serverPort": 80,
          "serverDescription": "_i18n:server_desc",
          "useGuestMode": false,
          "userId": "fred",
          "password": "S3cr37!",
          "reportIds": [
            "17d5fb14-8c1d-40e1-9380-73ffea806c14",
            "57ddfc19-7a1d-38e1-7421-81fabac02c38",
            "38abce26-6a1d-37e1-7407-80ffccd04b40",
          ],
          "reportPaths": [
            "/My/Sample/Report",
            "/My/Sample/Report 2"
          ]
        }
      ]
    }

Each server is defined by the following:

Parameters

input -

    the JSON input.

context -

    used to resolve string resources.

onConnectionComplete -

    an optional callback invoked when the connection-creation process has completed
    (successfully or otherwise).

onSubscribeComplete -

    an optional callback invoked when a subscription process for a report has completed
    (successfully or otherwise); called once for each report.

Exceptions

IOException -

    if an I/O error occurs while reading from input.