use of ca.corefacility.bioinformatics.irida.model.RemoteAPIToken in project irida by phac-nml.
the class RemoteAPIController method read.
/**
* Get an individual remote API's page
*
* @param apiId
* The ID of the api
* @param model
* Model for the view
* @param locale
* the locale specified by the browser.
* @return The name of the remote api details page view
*/
@RequestMapping("/{apiId}")
public String read(@PathVariable Long apiId, Model model, Locale locale) {
RemoteAPI remoteApi = remoteAPIService.read(apiId);
model.addAttribute("remoteApi", remoteApi);
try {
RemoteAPIToken token = tokenService.getToken(remoteApi);
model.addAttribute("tokenExpiry", dateTimeFormatter.print(token.getExpiryDate(), locale));
} catch (EntityNotFoundException ex) {
// Not returning a token here is acceptable. The view will have to
// handle a state if the token does not exist
logger.trace("No token for service " + remoteApi);
}
return DETAILS_PAGE;
}
Aggregations