Class HttpLookupMethod

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpLookupMethod.LinkRelation
      Specifies a link relation for the selected type of connection.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.InputStream getXrdStream​(DomainBareJid xmppServiceAddress)
      Constructs a HTTP connection with the host specified by the DomainBareJid and retrieves XRD element in the form of an InputStream.
      static java.util.List<java.net.URI> lookup​(DomainBareJid xmppServiceAddress, java.lang.String relation)
      Get remote endpoints for the given LinkRelation from host.
      static java.util.List<java.net.URI> lookup​(DomainBareJid xmppServiceAddress, HttpLookupMethod.LinkRelation relation)
      Get remote endpoints for the given LinkRelation from host.
      static java.util.List<java.net.URI> parseXrdLinkReferencesFor​(XmlPullParser parser, java.lang.String relation)
      Get remote endpoints for the provided LinkRelation from provided XmlPullParser.
      static java.util.List<java.net.URI> parseXrdLinkReferencesFor​(XmlPullParser parser, HttpLookupMethod.LinkRelation relation)
      Get remote endpoints for the provided LinkRelation from provided XmlPullParser.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • lookup

        public static java.util.List<java.net.URI> lookup​(DomainBareJid xmppServiceAddress,
                                                          java.lang.String relation)
                                                   throws java.io.IOException,
                                                          XmlPullParserException,
                                                          java.net.URISyntaxException
        Get remote endpoints for the given LinkRelation from host.
        Parameters:
        xmppServiceAddress - address of host
        relation - LinkRelation as a string specifying type of connection
        Returns:
        list of endpoints
        Throws:
        java.io.IOException - exception due to input/output operations
        XmlPullParserException - exception encountered during XML parsing
        java.net.URISyntaxException - exception to indicate that a string could not be parsed as a URI reference
      • lookup

        public static java.util.List<java.net.URI> lookup​(DomainBareJid xmppServiceAddress,
                                                          HttpLookupMethod.LinkRelation relation)
                                                   throws java.io.IOException,
                                                          XmlPullParserException,
                                                          java.net.URISyntaxException
        Get remote endpoints for the given LinkRelation from host.
        Parameters:
        xmppServiceAddress - address of host
        relation - HttpLookupMethod.LinkRelation specifying type of connection
        Returns:
        list of endpoints
        Throws:
        java.io.IOException - exception due to input/output operations
        XmlPullParserException - exception encountered during XML parsing
        java.net.URISyntaxException - exception to indicate that a string could not be parsed as a URI reference
      • getXrdStream

        public static java.io.InputStream getXrdStream​(DomainBareJid xmppServiceAddress)
                                                throws java.io.IOException
        Constructs a HTTP connection with the host specified by the DomainBareJid and retrieves XRD element in the form of an InputStream. The method will throw a FileNotFoundException if host-meta isn't published.
        Parameters:
        xmppServiceAddress - address of host
        Returns:
        InputStream containing XRD element
        Throws:
        java.io.IOException - exception due to input/output operations
      • parseXrdLinkReferencesFor

        public static java.util.List<java.net.URI> parseXrdLinkReferencesFor​(XmlPullParser parser,
                                                                             java.lang.String relation)
                                                                      throws java.io.IOException,
                                                                             XmlPullParserException,
                                                                             java.net.URISyntaxException
        Get remote endpoints for the provided LinkRelation from provided XmlPullParser.
        Parameters:
        parser - XmlPullParser that contains LinkRelations
        relation - type of endpoints specified by the given LinkRelation
        Returns:
        list of endpoints
        Throws:
        java.io.IOException - exception due to input/output operations
        XmlPullParserException - exception encountered during XML parsing
        java.net.URISyntaxException - exception to indicate that a string could not be parsed as a URI reference
      • parseXrdLinkReferencesFor

        public static java.util.List<java.net.URI> parseXrdLinkReferencesFor​(XmlPullParser parser,
                                                                             HttpLookupMethod.LinkRelation relation)
                                                                      throws java.io.IOException,
                                                                             XmlPullParserException,
                                                                             java.net.URISyntaxException
        Get remote endpoints for the provided LinkRelation from provided XmlPullParser.
        Parameters:
        parser - XmlPullParser that contains LinkRelations
        relation - type of endpoints specified by the given LinkRelation
        Returns:
        list of endpoints
        Throws:
        java.io.IOException - exception due to input/output operations
        XmlPullParserException - exception encountered during XML parsing
        java.net.URISyntaxException - exception to indicate that a string could not be parsed as a URI reference