Package org.openxri.xml

Examples of org.openxri.xml.XRD.addService()


        XRD oDesc = new XRD();
        Service atAuthService = new Service();
        atAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
        atAuthService.addType(Tags.SERVICE_AUTH_RES);
        atAuthService.addURI("http://gcs.epok.net/xri/resolve?ns=at");
        oDesc.addService(atAuthService);

        XRD oDummy = new XRD();
        Service dummyService = new Service();
        dummyService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
        dummyService.addType(Tags.SERVICE_AUTH_RES);
View Full Code Here


        XRD oDummy = new XRD();
        Service dummyService = new Service();
        dummyService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
        dummyService.addType(Tags.SERVICE_AUTH_RES);
        dummyService.addURI("http://www.example.com/xri/resolve?id=1");
        oDummy.addService(dummyService);

        GCSAuthority oAuth = new GCSAuthority("@");
        oCache.stuff(oAuth, oDesc);
        assertTrue("Initial cache incorrect", oCache.getNumNodes() == 1);
View Full Code Here

        XRD oDesc = new XRD();
        Service atAuthService = new Service();
        atAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
        atAuthService.addType(Tags.SERVICE_AUTH_RES);
        atAuthService.addURI("http://gcs.epok.net/xri/resolve?ns=at");
        oDesc.addService(atAuthService);

        GCSAuthority oAuth = new GCSAuthority("@");
        oCache.stuff(oAuth, oDesc);
        assertTrue("Initial cache incorrect", oCache.getNumNodes() == 1);
View Full Code Here

            XRD oDummy = new XRD();
            Service dummyService = new Service();
            dummyService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
            dummyService.addType(Tags.SERVICE_AUTH_RES);
            dummyService.addURI("http://www.example.com/xri/resolve?id=1");
            oDummy.addService(dummyService);

            String[] oCases =
                { "@!a1!b2!c3!d4", "@!x1!y2!z3", "@!a1!b2!c3", "@!a1!b2", "@!a1!b2!m3", "@!a1!o2!p3", "@!a1!o2!q3", "@!a1!b2!c3!d4!e5", "@!x1!y2" };

            Cache oCache = new Cache(1000);
View Full Code Here

    srv.addMediaType(authMediaType, null, Boolean.FALSE);
    srv.addType(Tags.SERVICE_AUTH_RES);
    srv.addURI(uri);

    // add it to the XRD
    xrd.addService(srv);

    return xrd;
  }

  public static Resolver setupResolver()
View Full Code Here

        }

        // fill it with information we got from the store

        for (int ii=0; ii<refs.length; ii++) xrd.addRef(refs[ii]);
        for (int ii=0; ii<services.length; ii++) xrd.addService(services[ii]);
        for (int ii=0; ii<localIds.length; ii++) xrd.addLocalID(localIds[ii]);

        // do we want a local authority resolution service for this authority?
        // this piece of information comes from the store, but we actually create
        // the service, since this requires knowledge of the server configuration
View Full Code Here

          } catch(URISyntaxException ex) {

            throw new ServerException("Invalid URI for authority resolution service.", ex);
          }

          xrd.addService(new AuthorityResolutionService(uris, authority.getAuthorityId()));
        }

        // let our subclasses finish the XRD before we append it to the XRDS

        this.finishXRD(
View Full Code Here

        // e.g. =jmj ends up being the same as @jmj.  For testing only.
        //
        try
        {
          XRD eqXRD = new XRD();
          eqXRD.addService(getRootAuthority());
         
          XRD atXRD = new XRD();
          atXRD.addService(getRootAuthority());
          oResolver.setAuthority("=", eqXRD);
          oResolver.setAuthority("@", atXRD);
View Full Code Here

        {
          XRD eqXRD = new XRD();
          eqXRD.addService(getRootAuthority());
         
          XRD atXRD = new XRD();
          atXRD.addService(getRootAuthority());
          oResolver.setAuthority("=", eqXRD);
          oResolver.setAuthority("@", atXRD);
        }
        catch (Exception oEx)
        {
View Full Code Here

    Service defaultService;

    try {

      defaultService = new DefaultService(new URI("http://www.openxri.org"));
      xrd.addService(defaultService);
    } catch (URISyntaxException ex) {

      ex.printStackTrace();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.