Class MockHttpRatifyContext<AC extends java.io.Serializable>
- java.lang.Object
-
- net.officefloor.web.security.scheme.MockHttpRatifyContext<AC>
-
- All Implemented Interfaces:
AccessControlListener<AC>
,HttpSecurityActionContext
,RatifyContext<AC>
public class MockHttpRatifyContext<AC extends java.io.Serializable> extends java.lang.Object implements RatifyContext<AC>
MockRatifyContext
for testingHttpSecuritySource
instances.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MockHttpRatifyContext()
Initiate with noauthorization
HttpHeader
.MockHttpRatifyContext(java.lang.String authorizationHeaderValue)
Initiate.MockHttpRatifyContext(ServerHttpConnection connection)
Initiate.
-
Method Summary
All 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.AC
getAccessControl()
Obtains the access control.ServerHttpConnection
getConnection()
Obtains theServerHttpConnection
.java.lang.Throwable
getEscalation()
Obtains the registered escalation.java.lang.String
getQualifiedAttributeName(java.lang.String attributeName)
Qualifies the attribute name to thisHttpSecurity
instance.HttpRequestState
getRequestState()
Obtains theHttpRequestState
.HttpSession
getSession()
Obtains theHttpSession
.
-
-
-
Constructor Detail
-
MockHttpRatifyContext
public MockHttpRatifyContext()
Initiate with noauthorization
HttpHeader
.
-
MockHttpRatifyContext
public MockHttpRatifyContext(java.lang.String authorizationHeaderValue)
Initiate.- Parameters:
authorizationHeaderValue
-authorization
HttpHeader
value.
-
MockHttpRatifyContext
public MockHttpRatifyContext(ServerHttpConnection connection)
Initiate.- Parameters:
connection
-ServerHttpConnection
.
-
-
Method Detail
-
getAccessControl
public AC getAccessControl()
Obtains the access control.- Returns:
- Access control.
-
getEscalation
public java.lang.Throwable getEscalation()
Obtains the registered escalation.- Returns:
Escalation
.
-
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
.
-
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.
-
-