Top Description Fields Constructors Methods
org.apache.tomcat.util.descriptor.web

public Class SecurityCollection

extends XmlEncodingBase
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.nio.charset.StandardCharsets, java.util.Arrays, org.apache.tomcat.util.buf.UDecoder

Representation of a web resource collection for a web application's security constraint, as represented in a <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.

Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
private String
description

Description of this web resource collection.

private boolean
isFromDescriptor

This security collection was established by a deployment descriptor.

private String[]
methods

The HTTP methods explicitly covered by this web resource collection.

private String
name

The name of this web resource collection.

private String[]
omittedMethods

The HTTP methods explicitly excluded from this web resource collection.

private String[]
patterns

The URL patterns protected by this security collection.

private static final long

Constructor Summary

AccessConstructor and Description
public
SecurityCollection()

Construct a new security collection instance with default values.

public
SecurityCollection(String
Name of this security collection
name
,
String
Description of this security collection
description
)

Construct a new security collection instance with specified values.

Method Summary

Modifier and TypeMethod and Description
public void
addMethod(String
The method
method
)

Add an HTTP request method to be explicitly part of this web resource collection.

public void
addOmittedMethod(String
The method
method
)

Add an HTTP request method to the methods explicitly excluded from this web resource collection.

public void
addPattern(String
The pattern
pattern
)

Add a URL pattern to be part of this web resource collection.

public void
public boolean

Returns:

true if the specified HTTP request method is part of this web resource collection.
findMethod
(String
Request method to check
method
)

Check if the collection applies to the specified method.

public String[]

Returns:

the set of HTTP request methods that are part of this web resource collection, or a zero-length array if no methods have been explicitly included.
findMethods
()

public String[]

Returns:

the set of HTTP request methods that are explicitly excluded from this web resource collection, or a zero-length array if no request methods are excluded.
findOmittedMethods
()

public boolean

Returns:

true if the pattern is part of the collection
findPattern
(String
Pattern to be compared
pattern
)

Is the specified pattern part of this web resource collection?

public String[]

Returns:

the set of URL patterns that are part of this web resource collection. If none have been specified, a zero-length array is returned.
findPatterns
()

public String

Returns:

the description of this web resource collection.
getDescription
()

public String

Returns:

the name of this web resource collection.
getName
()

public boolean

Returns:

if this constraint was defined in a deployment descriptor.
isFromDescriptor
()

public void
removeMethod(String
Request method to be removed
method
)

Remove the specified HTTP request method from those that are part of this web resource collection.

public void
removeOmittedMethod(String
Request method to be removed
method
)

Remove the specified HTTP request method from those that are explicitly excluded from this web resource collection.

public void
removePattern(String
Pattern to be removed
pattern
)

Remove the specified URL pattern from those that are part of this web resource collection.

public void
setDescription(String
The new description
description
)

Set the description of this web resource collection.

public void
setFromDescriptor(boolean
true was declared in a descriptor
isFromDescriptor
)

Set if this constraint was defined in a deployment descriptor.

public void
setName(String
The new name
name
)

Set the name of this web resource collection

public String
toString()

Overrides java.lang.Object.toString.

Return a String representation of this security collection.

Inherited from org.apache.tomcat.util.descriptor.web.XmlEncodingBase:
getCharsetsetCharset

Field Detail

descriptionback to summary
private String description

Description of this web resource collection.

isFromDescriptorback to summary
private boolean isFromDescriptor

This security collection was established by a deployment descriptor. Defaults to true.

methodsback to summary
private String[] methods

The HTTP methods explicitly covered by this web resource collection.

nameback to summary
private String name

The name of this web resource collection.

omittedMethodsback to summary
private String[] omittedMethods

The HTTP methods explicitly excluded from this web resource collection.

patternsback to summary
private String[] patterns

The URL patterns protected by this security collection.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

SecurityCollectionback to summary
public SecurityCollection()

Construct a new security collection instance with default values.

SecurityCollectionback to summary
public SecurityCollection(String name, String description)

Construct a new security collection instance with specified values.

Parameters
name:String

Name of this security collection

description:String

Description of this security collection

Method Detail

addMethodback to summary
public void addMethod(String method)

Add an HTTP request method to be explicitly part of this web resource collection.

Parameters
method:String

The method

addOmittedMethodback to summary
public void addOmittedMethod(String method)

Add an HTTP request method to the methods explicitly excluded from this web resource collection.

Parameters
method:String

The method

addPatternback to summary
public void addPattern(String pattern)

Add a URL pattern to be part of this web resource collection.

Parameters
pattern:String

The pattern

addPatternDecodedback to summary
public void addPatternDecoded(String pattern)
findMethodback to summary
public boolean findMethod(String method)

Check if the collection applies to the specified method.

Parameters
method:String

Request method to check

Returns:boolean

true if the specified HTTP request method is part of this web resource collection.

findMethodsback to summary
public String[] findMethods()
Returns:String[]

the set of HTTP request methods that are part of this web resource collection, or a zero-length array if no methods have been explicitly included.

findOmittedMethodsback to summary
public String[] findOmittedMethods()
Returns:String[]

the set of HTTP request methods that are explicitly excluded from this web resource collection, or a zero-length array if no request methods are excluded.

findPatternback to summary
public boolean findPattern(String pattern)

Is the specified pattern part of this web resource collection?

Parameters
pattern:String

Pattern to be compared

Returns:boolean

true if the pattern is part of the collection

findPatternsback to summary
public String[] findPatterns()
Returns:String[]

the set of URL patterns that are part of this web resource collection. If none have been specified, a zero-length array is returned.

getDescriptionback to summary
public String getDescription()
Returns:String

the description of this web resource collection.

getNameback to summary
public String getName()
Returns:String

the name of this web resource collection.

isFromDescriptorback to summary
public boolean isFromDescriptor()
Returns:boolean

if this constraint was defined in a deployment descriptor.

removeMethodback to summary
public void removeMethod(String method)

Remove the specified HTTP request method from those that are part of this web resource collection.

Parameters
method:String

Request method to be removed

removeOmittedMethodback to summary
public void removeOmittedMethod(String method)

Remove the specified HTTP request method from those that are explicitly excluded from this web resource collection.

Parameters
method:String

Request method to be removed

removePatternback to summary
public void removePattern(String pattern)

Remove the specified URL pattern from those that are part of this web resource collection.

Parameters
pattern:String

Pattern to be removed

setDescriptionback to summary
public void setDescription(String description)

Set the description of this web resource collection.

Parameters
description:String

The new description

setFromDescriptorback to summary
public void setFromDescriptor(boolean isFromDescriptor)

Set if this constraint was defined in a deployment descriptor.

Parameters
isFromDescriptor:boolean

true was declared in a descriptor

setNameback to summary
public void setName(String name)

Set the name of this web resource collection

Parameters
name:String

The new name

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a String representation of this security collection.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override