예제 #1
0
 @Override
 public void removeUser(DemoiselleUser user) {
   repo.entrySet()
       .stream()
       .filter((entry) -> (entry.getValue().getIdentity().equalsIgnoreCase(user.getIdentity())))
       .forEach(
           (entry) -> {
             token.setKey(entry.getKey());
           });
   removeToken();
 }
예제 #2
0
  /** @param user */
  @Override
  public void setUser(DemoiselleUser user) {
    token.setKey(null);

    repo.entrySet()
        .stream()
        .filter((entry) -> (entry.getValue().getIdentity().equalsIgnoreCase(user.getIdentity())))
        .forEach(
            (entry) -> {
              token.setKey(entry.getKey());
            });

    if (token.getKey() == null) {
      String value = randomUUID().toString();
      repo.putIfAbsent(value, user.clone());
      token.setKey(value);
    }

    token.setType("Token");
  }