|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.policies.URLSubtree
public class URLSubtree
This Subtree implementation specifies a subtree of Entries identified by URL. It uses a issrg.utils.ParsedURL utility class to decompose the URL and identify the patterns in it, hence support for HTTP-like URLs.
The format of the URL is described in issrg.utils.ParsedURL. Note that the host name is either a valid DNS name, or an IP address, or "*"; the port can be a number specifying a single port, or a range of ports specified as number "-" number.
To match the URLSubtree, the Entry must:
During path normalisation all the "." and ".." (current directory and parent directory respectively) are dereferenced, as explained in issrg.utils.ParsedURL.
Field Summary | |
---|---|
protected java.lang.String[] |
altIP
|
static java.lang.String |
ANY_HOST
Wildcard used in the policy to specify any host - so any host will be matched as part of the URL subtree. |
protected int |
defaultPort
|
protected Subtree[] |
exclude
|
static java.lang.String |
LOCALHOST
|
protected int |
max
|
protected int |
maxPort
|
protected int |
min
|
protected int |
minPort
|
protected ParsedURL |
pu
|
Constructor Summary | |
---|---|
protected |
URLSubtree()
|
|
URLSubtree(java.lang.String url,
int defaultPort,
int min,
int max,
Subtree[] exclude)
This constructor builds a URLSubtree, given a URL string (exceptions are outlined below), a default port, the min and max levels from the base directory. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
contains(Entry e)
This method tests whether Entry e is part of this Subtree. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ANY_HOST
public static final java.lang.String LOCALHOST
protected int defaultPort
protected int min
protected int max
protected int minPort
protected int maxPort
protected ParsedURL pu
protected Subtree[] exclude
protected java.lang.String[] altIP
Constructor Detail |
---|
protected URLSubtree()
public URLSubtree(java.lang.String url, int defaultPort, int min, int max, Subtree[] exclude) throws BadURLException
The URL may contain a range of ports, not just one port. The range is specified as nn-mm, where nn is the starting port number, and mm - the ending port number. The subtree then matches any URLs with the port matching any of the numbers between nn and mm, inclusive.
If the URL has the host specified by DNS name, then its IP addresses will be looked up, so that the Entries will match the Subtree by either of the IP addresses, or by the DNS name. If the host is specified as a wildcard "*", Entries with any host will match.
url
- is the URL stringdefaultPort
- is the default port to assume for Entries with URLs
that do not specify any portmin
- is the minimum number of levels below the base URL that the
Entry URL should be in; if the Entry is above this level, it doesn't
match this subtreemax
- is the maximum number of levels below the base URL that the
Entry URL should be in; if the Entry is below this level, it doesn't
match this subtree
BadURLException,
- if the url string doesn't match the URL
specification
(except for the port range bit), or the port numbers are not valid
integers
BadURLException
Method Detail |
---|
public boolean contains(Entry e)
contains
in interface Subtree
e
- - the Entry to check
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |