@FacetConstraints(value=@FacetConstraint(value=WebResourcesFacet.class,type=REQUIRED)) public interface ServletFacet<DESCRIPTOR extends org.jboss.shrinkwrap.descriptor.api.webapp.WebAppCommonDescriptor> extends JavaEEFacet, Configurable<DESCRIPTOR>, ProjectFacet
Project
supports features from the Servlet specification.Modifier and Type | Method and Description |
---|---|
void |
addLoginConfig(String authMethod,
String realmName)
Adds a login-config element to the web.xml of the current project.
|
void |
addSecurityConstraint(String displayName,
String webResourceName,
String webResourceDescription,
Iterable<String> httpMethods,
Iterable<String> urlPatterns,
Iterable<String> roleNames,
TransportGuarantee transportGuarantee)
Adds a security constraint to the current project.
|
void |
addSecurityRole(String roleName)
Adds a security role to the current project.
|
List<Resource<?>> |
getResources()
List all files in this
Project 's WebContent directory, recursively. |
List<Resource<?>> |
getResources(ResourceFilter filter)
List all files in this
Project 's WebContent directory, recursively, only if they match the given
ResourceFilter . |
List<String> |
getSecurityRoles()
Returns all the security roles defined for the current project.
|
DirectoryResource |
getWebInfDirectory()
Return a reference to the WEB-INF directory of this project.
|
boolean |
removeSecurityRole(String roleName)
Removes a security role from the current project.
|
getSpecName, getSpecVersion
getFaceted, install, isInstalled, uninstall
getConfig, getConfigFile, saveConfig
List<Resource<?>> getResources()
Project
's WebContent directory, recursively.List<Resource<?>> getResources(ResourceFilter filter)
Project
's WebContent directory, recursively, only if they match the given
ResourceFilter
.DirectoryResource getWebInfDirectory()
void addLoginConfig(String authMethod, String realmName)
authMethod
- The authentication mechanism for this login configrealmName
- The realm name to be used for the authentication scheme chosen for this login configvoid addSecurityRole(String roleName)
roleName
- The name of the security role. Must conform to the NMTOKEN lexical rulesList<String> getSecurityRoles()
boolean removeSecurityRole(String roleName)
roleName
- The name of the role that should be removedtrue
if the role was successfully removed. If for some reason, e.g. the role was not
found, the role could not be removed, returns false
.void addSecurityConstraint(String displayName, String webResourceName, String webResourceDescription, Iterable<String> httpMethods, Iterable<String> urlPatterns, Iterable<String> roleNames, TransportGuarantee transportGuarantee)
displayName
- The display name of the new security constraintswebResourceName
- The name of the web resource collection of the new security constraint. Cannot be nullwebResourceDescription
- The description of the web resource collection of the new security constrainthttpMethods
- The HTTP methods that are protected by the new security constraint. May be emptyurlPatterns
- The URL patterns that are protected by the new security constraint. May be emptyroleNames
- The role names which are part of the authentication constraint of the new security constraint. May be emptytransportGuarantee
- The user data constraint of the new security constraintCopyright © 2017 JBoss by Red Hat. All rights reserved.