Class AbstractMockHttpSecurityActionContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext<O,F>
-
- All Implemented Interfaces:
HttpSecurityActionContext,HttpSecurityApplicationContext<O,F>
- Direct Known Subclasses:
MockHttpAuthenticateContext,MockHttpChallengeContext,MockHttpLogoutContext
public abstract class AbstractMockHttpSecurityActionContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends java.lang.Object implements HttpSecurityActionContext, HttpSecurityApplicationContext<O,F>
Abstract mockHttpSecurityActionContextandHttpSecurityApplicationContext.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerHttpConnectionconnectionprotected java.util.Map<O,java.lang.Object>dependenciesDependencies.protected java.util.Map<F,java.util.function.BiConsumer<java.lang.Object,FlowCallback>>flowsFlowhandlers.protected HttpRequestStaterequestStateprotected HttpSessionsession
-
Constructor Summary
Constructors Constructor Description AbstractMockHttpSecurityActionContext()Initiate.AbstractMockHttpSecurityActionContext(ServerHttpConnection connection)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFlow(F key, java.lang.Object parameter, FlowCallback callback)Undertakes a flow.ServerHttpConnectiongetConnection()Obtains theServerHttpConnection.java.lang.ObjectgetObject(O key)Obtains a dependency.java.lang.StringgetQualifiedAttributeName(java.lang.String attributeName)Qualifies the attribute name to thisHttpSecurityinstance.HttpRequestStategetRequestState()Obtains theHttpRequestState.HttpSessiongetSession()Obtains theHttpSession.voidregisterFlow(F key, java.util.function.BiConsumer<java.lang.Object,FlowCallback> handler)Registers aFlowhandler.voidregisterObject(O key, java.lang.Object dependency)Registers a dependency.
-
-
-
Field Detail
-
connection
protected final ServerHttpConnection connection
-
session
protected final HttpSession session
-
requestState
protected final HttpRequestState requestState
-
dependencies
protected final java.util.Map<O extends java.lang.Enum<O>,java.lang.Object> dependencies
Dependencies.
-
flows
protected final java.util.Map<F extends java.lang.Enum<F>,java.util.function.BiConsumer<java.lang.Object,FlowCallback>> flows
Flowhandlers.
-
-
Constructor Detail
-
AbstractMockHttpSecurityActionContext
public AbstractMockHttpSecurityActionContext()
Initiate.
-
AbstractMockHttpSecurityActionContext
public AbstractMockHttpSecurityActionContext(ServerHttpConnection connection)
Initiate.- Parameters:
connection-ServerHttpConnection.
-
-
Method Detail
-
registerObject
public void registerObject(O key, java.lang.Object dependency)
Registers a dependency.- Parameters:
key- Key for dependency.dependency- Dependency object.
-
registerFlow
public void registerFlow(F key, java.util.function.BiConsumer<java.lang.Object,FlowCallback> handler)
Registers aFlowhandler.
-
getConnection
public ServerHttpConnection getConnection()
Description copied from interface:HttpSecurityActionContextObtains theServerHttpConnection.- Specified by:
getConnectionin interfaceHttpSecurityActionContext- Returns:
ServerHttpConnection.
-
getQualifiedAttributeName
public java.lang.String getQualifiedAttributeName(java.lang.String attributeName)
Description copied from interface:HttpSecurityActionContextQualifies the attribute name to this
HttpSecurityinstance.Multiple
HttpSecuritySourceinstances may be registered for the application. Potentially, some even of the same implementation - likely just configured differently for different needs.Therefore, may use this method to provide a namespace on the attribute to keep its value isolated to just this instance use of the
HttpSecurity.- Specified by:
getQualifiedAttributeNamein interfaceHttpSecurityActionContext- Parameters:
attributeName- Name of the attribute.- Returns:
- Qualified attribute name to the
HttpSecurityinstance.
-
getSession
public HttpSession getSession()
Description copied from interface:HttpSecurityActionContextObtains theHttpSession.- Specified by:
getSessionin interfaceHttpSecurityActionContext- Returns:
HttpSession.
-
getRequestState
public HttpRequestState getRequestState()
Description copied from interface:HttpSecurityActionContextObtains theHttpRequestState.- Specified by:
getRequestStatein interfaceHttpSecurityActionContext- Returns:
HttpRequestState.
-
getObject
public java.lang.Object getObject(O key)
Description copied from interface:HttpSecurityApplicationContextObtains a dependency.
-
doFlow
public void doFlow(F key, java.lang.Object parameter, FlowCallback callback)
Description copied from interface:HttpSecurityApplicationContextUndertakes a flow.- Specified by:
doFlowin interfaceHttpSecurityApplicationContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
key- Key identifying the flow.parameter- Parameter.callback-FlowCallback.
-
-