Skip to content

Commit

Permalink
Renamed CompositeAuthenticator -> RegistryBasedAuthenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Apr 9, 2021
1 parent 08a5326 commit 3ffdd65
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
* Internally maintains a map of service claims where key is some id (of type {@code long}) and
* value is {@link ServiceClaims} object.
*
* @see #saveAuthData(long, ServiceClaims)
* @see #getAuthData(long)
* @see #removeAuthData(long)
* @see #put(long, ServiceClaims)
* @see #get(long)
* @see #remove(long)
* @see #containsKey(long)
*/
public final class CompositeAuthenticator implements Authenticator<ServiceClaims> {
public final class RegistryBasedAuthenticator implements Authenticator<ServiceClaims> {

private final Authenticator<ServiceClaims> authenticator;

private final Map<Long, ServiceClaims> registry = new NonBlockingHashMapLong<>();

public CompositeAuthenticator(Authenticator<ServiceClaims> authenticator) {
public RegistryBasedAuthenticator(Authenticator<ServiceClaims> authenticator) {
this.authenticator = authenticator;
}

Expand All @@ -29,19 +30,19 @@ public Mono<ServiceClaims> apply(Map<String, String> credentials) {
return authenticator.apply(credentials);
}

public void saveAuthData(long id, ServiceClaims serviceClaims) {
public void put(long id, ServiceClaims serviceClaims) {
registry.put(id, serviceClaims);
}

public ServiceClaims getAuthData(long id) {
public ServiceClaims get(long id) {
return registry.get(id);
}

public void removeAuthData(long id) {
public void remove(long id) {
registry.remove(id);
}

public boolean containsAuthData(long id) {
public boolean containsKey(long id) {
return registry.containsKey(id);
}
}

0 comments on commit 3ffdd65

Please sign in to comment.