Class MockHttpRatifyContext<AC extends Serializable>
java.lang.Object
net.officefloor.web.security.scheme.MockHttpRatifyContext<AC>
- All Implemented Interfaces:
AccessControlListener<AC>,HttpSecurityActionContext,RatifyContext<AC>
public class MockHttpRatifyContext<AC extends Serializable>
extends Object
implements RatifyContext<AC>
Mock
RatifyContext for testing HttpSecuritySource instances.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionInitiate with noauthorizationHttpHeader.MockHttpRatifyContext(String authorizationHeaderValue) Initiate.MockHttpRatifyContext(ServerHttpConnection connection) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessControlChange(AC accessControl, Throwable escalation) Notified of a change to access control.Obtains the access control.Obtains theServerHttpConnection.Obtains the registered escalation.getQualifiedAttributeName(String attributeName) Qualifies the attribute name to thisHttpSecurityinstance.Obtains theHttpRequestState.Obtains theHttpSession.
-
Constructor Details
-
MockHttpRatifyContext
public MockHttpRatifyContext()Initiate with noauthorizationHttpHeader. -
MockHttpRatifyContext
Initiate.- Parameters:
authorizationHeaderValue-authorizationHttpHeadervalue.
-
MockHttpRatifyContext
Initiate.- Parameters:
connection-ServerHttpConnection.
-
-
Method Details
-
getAccessControl
Obtains the access control.- Returns:
- Access control.
-
getEscalation
Obtains the registered escalation.- Returns:
Escalation.
-
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.
-
accessControlChange
Description copied from interface:AccessControlListenerNotified of a change to access control.- Specified by:
accessControlChangein interfaceAccessControlListener<AC extends Serializable>- Parameters:
accessControl- Access control. May benullif- logging out
- failure in authenticating
escalation- PossibleEscalation. Will benullif successfully obtain access control or logout.
-