Class 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("/*");
          Set httpMethods = new HashSet();
          httpMethods.add("GET");
          httpMethods.add("POST");
          webResource.setHttpMethods(httpMethods);
     
    Author:
    Rajiv Mordani, Amy Roh
    See Also:
    SecurityConfig
    • Constructor Detail

      • WebResourceCollection

        public WebResourceCollection()
    • 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
      • toString

        public String toString()
        Returns a formatted string of the state.
        Overrides:
        toString in class Object