/** * Returns the Credential specified by the "credentialId" path parameter. * * @param scopeId * The {@link ScopeId} of the requested {@link Credential}. * @param credentialId * The id of the requested Credential. * @return The requested Credential object. * @throws Exception * Whenever something bad happens. See specific {@link KapuaService} exceptions. * @since 1.0.0 */ @ApiOperation(nickname = "credentialFind", value = "Get a Credential", notes = "Returns the Credential specified by the \"credentialId\" path parameter.", response = Credential.class) @GET @Path("{credentialId}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Credential find( @ApiParam(value = "The ScopeId of the requested Credential.", required = true, defaultValue = DEFAULT_SCOPE_ID) @PathParam("scopeId") ScopeId scopeId, @ApiParam(value = "The id of the requested Credential", required = true) @PathParam("credentialId") EntityId credentialId) throws Exception { Credential credential = credentialService.find(scopeId, credentialId); if (credential == null) { throw new KapuaEntityNotFoundException(Credential.TYPE, credentialId); } return credential; }