use of io.hops.hopsworks.ca.api.exception.mapper.CAJsonResponse in project hopsworks by logicalclocks.
the class NoCacheResponse method buildJsonResponse.
public CAJsonResponse buildJsonResponse(Response.Status status, String message) {
CAJsonResponse response = new CAJsonResponse();
response.setSuccessMessage(message);
return response;
}
use of io.hops.hopsworks.ca.api.exception.mapper.CAJsonResponse in project hopsworks by logicalclocks.
the class AuthFilter method responseEntity.
@Override
public Object responseEntity(Response.Status status, String msg) {
JsonResponse jsonResponse = new CAJsonResponse();
if (null == status) {
jsonResponse.setErrorCode(RESTCodes.GenericErrorCode.UNKNOWN_ERROR.getCode());
} else {
switch(status) {
case UNAUTHORIZED:
jsonResponse.setErrorCode(RESTCodes.SecurityErrorCode.EJB_ACCESS_LOCAL.getCode());
break;
case FORBIDDEN:
jsonResponse.setErrorCode(RESTCodes.SecurityErrorCode.REST_ACCESS_CONTROL.getCode());
break;
default:
jsonResponse.setErrorCode(RESTCodes.GenericErrorCode.UNKNOWN_ERROR.getCode());
break;
}
}
jsonResponse.setErrorMsg(msg);
return jsonResponse;
}
use of io.hops.hopsworks.ca.api.exception.mapper.CAJsonResponse in project hopsworks by logicalclocks.
the class CAException method buildJsonResponse.
@Override
public CAJsonResponse buildJsonResponse(JsonResponse jsonResponse, RESTLogLevel logLevel) {
CAJsonResponse caJsonResponse = (CAJsonResponse) super.buildJsonResponse(jsonResponse, logLevel);
caJsonResponse.setCertificateType(certType);
return caJsonResponse;
}
Aggregations