issrg.test.pmi
Class PMITest.XMLURLHandler

java.lang.Object
  extended by issrg.pba.rbac.URLHandler
      extended by issrg.test.pmi.PMITest.XMLURLHandler
Enclosing class:
PMITest

public static class PMITest.XMLURLHandler
extends URLHandler

This URLHandler constructs PMIXMLRepository given a xml: URL. It does not construct anything else, a BadURLException is thrown in all other methods


Field Summary
 
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
protected PMITest.XMLURLHandler()
           
 
Method Summary
 Entry getEntry(java.lang.String url)
          This method returns an Entry identified by a given HTTP URL.
 java.security.Principal getPrincipal(java.lang.String url)
          This method returns a Principal for a given HTTP URL string.
 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 returns an instance of a repository that would be able to retrieve attributes given the URL.
 Subtree getSubtree(java.lang.String url, int min, int max, Subtree[] exclude)
          This method returns a Subtree specified using a Base Entry URL and Min and Max level specifications.
 
Methods inherited from class issrg.pba.rbac.URLHandler
addProtocol, getDefaultPort, 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
 

Constructor Detail

PMITest.XMLURLHandler

protected PMITest.XMLURLHandler()
Method Detail

getProtocol

public java.lang.String getProtocol()
Description copied from class: URLHandler
This method returns the string name of the protocol (without the trailing colon). The protocol is in lowercase letters.

Overrides:
getProtocol in class URLHandler
Returns:
string name of the protocol in lowercase characters

getPrincipal

public java.security.Principal getPrincipal(java.lang.String url)
                                     throws BadURLException
Description copied from class: URLHandler
This method returns a Principal for a given HTTP URL string. It checks if the passed URL string matches the protocol this Handler is registered for.

Overrides:
getPrincipal in class URLHandler
Parameters:
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)
Returns:
Principal of the corresponding URL
Throws:
BadURLException - if the URL is malformed

getEntry

public Entry getEntry(java.lang.String url)
               throws BadURLException
Description copied from class: URLHandler
This method returns an Entry identified by a given HTTP URL.

This URLHandler does (Entry)getPrincipal(url) - so if your Principal implements the Entry interface, you can leave the getEntry method.

Overrides:
getEntry in class URLHandler
Parameters:
url - the string representation of the HTTP URL (see comments for getPrincipal method)
Returns:
Entry identified by the URL
Throws:
BadURLException - if the URL is malformed

getSubtree

public Subtree getSubtree(java.lang.String url,
                          int min,
                          int max,
                          Subtree[] exclude)
                   throws BadURLException
Description copied from class: URLHandler
This method returns a Subtree specified using a Base Entry URL and Min and Max level specifications.

Overrides:
getSubtree in class URLHandler
Parameters:
url - the URL of the Base Entry; port may be specified as a range of ports by using nn-mm notation (two numbers separated by hyphen); if no port is specified, any port matches the subtree specification
min - the Min value for the subtree
max - the Max value for the subtree
Throws:
BadURLException - if the URL is malformed
See Also:
Subtree

getRepository

public AttributeRepository getRepository(java.lang.String url)
                                  throws BadURLException
Description copied from class: URLHandler
This method returns an instance of a repository that would be able to retrieve attributes given the URL. Some Repositories may use only the host part of the URL to connect to the server, ignoring the path part.

In this version of the URLHandler, no HTTP/HTTPS repositories are implemented, so null is returned for such URLs.

Overrides:
getRepository in class URLHandler
Parameters:
url - - the URL of the repository
Returns:
the AttributeRepository
Throws:
BadURLException