Package com.oracle.content.sdk
Class ContentClient
java.lang.Object
com.oracle.content.sdk.ContentClient
- Direct Known Subclasses:
ContentDeliveryClient
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static com.google.gson.Gson
static String
protected final retrofit2.Retrofit
protected static ContentLogging
The logging policy is in effect for the SDK globally -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ContentClient
(@NotNull String contentServer, @NotNull AuthenticationPolicy authenticationPolicy, @NotNull ContentSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionabstract String
buildDigitalAssetDownloadUrl
(String digitalAssetId) For more detail, seeContentDeliveryClient.buildDigitalAssetDownloadUrl(String)
This is defined in the base class for future use in a management client.Get the current authentication policy in useokhttp3.HttpUrl
The base URL for the server hosting SDK calls.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).static com.google.gson.Gson
gson()
Get the Gson instance to use for deserialization, which includes any necessary custom deserialization classes.static void
Helper method to Log messages using the logging policystatic void
Called internally to log messages
-
Field Details
-
NO_CACHE
-
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
-
ContentClient
protected ContentClient(@NotNull @NotNull String contentServer, @NotNull @NotNull AuthenticationPolicy authenticationPolicy, @NotNull @NotNull ContentSettings settings)
-
-
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
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
For more detail, seeContentDeliveryClient.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
Get the current authentication policy in use- Returns:
- Current authentication policy
-
log
Helper method to Log messages using the logging policy- Parameters:
tag
- logging tagmessage
- 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 herecause
- If there is an exception that caused this, include it here (may be null)logMessage
- Logging message to describe the general problemresponse
- If you have a response, include it here- Returns:
- content exception
-