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 mockHttpSecurityActionContext
andHttpSecurityApplicationContext
.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerHttpConnection
connection
protected java.util.Map<O,java.lang.Object>
dependencies
Dependencies.protected java.util.Map<F,java.util.function.BiConsumer<java.lang.Object,FlowCallback>>
flows
Flow
handlers.protected HttpRequestState
requestState
protected HttpSession
session
-
Constructor Summary
Constructors Constructor Description AbstractMockHttpSecurityActionContext()
Initiate.AbstractMockHttpSecurityActionContext(ServerHttpConnection connection)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doFlow(F key, java.lang.Object parameter, FlowCallback callback)
Undertakes a flow.ServerHttpConnection
getConnection()
Obtains theServerHttpConnection
.java.lang.Object
getObject(O key)
Obtains a dependency.java.lang.String
getQualifiedAttributeName(java.lang.String attributeName)
Qualifies the attribute name to thisHttpSecurity
instance.HttpRequestState
getRequestState()
Obtains theHttpRequestState
.HttpSession
getSession()
Obtains theHttpSession
.void
registerFlow(F key, java.util.function.BiConsumer<java.lang.Object,FlowCallback> handler)
Registers aFlow
handler.void
registerObject(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
Flow
handlers.
-
-
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 aFlow
handler.
-
getConnection
public ServerHttpConnection getConnection()
Description copied from interface:HttpSecurityActionContext
Obtains theServerHttpConnection
.- Specified by:
getConnection
in interfaceHttpSecurityActionContext
- Returns:
ServerHttpConnection
.
-
getQualifiedAttributeName
public java.lang.String getQualifiedAttributeName(java.lang.String attributeName)
Description copied from interface:HttpSecurityActionContext
Qualifies the attribute name to this
HttpSecurity
instance.Multiple
HttpSecuritySource
instances 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:
getQualifiedAttributeName
in interfaceHttpSecurityActionContext
- Parameters:
attributeName
- Name of the attribute.- Returns:
- Qualified attribute name to the
HttpSecurity
instance.
-
getSession
public HttpSession getSession()
Description copied from interface:HttpSecurityActionContext
Obtains theHttpSession
.- Specified by:
getSession
in interfaceHttpSecurityActionContext
- Returns:
HttpSession
.
-
getRequestState
public HttpRequestState getRequestState()
Description copied from interface:HttpSecurityActionContext
Obtains theHttpRequestState
.- Specified by:
getRequestState
in interfaceHttpSecurityActionContext
- Returns:
HttpRequestState
.
-
getObject
public java.lang.Object getObject(O key)
Description copied from interface:HttpSecurityApplicationContext
Obtains a dependency.
-
doFlow
public void doFlow(F key, java.lang.Object parameter, FlowCallback callback)
Description copied from interface:HttpSecurityApplicationContext
Undertakes a flow.- Specified by:
doFlow
in interfaceHttpSecurityApplicationContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- Parameters:
key
- Key identifying the flow.parameter
- Parameter.callback
-FlowCallback
.
-
-