Break SessionSource out of SessionMetadata and rename it EppRequestSource.

The "SessionSource" has nothing to do with sessions (and it's often
used in sessionless contexts). What it does indicate is the endpoint
used to make the request.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125295224
This commit is contained in:
cgoldfeder 2016-06-19 18:12:57 -07:00 committed by Ben McIlwain
parent fd6c4888db
commit 2a3a3fbc30
25 changed files with 94 additions and 95 deletions

View file

@ -26,26 +26,6 @@ import java.util.Set;
/** Class to allow setting and retrieving session information in flows. */
public abstract class SessionMetadata {
/**
* An enum that identifies the origin of the session.
*/
public enum SessionSource {
/** e.g. {@code EppConsoleServlet} */
CONSOLE,
/** e.g. {@code EppTlsServlet} */
HTTP,
/** e.g. {@code EppToolServlet} */
TOOL,
/** e.g. {@code LoadTestAction} */
LOADTEST,
/** Direct flow runs (default for e.g. testing) */
NONE
}
/** The key used for looking up the current client id on the session object. */
protected static final String CLIENT_ID_KEY = "CLIENT_ID";
@ -95,16 +75,6 @@ public abstract class SessionMetadata {
return getProperty(Set.class, SERVICE_EXTENSIONS_KEY);
}
public abstract SessionSource getSessionSource();
/**
* Subclasses can override if they present a need to change the session
* source at runtime (e.g. anonymous classes created for testing)
*/
public void setSessionSource(@SuppressWarnings("unused") SessionSource source) {
throw new UnsupportedOperationException();
}
public void setClientId(String clientId) {
setPropertyChecked(CLIENT_ID_KEY, clientId);
}
@ -132,7 +102,6 @@ public abstract class SessionMetadata {
.add("system hash code", System.identityHashCode(this))
.add("clientId", getClientId())
.add("failedLoginAttempts", getFailedLoginAttempts())
.add("sessionSource", getSessionSource())
.add("serviceExtensionUris", Joiner.on('.').join(nullToEmpty(getServiceExtensionUris())))
.toString();
}