Search in sources :

Example 1 with GetActivationStatusResponse

use of io.getlime.powerauth.soap.GetActivationStatusResponse in project powerauth-restful-integration by lime-company.

the class ActivationController method getActivationStatus.

/**
 * Get activation status.
 * @param request PowerAuth RESTful request with {@link ActivationStatusRequest} payload.
 * @return PowerAuth RESTful response with {@link ActivationStatusResponse} payload.
 */
@RequestMapping(value = "status", method = RequestMethod.POST)
@ResponseBody
public ObjectResponse<ActivationStatusResponse> getActivationStatus(@RequestBody ObjectRequest<ActivationStatusRequest> request) throws PowerAuthActivationException {
    try {
        String activationId = request.getRequestObject().getActivationId();
        GetActivationStatusResponse soapResponse = powerAuthClient.getActivationStatus(activationId);
        ActivationStatusResponse response = new ActivationStatusResponse();
        response.setActivationId(soapResponse.getActivationId());
        response.setEncryptedStatusBlob(soapResponse.getEncryptedStatusBlob());
        if (applicationConfiguration != null) {
            response.setCustomObject(applicationConfiguration.statusServiceCustomObject());
        }
        return new ObjectResponse<>(response);
    } catch (Exception ex) {
        throw new PowerAuthActivationException();
    }
}
Also used : PowerAuthActivationException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException) GetActivationStatusResponse(io.getlime.powerauth.soap.GetActivationStatusResponse) ObjectResponse(io.getlime.core.rest.model.base.response.ObjectResponse) PowerAuthAuthenticationException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthAuthenticationException) PowerAuthActivationException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException) ActivationStatusResponse(io.getlime.security.powerauth.rest.api.model.response.ActivationStatusResponse) GetActivationStatusResponse(io.getlime.powerauth.soap.GetActivationStatusResponse)

Aggregations

ObjectResponse (io.getlime.core.rest.model.base.response.ObjectResponse)1 GetActivationStatusResponse (io.getlime.powerauth.soap.GetActivationStatusResponse)1 PowerAuthActivationException (io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException)1 PowerAuthAuthenticationException (io.getlime.security.powerauth.rest.api.base.exception.PowerAuthAuthenticationException)1 ActivationStatusResponse (io.getlime.security.powerauth.rest.api.model.response.ActivationStatusResponse)1