import org.springframework.http.HttpStatus;
public class GetDictionaryService {
- private static Logger LOGGER = FlexLogger.getLogger(GetDictionaryService.class.getName());
+ private static final Logger LOGGER = FlexLogger.getLogger(GetDictionaryService.class.getName());
private DictionaryResponse dictionaryResponse = null;
private HttpStatus status = HttpStatus.BAD_REQUEST;
requestUUID = UUID.fromString(requestID);
} catch (IllegalArgumentException e) {
requestUUID = UUID.randomUUID();
- LOGGER.info("Generated Random UUID: " + requestUUID.toString());
+ LOGGER.info("Generated Random UUID: " + requestUUID.toString(), e);
}
}else{
requestUUID = UUID.randomUUID();
}
private void specialCheck() {
- if(dictionaryResponse!=null){
- if(dictionaryResponse.getResponseMessage()!=null && dictionaryResponse.getResponseMessage().contains("PE300")){
- status = HttpStatus.BAD_REQUEST;
- }
+ if(dictionaryResponse!=null && (dictionaryResponse.getResponseMessage()!=null && dictionaryResponse.getResponseMessage().contains("PE300"))){
+ status = HttpStatus.BAD_REQUEST;
}
}
json = PolicyApiUtils.stringToJsonObject(datas);
} catch(JsonException| IllegalStateException e){
message = XACMLErrorConstants.ERROR_DATA_ISSUE+ " improper Dictionary JSON object : " + dictionaryParameters.getDictionaryJson();
- LOGGER.error(message);
+ LOGGER.error(message, e);
response.setResponseMessage(message);
response.setResponseCode(400);
return response;
} else {
response.setResponseCode(400);
response.setResponseMessage(result);
+ if(result!=null && result.contains("PE200")){
+ status=HttpStatus.INTERNAL_SERVER_ERROR;
+ }else{
+ status=HttpStatus.BAD_REQUEST;
+ }
}
return response;
}