@Override
public void delete(Long id) {
Credential credential = credentialRepository.findOne(id);
if (credential == null) {
throw new NotFoundException(String.format("Credential '%s' not found.", id));
}
credentialRepository.delete(credential);
websocketService.sendToTopicUser(credential.getOwner(), WebsocketEndPoint.CREDENTIAL,
new StatusMessage(credential.getId(), credential.getName(), Status.DELETE_COMPLETED.name()));
}