Class WebResourceCollection
- java.lang.Object
-
- org.glassfish.embeddable.web.config.WebResourceCollection
-
public class WebResourceCollection extends Object
This class represents a list of URL patterns and HTTP methods that describe a set of Web resources to be protected. Usage example:WebResourceCollection webResource = new WebResourceCollection(); webResource.setName("protected"); webResource.setUrlPatterns("/*"); SethttpMethods = new HashSet (); httpMethods.add("GET"); httpMethods.add("POST"); webResource.setHttpMethods(httpMethods); - Author:
- Rajiv Mordani, Amy Roh
- See Also:
SecurityConfig
-
-
Constructor Summary
Constructors Constructor Description WebResourceCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getHttpMethodOmissions()Gets the HTTP methods to be omitted from protectionSet<String>getHttpMethods()Gets the HTTP methods that should be protectedStringgetName()Gets the name of this collectionSet<String>getUrlPatterns()Gets the url patterns that correspond to this web resourcevoidsetHttpMethodOmissions(Set<String> httpMethodOmissions)Sets the HTTP methods to be omitted from protectionvoidsetHttpMethods(Set<String> httpMethods)Sets the HTTP methods that should be protectedvoidsetName(String name)Sets the name of this collectionvoidsetUrlPatterns(Set<String> urlPatterns)Sets the url patterns that correspond to this web resourceStringtoString()Returns a formatted string of the state.
-
-
-
Method Detail
-
setName
public void setName(String name)
Sets the name of this collection- Parameters:
name- the name of this collection
-
getName
public String getName()
Gets the name of this collection- Returns:
- the name of this collection
-
setUrlPatterns
public void setUrlPatterns(Set<String> urlPatterns)
Sets the url patterns that correspond to this web resource- Parameters:
urlPatterns- the url patterns
-
getUrlPatterns
public Set<String> getUrlPatterns()
Gets the url patterns that correspond to this web resource- Returns:
- the url patterns
-
setHttpMethods
public void setHttpMethods(Set<String> httpMethods) throws GlassFishException
Sets the HTTP methods that should be protected- Parameters:
httpMethods- the HTTP methods- Throws:
GlassFishException- if HttpMethodOmissions is already defined
-
getHttpMethods
public Set<String> getHttpMethods()
Gets the HTTP methods that should be protected- Returns:
- the HTTP methods
-
setHttpMethodOmissions
public void setHttpMethodOmissions(Set<String> httpMethodOmissions) throws GlassFishException
Sets the HTTP methods to be omitted from protection- Parameters:
httpMethodOmissions- the HTTP methods to be omitted from protection- Throws:
GlassFishException- if HttpMethods is already defined
-
getHttpMethodOmissions
public Set<String> getHttpMethodOmissions()
Gets the HTTP methods to be omitted from protection- Returns:
- the HTTP methods to be omitted from protection
-
-