use of io.getlime.security.powerauth.rest.api.model.response.ActivationStatusResponse 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.
* @throws RemoteException In case SOAP communication fails
*/
@POST
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Path("status")
public ObjectResponse<ActivationStatusResponse> getActivationStatus(ObjectRequest<ActivationStatusRequest> request) throws RemoteException, PowerAuthActivationException {
if (request.getRequestObject() == null) {
throw new PowerAuthActivationException();
}
try {
String activationId = request.getRequestObject().getActivationId();
PowerAuthPortServiceStub.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 e) {
throw new PowerAuthActivationException();
}
}
use of io.getlime.security.powerauth.rest.api.model.response.ActivationStatusResponse 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();
}
}
Aggregations