use of org.orcid.core.exception.OrcidNotFoundException in project ORCID-Source by ORCID.
the class T2OrcidApiServiceDelegatorImpl method getOrcidMessageResponse.
/**
* Method to perform the mundane task of checking for null and returning the
* response with an OrcidMessage entity
*
* @param profile
* @param requestedOrcid
* @return
*/
private Response getOrcidMessageResponse(OrcidProfile profile, String requestedOrcid) {
if (profile != null) {
OrcidMessage orcidMessage = new OrcidMessage(profile);
orcidMessageUtil.setSourceName(orcidMessage);
return Response.ok(orcidMessage).build();
} else {
Map<String, String> params = new HashMap<String, String>();
params.put("orcid", requestedOrcid);
throw new OrcidNotFoundException(params);
}
}
Aggregations