public String save() { if (client.getUser() == null) { client.setUser(getSessionUser()); } if (service.find(client.getClientId()) != null) { service.update(client); } else { service.create(client); } FacesContext.getCurrentInstance() .addMessage( null, new FacesMessage(FacesMessage.SEVERITY_INFO, "client saved successfully!", null)); return "list"; }
public List<Client> list() { List<Client> subList = new ArrayList<Client>(); List<Client> fullList = new ArrayList<Client>(); User authorizedUser = getSessionUser(); logger.debug("Found authenticatedUser: "******"fullList:" + fullList + "\nsubList:" + subList.toString()); return subList; }
@PostConstruct public void newClient() { client = new Client(); client.setClientId(RandomStringUtils.randomAlphanumeric(20)); client.setClientSecret(RandomStringUtils.randomAlphanumeric(20)); }