org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.util

## Class APIUtil

- java.lang.Object
- - org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.util.APIUtil

-     public class APIUtil
      extends Object

  This class provides utility functions used by REST-API.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `APIUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Map<String,SensorRecord>` | `createSensorData(List<org.wso2.carbon.analytics.datasource.commons.Record> records)` Creates the SensorDatas from records.
    `static SensorRecord` | `createSensorData(org.wso2.carbon.analytics.datasource.commons.Record record)` Create a SensorRecord object out of a Record object
    `static List<SensorRecord>` | `getAllEventsForDevice(String tableName, String query, List<org.wso2.carbon.analytics.dataservice.commons.SortByField> sortByFields)`
    `static org.wso2.carbon.analytics.api.AnalyticsDataAPI` | `getAnalyticsDataAPI()`
    `static org.wso2.carbon.apimgt.application.extension.APIManagementProviderService` | `getAPIManagementProviderService()`
    `static String` | `getAuthenticatedUser()`
    `static org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService` | `getDeviceAccessAuthorizationService()`
    `static org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService` | `getDeviceManagementService()`
    `static org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService` | `getJWTClientManagerService()`
    `static org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService` | `getOutputEventAdapterService()`
    `static List<SensorRecord>` | `getSortedSensorData(Map<String,SensorRecord> sensorDatas, List<org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry> searchResults)`
    `static org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService` | `getTenantConfigurationManagementService()`
    `static String` | `getTenantDomainOftheUser()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### APIUtil

          public APIUtil()

  - ### Method Detail

    - #### getAuthenticatedUser

          public static String getAuthenticatedUser()

    - #### getDeviceManagementService

          public static org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService getDeviceManagementService()

    - #### getAnalyticsDataAPI

          public static org.wso2.carbon.analytics.api.AnalyticsDataAPI getAnalyticsDataAPI()

    - #### getAllEventsForDevice

          public static List<SensorRecord> getAllEventsForDevice(String tableName,
                                                 String query,
                                                 List<org.wso2.carbon.analytics.dataservice.commons.SortByField> sortByFields)
                                                          throws org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException

      Throws:
        `org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException`

    - #### getSortedSensorData

          public static List<SensorRecord> getSortedSensorData(Map<String,SensorRecord> sensorDatas,
                                               List<org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry> searchResults)

    - #### createSensorData

          public static Map<String,SensorRecord> createSensorData(List<org.wso2.carbon.analytics.datasource.commons.Record> records)

      Creates the SensorDatas from records.
      Parameters:
        `records` - the records
      Returns:
        the Map of SensorRecord

    - #### createSensorData

          public static SensorRecord createSensorData(org.wso2.carbon.analytics.datasource.commons.Record record)

      Create a SensorRecord object out of a Record object
      Parameters:
        `record` - the record object
      Returns:
        SensorRecord object

    - #### getAPIManagementProviderService

          public static org.wso2.carbon.apimgt.application.extension.APIManagementProviderService getAPIManagementProviderService()

    - #### getJWTClientManagerService

          public static org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService getJWTClientManagerService()

    - #### getTenantDomainOftheUser

          public static String getTenantDomainOftheUser()

    - #### getDeviceAccessAuthorizationService

          public static org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService getDeviceAccessAuthorizationService()

    - #### getOutputEventAdapterService

          public static org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService getOutputEventAdapterService()

    - #### getTenantConfigurationManagementService

          public static org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService getTenantConfigurationManagementService()

Copyright © 2017 WSO2. All rights reserved.