Remove unused CurrentUser#cacheKey method

Change-Id: If7ccfd9a418a379c677a7150fd14a7fc2d497cd5
This commit is contained in:
Patrick Hiesel
2020-10-05 14:31:38 +02:00
parent 00b214c96d
commit a83ef89d3d
9 changed files with 1 additions and 43 deletions

View File

@@ -26,12 +26,6 @@ public class AnonymousUser extends CurrentUser {
return new ListGroupMembership(Collections.singleton(SystemGroupBackend.ANONYMOUS_USERS)); return new ListGroupMembership(Collections.singleton(SystemGroupBackend.ANONYMOUS_USERS));
} }
@Override
public Object getCacheKey() {
// Treat all anonymous users as a single user
return "anonymous";
}
@Override @Override
public String toString() { public String toString() {
return "ANONYMOUS"; return "ANONYMOUS";

View File

@@ -90,12 +90,6 @@ public abstract class CurrentUser {
*/ */
public abstract GroupMembership getEffectiveGroups(); public abstract GroupMembership getEffectiveGroups();
/**
* Returns a unique identifier for this user that is intended to be used as a cache key. Returned
* object should to implement {@code equals()} and {@code hashCode()} for effective caching.
*/
public abstract Object getCacheKey();
/** Unique name of the user on this server, if one has been assigned. */ /** Unique name of the user on this server, if one has been assigned. */
public Optional<String> getUserName() { public Optional<String> getUserName() {
return Optional.empty(); return Optional.empty();

View File

@@ -390,11 +390,6 @@ public class IdentifiedUser extends CurrentUser {
return effectiveGroups; return effectiveGroups;
} }
@Override
public Object getCacheKey() {
return getAccountId();
}
public PersonIdent newRefLogIdent() { public PersonIdent newRefLogIdent() {
return newRefLogIdent(new Date(), TimeZone.getDefault()); return newRefLogIdent(new Date(), TimeZone.getDefault());
} }

View File

@@ -35,11 +35,6 @@ public class InternalUser extends CurrentUser {
return GroupMembership.EMPTY; return GroupMembership.EMPTY;
} }
@Override
public String getCacheKey() {
return "internal";
}
@Override @Override
public boolean isInternalUser() { public boolean isInternalUser() {
return true; return true;

View File

@@ -40,11 +40,6 @@ public class PeerDaemonUser extends CurrentUser {
return GroupMembership.EMPTY; return GroupMembership.EMPTY;
} }
@Override
public Object getCacheKey() {
return getRemoteAddress();
}
public SocketAddress getRemoteAddress() { public SocketAddress getRemoteAddress() {
return peer; return peer;
} }

View File

@@ -36,9 +36,4 @@ public final class SingleGroupUser extends CurrentUser {
public GroupMembership getEffectiveGroups() { public GroupMembership getEffectiveGroups() {
return groups; return groups;
} }
@Override
public Object getCacheKey() {
return groups.getKnownGroups();
}
} }

View File

@@ -100,11 +100,6 @@ public class UiActionsTest {
throw new UnsupportedOperationException("not implemented"); throw new UnsupportedOperationException("not implemented");
} }
@Override
public Object getCacheKey() {
return new Object();
}
@Override @Override
public boolean isIdentifiedUser() { public boolean isIdentifiedUser() {
return true; return true;

View File

@@ -1197,11 +1197,6 @@ public class RefControlTest {
return groups; return groups;
} }
@Override
public Object getCacheKey() {
return new Object();
}
@Override @Override
public Optional<String> getUserName() { public Optional<String> getUserName() {
return Optional.ofNullable(username); return Optional.ofNullable(username);