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 Enum<O>,F extends Enum<F>>
extends Object
implements HttpSecurityActionContext, HttpSecurityApplicationContext<O,F>
Abstract mock
HttpSecurityActionContext and
HttpSecurityApplicationContext.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ServerHttpConnectionDependencies.protected final Map<F,BiConsumer<Object, FlowCallback>> Flowhandlers.protected final HttpRequestStateprotected final HttpSession -
Constructor Summary
ConstructorsConstructorDescriptionInitiate.Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFlow(F key, Object parameter, FlowCallback callback) Undertakes a flow.Obtains theServerHttpConnection.Obtains a dependency.getQualifiedAttributeName(String attributeName) Qualifies the attribute name to thisHttpSecurityinstance.Obtains theHttpRequestState.Obtains theHttpSession.voidregisterFlow(F key, BiConsumer<Object, FlowCallback> handler) Registers aFlowhandler.voidregisterObject(O key, Object dependency) Registers a dependency.
-
Field Details
-
connection
-
session
-
requestState
-
dependencies
Dependencies. -
flows
Flowhandlers.
-
-
Constructor Details
-
AbstractMockHttpSecurityActionContext
public AbstractMockHttpSecurityActionContext()Initiate. -
AbstractMockHttpSecurityActionContext
Initiate.- Parameters:
connection-ServerHttpConnection.
-
-
Method Details
-
registerObject
Registers a dependency.- Parameters:
key- Key for dependency.dependency- Dependency object.
-
registerFlow
Registers aFlowhandler. -
getConnection
Description copied from interface:HttpSecurityActionContextObtains theServerHttpConnection.- Specified by:
getConnectionin interfaceHttpSecurityActionContext- Returns:
ServerHttpConnection.
-
getQualifiedAttributeName
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
Description copied from interface:HttpSecurityActionContextObtains theHttpSession.- Specified by:
getSessionin interfaceHttpSecurityActionContext- Returns:
HttpSession.
-
getRequestState
Description copied from interface:HttpSecurityActionContextObtains theHttpRequestState.- Specified by:
getRequestStatein interfaceHttpSecurityActionContext- Returns:
HttpRequestState.
-
getObject
Description copied from interface:HttpSecurityApplicationContextObtains a dependency. -
doFlow
Description copied from interface:HttpSecurityApplicationContextUndertakes a flow.- Specified by:
doFlowin interfaceHttpSecurityApplicationContext<O extends Enum<O>,F extends Enum<F>> - Parameters:
key- Key identifying the flow.parameter- Parameter.callback-FlowCallback.
-