Class ContentClient

java.lang.Object
com.oracle.content.sdk.ContentClient
Direct Known Subclasses:
ContentDeliveryClient

public abstract class ContentClient extends Object
The base class for the ContentDeliveryClient. Contains core SDK information such as the base url and policy classes. In the future this will be used as the basis for other SDK clients.
  • Field Details

    • NO_CACHE

      public static String NO_CACHE
    • sContentLogging

      protected static ContentLogging sContentLogging
      The logging policy is in effect for the SDK globally
    • retrofit

      protected final retrofit2.Retrofit retrofit
    • gson

      protected static com.google.gson.Gson gson
  • Constructor Details

  • Method Details

    • gson

      public static com.google.gson.Gson gson()
      Get the Gson instance to use for deserialization, which includes any necessary custom deserialization classes.
      Returns:
      gson instance
    • log

      public static void log(Level priority, String tag, String message)
      Called internally to log messages
      Parameters:
      priority - log priority (e.g. Log.DEBUG)
      tag - Logging tag (e.g. class name)
      message - Message to log
    • buildDigitalAssetDownloadUrl

      public abstract String buildDigitalAssetDownloadUrl(String digitalAssetId)
      For more detail, see ContentDeliveryClient.buildDigitalAssetDownloadUrl(String) This is defined in the base class for future use in a management client.
      Parameters:
      digitalAssetId - digital asset to use for building url
      Returns:
      url that can be used to get/download digital assets
    • getBaseUrl

      public okhttp3.HttpUrl getBaseUrl()
      The base URL for the server hosting SDK calls.
      Returns:
      Base url for the server
    • getAuthenticationPolicy

      public AuthenticationPolicy getAuthenticationPolicy()
      Get the current authentication policy in use
      Returns:
      Current authentication policy
    • log

      public static void log(String tag, String message)
      Helper method to Log messages using the logging policy
      Parameters:
      tag - logging tag
      message - logging message
    • getContentException

      public static ContentException getContentException(ContentException.REASON reason, Throwable cause, String logMessage, retrofit2.Response<com.google.gson.JsonElement> response)
      Helper method to generate a ContentException (used internally).
      Parameters:
      reason - If you know the reason, specify it here
      cause - If there is an exception that caused this, include it here (may be null)
      logMessage - Logging message to describe the general problem
      response - If you have a response, include it here
      Returns:
      content exception