Class LicenseDetailsService
- java.lang.Object
-
- io.jans.ca.plugin.adminui.service.BaseService
-
- io.jans.ca.plugin.adminui.service.license.LicenseDetailsService
-
@Singleton public class LicenseDetailsService extends BaseService
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_JSON
static String
AUTHORIZATION
static String
BEARER
static String
CODE
static String
CONTENT_TYPE
static String
HARDWARE_ID
static String
LICENSE_ACTIVATE_ERROR_RESPONSE
static String
LICENSE_APIS_404
static String
LICENSE_APIS_503
static String
LICENSE_ISACTIVE_ERROR_RESPONSE
static String
LICENSE_KEY
static String
LICENSE_RETRIEVE_ERROR_RESPONSE
static String
MESSAGE
static String
TRIAL_GENERATE_ERROR_RESPONSE
-
Constructor Summary
Constructors Constructor Description LicenseDetailsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericResponse
activateLicense(LicenseRequest licenseRequest)
The function checks if the license is already active, if not, it creates a header map, creates a body map, and sends a POST request to the license serverGenericResponse
checkLicense()
GenericResponse
generateTrialLicense()
This function generates a trial license by sending a request to a specified URL and saving the license key in the configuration.LicenseResponse
getLicenseDetails()
This function is used to get the license details of the admin-uiGenericResponse
postSSA(SSARequest ssaRequest)
The function takes an SSA string as input, calls the DCR API to get the scan hostname and OIDC client settings, and saves the SSA string and the scan hostname and OIDC client settings in the Admin UI configurationGenericResponse
retrieveLicense()
The function `retrieveLicense()` retrieves a license using the provided configuration and returns a generic response.GenericResponse
validateLicenseConfiguration()
The function checks the license key and the api key and returns a response object-
Methods inherited from class io.jans.ca.plugin.adminui.service.BaseService
executeDCR, getClaims, getToken, getToken, introspectToken
-
-
-
-
Field Detail
-
AUTHORIZATION
public static final String AUTHORIZATION
- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_JSON
public static final String APPLICATION_JSON
- See Also:
- Constant Field Values
-
LICENSE_KEY
public static final String LICENSE_KEY
- See Also:
- Constant Field Values
-
HARDWARE_ID
public static final String HARDWARE_ID
- See Also:
- Constant Field Values
-
BEARER
public static final String BEARER
- See Also:
- Constant Field Values
-
MESSAGE
public static final String MESSAGE
- See Also:
- Constant Field Values
-
CODE
public static final String CODE
- See Also:
- Constant Field Values
-
LICENSE_ISACTIVE_ERROR_RESPONSE
public static final String LICENSE_ISACTIVE_ERROR_RESPONSE
- See Also:
- Constant Field Values
-
LICENSE_RETRIEVE_ERROR_RESPONSE
public static final String LICENSE_RETRIEVE_ERROR_RESPONSE
- See Also:
- Constant Field Values
-
LICENSE_ACTIVATE_ERROR_RESPONSE
public static final String LICENSE_ACTIVATE_ERROR_RESPONSE
- See Also:
- Constant Field Values
-
LICENSE_APIS_404
public static final String LICENSE_APIS_404
- See Also:
- Constant Field Values
-
LICENSE_APIS_503
public static final String LICENSE_APIS_503
- See Also:
- Constant Field Values
-
TRIAL_GENERATE_ERROR_RESPONSE
public static final String TRIAL_GENERATE_ERROR_RESPONSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateLicenseConfiguration
public GenericResponse validateLicenseConfiguration()
The function checks the license key and the api key and returns a response object- Returns:
- A LicenseApiResponse object is being returned.
-
checkLicense
public GenericResponse checkLicense()
-
retrieveLicense
public GenericResponse retrieveLicense()
The function `retrieveLicense()` retrieves a license using the provided configuration and returns a generic response.- Returns:
- The method `retrieveLicense()` returns a `GenericResponse` object.
-
activateLicense
public GenericResponse activateLicense(LicenseRequest licenseRequest)
The function checks if the license is already active, if not, it creates a header map, creates a body map, and sends a POST request to the license server- Parameters:
licenseRequest
- The license key that you received from the license server.- Returns:
- A LicenseApiResponse object.
-
generateTrialLicense
public GenericResponse generateTrialLicense()
This function generates a trial license by sending a request to a specified URL and saving the license key in the configuration.- Returns:
- The method is returning a LicenseApiResponse object.
-
getLicenseDetails
public LicenseResponse getLicenseDetails()
This function is used to get the license details of the admin-ui- Returns:
- A LicenseResponse object
-
postSSA
public GenericResponse postSSA(SSARequest ssaRequest)
The function takes an SSA string as input, calls the DCR API to get the scan hostname and OIDC client settings, and saves the SSA string and the scan hostname and OIDC client settings in the Admin UI configuration- Parameters:
ssaRequest
- The SSA request object.- Returns:
- A LicenseApiResponse object.
-
-