Changeset 7288 for TI12-security


Ignore:
Timestamp:
06/08/10 10:12:48 (9 years ago)
Author:
pjkersha
Message:

Incomplete - task 12: ESG Yadis identity service discovery

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/EsgYadisParser/src/org/earthsystemgrid/security/yadis/YadisParser.java

    r7275 r7288  
    3333import org.xml.sax.ErrorHandler; 
    3434 
     35import org.apache.commons.logging.Log; 
     36import org.apache.commons.logging.LogFactory; 
    3537import org.openid4java.OpenIDException; 
    3638import org.openid4java.discovery.Discovery; 
    3739import org.openid4java.discovery.DiscoveryException; 
     40import org.openid4java.discovery.xrds.XrdsParserImpl; 
    3841import org.openid4java.discovery.xrds.XrdsServiceEndpoint; 
    3942 
    4043 
    4144public class YadisParser { 
    42      
    43     private static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; 
    44     private static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; 
    45     private static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; 
    46  
    47     private static final String XRDS_SCHEMA = "xrds.xsd"; 
    48     private static final String XRD_SCHEMA = "xrd.xsd"; 
    49     private static final String XRD_NS = "xri://$xrd*($v*2.0)"; 
    50     private static final String XRD_ELEM_XRD = "XRD"; 
    51     private static final String XRD_ELEM_TYPE = "Type"; 
    52     private static final String XRD_ELEM_URI = "URI"; 
    53     private static final String XRD_ELEM_LOCALID = "LocalID"; 
    54     private static final String XRD_ELEM_CANONICALID = "CanonicalID"; 
    55     private static final String XRD_ATTR_PRIORITY = "priority"; 
    56     private static final String OPENID_NS = "http://openid.net/xmlns/1.0"; 
    57     private static final String OPENID_ELEM_DELEGATE = "Delegate"; 
     45    private static final Log _log = LogFactory.getLog(XrdsParserImpl.class); 
     46    private static final boolean DEBUG = _log.isDebugEnabled(); 
     47     
     48    public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; 
     49    public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; 
     50    public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; 
     51 
     52    public static final String XRDS_SCHEMA = "xrds.xsd"; 
     53    public static final String XRD_SCHEMA = "xrd.xsd"; 
     54    public static final String XRD_NS = "xri://$xrd*($v*2.0)"; 
     55    public static final String XRD_ELEM_XRD = "XRD"; 
     56    public static final String XRD_ELEM_TYPE = "Type"; 
     57    public static final String XRD_ELEM_URI = "URI"; 
     58    public static final String XRD_ELEM_LOCALID = "LocalID"; 
     59    public static final String XRD_ELEM_CANONICALID = "CanonicalID"; 
     60    public static final String XRD_ATTR_PRIORITY = "priority"; 
     61    public static final String OPENID_NS = "http://openid.net/xmlns/1.0"; 
     62    public static final String OPENID_ELEM_DELEGATE = "Delegate"; 
    5863       
    59     private Document parseXmlInput(String input) throws DiscoveryException 
     64    protected Document parseXmlInput(String input) throws DiscoveryException 
    6065    { 
    6166        if (input == null) 
     
    107112    } 
    108113 
    109     private Map extractElementsByParent(String ns, String elem, Set parents, Document document) 
     114    protected Map extractElementsByParent(String ns, String elem, Set parents, Document document) 
    110115    { 
    111116        Map result = new HashMap(); 
     
    124129    } 
    125130     
    126     private void addServiceType(Map serviceTypes, Node serviceNode, String type) 
     131    protected void addServiceType(Map serviceTypes, Node serviceNode, String type) 
    127132    { 
    128133        Set types = (Set) serviceTypes.get(serviceNode); 
     
    135140    } 
    136141 
    137     private int getPriority(Node node) 
     142    protected int getPriority(Node node) 
    138143    { 
    139144        if (node.hasAttributes()) 
Note: See TracChangeset for help on using the changeset viewer.