java.lang.Object
com.developer.nefarious.zjoule.plugin.models.ServiceKey

public class ServiceKey extends Object
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 Details

    • ServiceKey

      public ServiceKey()
  • Method Details

    • getClientId

      public String getClientId()
      Retrieves the client ID for authentication.
      Returns:
      the client ID.
    • setClientId

      public void setClientId(String clientId)
      Sets the client ID for authentication.
      Parameters:
      clientId - the client ID to set.
    • getClientSecret

      public String getClientSecret()
      Retrieves the client secret for authentication.
      Returns:
      the client secret.
    • setClientSecret

      public void setClientSecret(String clientSecret)
      Sets the client secret for authentication.
      Parameters:
      clientSecret - the client secret to set.
    • getServiceURL

      public String getServiceURL()
      Retrieves the API service URL, formatted with a version suffix.
      Returns:
      the API service URL with the `/v2` suffix.
    • getTokenURL

      public String getTokenURL()
      Retrieves the token URL for OAuth authentication.
      Returns:
      the token URL appended with the `/oauth/token` suffix.
    • isValid

      public Boolean 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

      public void setTokenUrl(String tokenUrl)
      Sets the token URL for OAuth authentication.
      Parameters:
      tokenUrl - the token URL to set.