public class SecurityConfigurationModel extends ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>
Single configuration class for 3 top-level elements of web.xml:
<login-config> (1 per context):org.eclipse.jetty.security.SecurityHandler#setRealmName() + few othersorg.apache.catalina.Context#setLoginConfig()io.undertow.servlet.api.DeploymentInfo#setLoginConfig()<security-constraint> (N per context):org.eclipse.jetty.security.ConstraintAware#addConstraintMapping()org.apache.catalina.Context#addConstraint()io.undertow.servlet.api.DeploymentInfo#addSecurityConstraint()<security-role> (N per context):org.eclipse.jetty.security.ConstraintSecurityHandler#setRoles()org.apache.catalina.Context#addSecurityRole()io.undertow.servlet.api.DeploymentInfo#addSecurityRole()Additionally, security declarations may be passed through ServletRegistration.Dynamic.setServletSecurity(javax.servlet.ServletSecurityElement)
and for example, Tomcat passes the arguments to org.apache.catalina.core.StandardContext#addServletSecurity().
contextModels, contextModelsInfo, dtoFailureCode, isValid| Constructor and Description |
|---|
SecurityConfigurationModel() |
| Modifier and Type | Method and Description |
|---|---|
SecurityConfigurationEventData |
asEventData()
When sending events related to
ElementModel we can't use the same instance which is kept in
ServerModel, we have to copy relevant
information to lightweight object. |
LoginConfigModel |
getLoginConfig()
Returns a single, context-wide login configuration matching
<login-config> element
from web.xml. |
List<SecurityConstraintModel> |
getSecurityConstraints()
Returns a list of constraints matching the
<security-constraint> elements from web.xml. |
Set<String> |
getSecurityRoles()
Returns a list of roles matching the
<security-role>/<role-name> elements from web.xml. |
Boolean |
performValidation()
Perform element-specific validation and throws different exceptions for all element-specific validation
problems.
|
void |
register(WhiteboardWebContainerView view)
Each
ElementModel can register itself as Whiteboard element. |
void |
setLoginConfig(LoginConfigModel loginConfig) |
String |
toString() |
void |
unregister(WhiteboardWebContainerView view)
Each
ElementModel can unregister itself as Whiteboard element. |
addContextModel, changeContextModels, compareTo, equals, getContextFilter, getContextModels, getContextModelsInfo, getContextSelector, getDtoFailureCode, getElementReference, getElementSupplier, getRegisteringBundle, getServiceId, getServiceRank, getTimestamp, hasContextModels, hashCode, isAsynchronusRegistration, isPrototype, isValid, resetContextModels, setAsynchronusRegistration, setCommonEventProperties, setContextSelectFilter, setContextSelector, setDtoFailureCode, setElementReference, setElementSupplier, setRegisteringBundle, setServiceId, setServiceRank, setTimestampgetId, getIdPrefix, getNumericIdpublic LoginConfigModel getLoginConfig()
<login-config> element
from web.xml.public void setLoginConfig(LoginConfigModel loginConfig)
public List<SecurityConstraintModel> getSecurityConstraints()
<security-constraint> elements from web.xml.public Set<String> getSecurityRoles()
<security-role>/<role-name> elements from web.xml.public void register(WhiteboardWebContainerView view)
ElementModelElementModel can register itself as Whiteboard element.register in class ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>public void unregister(WhiteboardWebContainerView view)
ElementModelElementModel can unregister itself as Whiteboard element.unregister in class ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>public String toString()
toString in class ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>public Boolean performValidation() throws Exception
ElementModelPerform element-specific validation and throws different exceptions for all element-specific validation problems. This method should not be called for Whiteboard purposes, where "failure DTO" has to be configured.
This method should be called in Http Service scenario where we immediately need strong feedback - with exceptions thrown for all validation problems. In Whiteboard scenario, the exception is caught, logged and it's the tracker that prevents further registration.
This method may alter the state of the model when (which is possible during validation) some extra information is obtained/compiled/processed.
performValidation in class ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>Exceptionpublic SecurityConfigurationEventData asEventData()
ElementModelElementModel we can't use the same instance which is kept in
ServerModel, we have to copy relevant
information to lightweight object.asEventData in class ElementModel<org.ops4j.pax.web.service.whiteboard.SecurityConfigurationMapping,SecurityConfigurationEventData>Copyright © 2006–2024 OPS4J - Open Participation Software for Java. All rights reserved.