Cumulocity API Services / com.softwareag.jc.cumulocity.services.api / CumulocityConnectionFactory / CumulocityConnection

CumulocityConnection

interface CumulocityConnection : Connection<User>

Represents a connection. Call the connect() method to test and/or retrieve the User profile of the cumulocity account associated with given credentials. The implementation of this interface is returned via the CumulocityConnectionFactory connection method.

The connection object can then be used instantiate the API Services to interrogate Cumulocity

Parameters

endPoint - The endpoint that will be used to connect to your cumulocity tenant minus the resource path

isConnected - : Boolean result of call to connect() method

failureReason - : String? If is isConnected is false this might give you an idea of why

credentials - : Credentials the user/password used in the call to connect()

headers - : Map<String, String> The headers returned by the call to connect()

Functions

connect

abstract fun connect(user: String, password: String, responder: OnConnectionResult<User>): AsyncTask<String, Unit, Unit>

Verifies connection with Cumulocity and calls the callback function with the results The connection given in the callback should be the one used when using the Cumulocity services to retrieve/update assets.

userProfile

abstract fun userProfile(): User?

User profile returned by Cumulocity for the given connection