public class SecurityCollection extends Object implements Serializable
<web-resource-collection>
element in the deployment descriptor.
WARNING: It is assumed that instances of this class will be created and modified only within the context of a single thread, before the instance is made visible to the remainder of the application. After that, only read access is expected. Therefore, none of the read and write access within this class is synchronized.
Constructor and Description |
---|
SecurityCollection()
Construct a new security collection instance with default values.
|
SecurityCollection(String name,
String description)
Construct a new security collection instance with specified values.
|
Modifier and Type | Method and Description |
---|---|
void |
addMethod(String method)
Add an HTTP request method to be explicitly part of this web resource
collection.
|
void |
addOmittedMethod(String method)
Add an HTTP request method to the methods explicitly excluded from this
web resource collection.
|
void |
addPattern(String pattern)
Add a URL pattern to be part of this web resource collection.
|
boolean |
findMethod(String method)
Check if the collection applies to the specified method.
|
String[] |
findMethods() |
String[] |
findOmittedMethods() |
boolean |
findPattern(String pattern)
Is the specified pattern part of this web resource collection?
|
String[] |
findPatterns() |
String |
getDescription() |
String |
getName() |
boolean |
isFromDescriptor() |
void |
removeMethod(String method)
Remove the specified HTTP request method from those that are part
of this web resource collection.
|
void |
removeOmittedMethod(String method)
Remove the specified HTTP request method from those that are explicitly
excluded from this web resource collection.
|
void |
removePattern(String pattern)
Remove the specified URL pattern from those that are part of this
web resource collection.
|
void |
setDescription(String description)
Set the description of this web resource collection.
|
void |
setFromDescriptor(boolean isFromDescriptor)
Set if this constraint was defined in a deployment descriptor.
|
void |
setName(String name)
Set the name of this web resource collection
|
String |
toString()
Return a String representation of this security collection.
|
public SecurityCollection()
public String getDescription()
public void setDescription(String description)
description
- The new descriptionpublic String getName()
public void setName(String name)
name
- The new namepublic boolean isFromDescriptor()
public void setFromDescriptor(boolean isFromDescriptor)
isFromDescriptor
- true
was declared in a descriptorpublic void addMethod(String method)
method
- The methodpublic void addOmittedMethod(String method)
method
- The methodpublic void addPattern(String pattern)
pattern
- The patternpublic boolean findMethod(String method)
method
- Request method to checktrue
if the specified HTTP request method is
part of this web resource collection.public String[] findMethods()
public String[] findOmittedMethods()
public boolean findPattern(String pattern)
pattern
- Pattern to be comparedtrue
if the pattern is part of the collectionpublic String[] findPatterns()
public void removeMethod(String method)
method
- Request method to be removedpublic void removeOmittedMethod(String method)
method
- Request method to be removedpublic void removePattern(String pattern)
pattern
- Pattern to be removedCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.