Class ServiceKey
java.lang.Object
com.developer.nefarious.zjoule.plugin.models.ServiceKey
Represents the service key configuration required for accessing API endpoints and authentication.
The ServiceKey
class contains information about the API URLs, client credentials, and token URL.
It provides methods to validate the service key's integrity and to retrieve the formatted URLs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the client ID for authentication.Retrieves the client secret for authentication.Retrieves the API service URL, formatted with a version suffix.Retrieves the token URL for OAuth authentication.isValid()
Validates the service key's integrity by ensuring all required fields are non-null and non-empty.void
setClientId
(String clientId) Sets the client ID for authentication.void
setClientSecret
(String clientSecret) Sets the client secret for authentication.void
setTokenUrl
(String tokenUrl) Sets the token URL for OAuth authentication.
-
Constructor Details
-
ServiceKey
public ServiceKey()
-
-
Method Details
-
getClientId
Retrieves the client ID for authentication.- Returns:
- the client ID.
-
setClientId
Sets the client ID for authentication.- Parameters:
clientId
- the client ID to set.
-
getClientSecret
Retrieves the client secret for authentication.- Returns:
- the client secret.
-
setClientSecret
Sets the client secret for authentication.- Parameters:
clientSecret
- the client secret to set.
-
getServiceURL
Retrieves the API service URL, formatted with a version suffix.- Returns:
- the API service URL with the `/v2` suffix.
-
getTokenURL
Retrieves the token URL for OAuth authentication.- Returns:
- the token URL appended with the `/oauth/token` suffix.
-
isValid
Validates the service key's integrity by ensuring all required fields are non-null and non-empty.- Returns:
true
if the service key is valid;false
otherwise.
-
setTokenUrl
Sets the token URL for OAuth authentication.- Parameters:
tokenUrl
- the token URL to set.
-