UserInfo

public class UserInfo

Represents information about the current user.

Constructors

UserInfo

public UserInfo(APIClient client)

UserInfo

protected UserInfo(APIClient client, long objectId)

Internal constructor

Methods

addOfflineActivationResponse

public io.cocotec.coco.platform.coco.LicenseResponse addOfflineActivationResponse(String token)

Installs the token as a local license If the installation fails, an error message will be returned in the response data string

crashReportingConsent

public boolean crashReportingConsent()

Returns the status of the user’s crash reporting status.

finalize

protected void finalize()

forceRefresh

public String forceRefresh()

Forces a refresh of all of the license information, even if it is still valid.

Returns:If an error occurred, then a string describing the error.

getObjectId

public long getObjectId()

Internal method

getOfflineActivationUrl

public io.cocotec.coco.platform.coco.LicenseResponse getOfflineActivationUrl()

Retrieves a URL which can be used to obtain a license for this machine. If successful, the response data string will contain the URL. If this call fails, the response data string will contain an error message.

getOrCreate

public static UserInfo getOrCreate(APIClient client, long objectId)

Internal method

hasLicense

public io.cocotec.coco.platform.coco.LicenseResponse hasLicense(java.util.ArrayList<io.cocotec.coco.platform.ProductFeature> features)

Ensures that this user has a license to use the given features.

licenseInfo

public java.util.ArrayList<io.cocotec.coco.platform.coco.LicenseDescriptor> licenseInfo()

licenseServerReachable

public String licenseServerReachable()

Determines if the Cocotec license server is reachable.

Returns:an empty string if the server is reachable, and an error otherwise.

markAsActive

public void markAsActive(boolean active)

setCrashReportingConsent

public void setCrashReportingConsent(boolean consented)

Sets the status of the user’s crash reporting status.