Class Controller

    • Field Detail

      • STANDARD_DATE_FORMAT

        public static final java.lang.String STANDARD_DATE_FORMAT
        See Also:
        Constant Field Values
      • TIMEZONE_DATE_FORMAT

        public static final java.lang.String TIMEZONE_DATE_FORMAT
        See Also:
        Constant Field Values
    • Constructor Detail

      • Controller

        public Controller()
    • Method Detail

      • initialize

        public void initialize()
        Initialize the controller
      • createHttpClient

        protected okhttp3.OkHttpClient createHttpClient()
        Returns:
        instance of OkHttpClient with default configurations
      • getTimeoutConnectionInSeconds

        protected int getTimeoutConnectionInSeconds()
        Returns:
        timeout connection. default value is 60 seconds
      • getTimeoutSocketInSeconds

        protected int getTimeoutSocketInSeconds()
        Returns:
        timeout connection. default value is 60 seconds
      • getGsonConfiguration

        protected com.google.gson.Gson getGsonConfiguration()
        Returns:
        instance of Gson with configuration found in ControllerConfig
      • getRestAdapter

        protected retrofit2.Retrofit getRestAdapter()
        Returns:
        instance of Retrofit with configuration found in SdkConfig
      • createRetrofitInterface

        protected <T> T createRetrofitInterface​(java.lang.Class<T> classInterface)
        Type Parameters:
        T - class interface type
        Parameters:
        classInterface - class used to create implementation of API endpoints
        Returns:
        the current interface generated via Retrofit.create(Class)
      • createCache

        public okhttp3.Cache createCache()
        Description copied from interface: RestController
        Method for creating a cached file used to stored temporary data for requests
        Specified by:
        createCache in interface RestController
        Returns:
        new Cache for caching requests
      • evictAllCache

        public void evictAllCache()
        Description copied from interface: RestController
        Method for removing/evicting all the Cache, ideally called during Logout Make sure that a call to initialize() was properly made first before calling this method.
        Specified by:
        evictAllCache in interface RestController
      • removeResponsesFromCache

        public void removeResponsesFromCache​(java.lang.String path)
        Description copied from interface: RestController
        Removes cached responses which contains the specified path. Make sure that a call to initialize() was properly made first before calling this method.
        Specified by:
        removeResponsesFromCache in interface RestController
        Parameters:
        path - the path that will be used to search the cached data.