Class MockHttpAuthenticateContext<AC extends java.io.Serializable,O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext<O,F>
-
- net.officefloor.web.security.scheme.MockHttpAuthenticateContext<AC,O,F>
-
- All Implemented Interfaces:
AccessControlListener<AC>
,AuthenticateContext<AC,O,F>
,HttpSecurityActionContext
,HttpSecurityApplicationContext<O,F>
public class MockHttpAuthenticateContext<AC extends java.io.Serializable,O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends AbstractMockHttpSecurityActionContext<O,F> implements AuthenticateContext<AC,O,F>
MockAuthenticateContext
for testingHttpSecuritySource
instances.- Author:
- Daniel Sagenschneider
-
-
Field Summary
-
Fields inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
connection, dependencies, flows, requestState, session
-
-
Constructor Summary
Constructors Constructor Description MockHttpAuthenticateContext()
Initiate with noauthorization
HttpHeader
.MockHttpAuthenticateContext(java.lang.String authorizationHeaderValue)
Initiate.MockHttpAuthenticateContext(ServerHttpConnection connection)
Initiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accessControlChange(AC accessControl, java.lang.Throwable escalation)
Notified of a change to access control.static ServerHttpConnection
createRequestWithAuthorizationHeader(java.lang.String authorizationHeaderValue)
Creates theServerHttpConnection
with authorizationHttpHeader
value.AC
getAccessControl()
Obtains the registered access control.java.lang.Throwable
getEscalation()
Obtains the registered escalation.-
Methods inherited from class net.officefloor.web.security.scheme.AbstractMockHttpSecurityActionContext
doFlow, getConnection, getObject, getQualifiedAttributeName, getRequestState, getSession, registerFlow, registerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.web.spi.security.HttpSecurityActionContext
getConnection, getQualifiedAttributeName, getRequestState, getSession
-
Methods inherited from interface net.officefloor.web.spi.security.HttpSecurityApplicationContext
doFlow, getObject
-
-
-
-
Constructor Detail
-
MockHttpAuthenticateContext
public MockHttpAuthenticateContext()
Initiate with noauthorization
HttpHeader
.
-
MockHttpAuthenticateContext
public MockHttpAuthenticateContext(java.lang.String authorizationHeaderValue)
Initiate.- Parameters:
authorizationHeaderValue
-authorization
HttpHeader
value.
-
MockHttpAuthenticateContext
public MockHttpAuthenticateContext(ServerHttpConnection connection)
Initiate.- Parameters:
connection
-ServerHttpConnection
.
-
-
Method Detail
-
createRequestWithAuthorizationHeader
public static ServerHttpConnection createRequestWithAuthorizationHeader(java.lang.String authorizationHeaderValue)
Creates theServerHttpConnection
with authorizationHttpHeader
value.- Parameters:
authorizationHeaderValue
- AuthorizationHttpHeader
value.- Returns:
ServerHttpConnection
.
-
getAccessControl
public AC getAccessControl()
Obtains the registered access control.- Returns:
- Access control.
-
getEscalation
public java.lang.Throwable getEscalation()
Obtains the registered escalation.- Returns:
- Escalation.
-
accessControlChange
public void accessControlChange(AC accessControl, java.lang.Throwable escalation)
Description copied from interface:AccessControlListener
Notified of a change to access control.- Specified by:
accessControlChange
in interfaceAccessControlListener<AC extends java.io.Serializable>
- Parameters:
accessControl
- Access control. May benull
if- logging out
- failure in authenticating
escalation
- PossibleEscalation
. Will benull
if successfully obtain access control or logout.
-
-