|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.URLHandler issrg.pba.rbac.LDAPURLHandler
public class LDAPURLHandler
This class handles LDAP URLs. It can create LDAPDNPrincipals, LDAPEntries DITSubtrees and LDAPRepositories given a URL.
Field Summary | |
---|---|
static int |
LDAP_PORT
|
static java.lang.String |
LDAP_PROTOCOL
|
Fields inherited from class issrg.pba.rbac.URLHandler |
---|
defaultPort, FILE_PORT, FILE_PROTOCOL, HTTP_PORT, HTTP_PROTOCOL, HTTPS_PORT, HTTPS_PROTOCOL, protocol, VOMS_SAML_PROTOCOL |
Constructor Summary | |
---|---|
LDAPURLHandler()
|
Method Summary | |
---|---|
int |
getDefaultPort()
This method returns the number of the defaul port that the protocol listens on |
Entry |
getEntry(java.lang.String url)
This method builds an Entry object given a LDAP URL. |
java.security.Principal |
getPrincipal(java.lang.String url)
Not implemented yet. |
java.lang.String |
getProtocol()
This method returns the string name of the protocol (without the trailing colon). |
AttributeRepository |
getRepository(java.lang.String url)
This method builds a LDAPRepository from the given URL, if it is a LDAP URL. |
Subtree |
getSubtree(java.lang.String url,
int min,
int max,
Subtree[] exclude)
This method builds a LDAP subtree (DITSubtree) starting at the node specified by an LDAP URL, min and max, and an array of excluded subtrees. |
Methods inherited from class issrg.pba.rbac.URLHandler |
---|
addProtocol, getEntryByURL, getPrincipalByURL, getProtocolName, getRepositoryByURL, getSubtreeByURL, getURLHandler, removeProtocol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LDAP_PROTOCOL
public static final int LDAP_PORT
Constructor Detail |
---|
public LDAPURLHandler()
Method Detail |
---|
public java.lang.String getProtocol()
URLHandler
getProtocol
in class URLHandler
public int getDefaultPort()
URLHandler
getDefaultPort
in class URLHandler
public java.security.Principal getPrincipal(java.lang.String url) throws BadURLException
getPrincipal
in class URLHandler
url
- the string representation of the HTTP URL (including the
protocol name part)
(the actual protocol name is checked with the string returned by
getProtocol,
but the format of the rest of the URL is as specified in HTTP RFC)
BadURLException
- if the URL is malformedpublic Entry getEntry(java.lang.String url) throws BadURLException
getEntry
in class URLHandler
url
- - the LDAP URL pointing to an entry in LDAP
BadURLException,
- if it is a malformed LDAP URL.
BadURLException
- if the URL is malformedpublic Subtree getSubtree(java.lang.String url, int min, int max, Subtree[] exclude) throws BadURLException
The LDAP URL points to the root entry of the subtree. The min and max identify where the tree starts and ends, as defined in the subtree specification in X.500 standard: if the tree is represented as a collection of paths from the root entry to the leaf nodes, then min tells how many hops down the path the tree starts, and the max tells how many hops down the path the tree ends. The excluded subtrees are the subtrees excluded from the root. The method does not check if the excluded subtrees are actually contained in the subtree.
Example:
root="o=permis,c=gb", min=0, max=-1
root="o=permis,c=gb", min=1, max=2, excludes={root="ou=test,o=permis,c=gb", min=0, max=-1}
getSubtree
in class URLHandler
url
- - the URL identifying the entry of the root of the subtreemin
- - the integer specifying how many hops down the tree from the
root entry the subtree starts; must be non-negativemax
- - the integer specifying how many hops down the tree from the
root entry the subtree ends; if less than zero, then no constraint on
the maximum height of the tree is specifiedexclude
- - an array of excluded Subtrees
BadURLException
- if the URL is malformedSubtree
public AttributeRepository getRepository(java.lang.String url) throws BadURLException
getRepository
in class URLHandler
url
- - the URL of the repository
BadURLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |