Class Environment
java.lang.Object
com.aoapps.servlet.firewall.virtualhosts.Environment
-
Method Summary
Modifier and TypeMethodDescriptionadd
(DomainName domain, PartialURL... partialUrls) Adds new mappings to this environment.add
(DomainName domain, Iterable<? extends PartialURL> partialUrls) Adds new mappings to this environment.add
(Map<? extends PartialURL, ? extends DomainName> newMappings) Adds new mappings to this environment.getName()
Gets the unique name of this environment.getPartialURLs
(DomainName domain) Gets an unmodifiable copy of all the partial URLs registered for a given virtual host.getPrimary
(DomainName domain) Gets the primary partial URL for the given virtual host.toString()
-
Method Details
-
toString
-
getManager
-
getName
Gets the unique name of this environment. -
add
Adds new mappings to this environment. Allvirtual hosts
referenced by the environment must already exist.- Throws:
IllegalStateException
- If the virtual host does not exist or the environment already contains any of the newpartial URLs
.- See Also:
-
add
public Environment add(DomainName domain, Iterable<? extends PartialURL> partialUrls) throws IllegalArgumentException, IllegalStateException Adds new mappings to this environment.- Parameters:
domain
- Thevirtual host
must already exist.partialUrls
- May not be empty. Duplicate values are not OK. The firstpartial URL
for a given domain is theprimary
.- Throws:
IllegalArgumentException
- whenpartialURLs
contains duplicate valuesIllegalStateException
- If the virtual host does not exist or the environment already contains any of the newpartial URLs
.- See Also:
-
add
public Environment add(DomainName domain, PartialURL... partialUrls) throws IllegalArgumentException, IllegalStateException Adds new mappings to this environment.- Parameters:
domain
- Thevirtual host
must already exist.partialUrls
- May not be empty. Duplicate values are not OK. The firstpartial URL
for a given domain is theprimary
.- Throws:
IllegalArgumentException
- whenpartialURLs
contains duplicate valuesIllegalStateException
- If the virtual host does not exist or the environment already contains any of the newpartial URLs
.- See Also:
-
getPrimary
Gets the primary partial URL for the given virtual host. This is the same as the first partial URL fromgetPartialURLs(com.aoapps.net.DomainName)
.- Returns:
- the primary partial URL or
null
when the virtual host has not been added to this environment. - See Also:
-
getPartialURLs
Gets an unmodifiable copy of all the partial URLs registered for a given virtual host. The first partial URL is theprimary
.- Returns:
- the set of partial URLs or an empty set when the virtual host has not been added to this environment.
-