Package org.openxri.xml

Examples of org.openxri.xml.Service


      }
    }

    // create authority resolution service endpoint and add it to the XRD

    Service authorityResolutionService = new AuthorityResolutionService(uris.toArray(new URI[uris.size()]), canonicalIDString, this.trust);

    xrd.addService(authorityResolutionService);

    // done
View Full Code Here


    ResolverCache cache = new ResolverCache();
    cache.setNewCache("test", 1000);
    assertTrue("Initial cache not empty", cache.getSize() == 0);

    XRD xrd = 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");
    xrd.addService(atAuthService);

    XRD xrd1 = 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");
    xrd1.addService(dummyService);

    try {
      GCSAuthority auth = new GCSAuthority("@");
      cache.put(auth.toString(), false, false, xrd.toString().getBytes("UTF-8"), 1000);
View Full Code Here

    cache.del(AuthorityPath.buildAuthorityPath("@").toString(), false, false);
    assertTrue("Initial cache not empty", cache.getSize() == 0);


    XRD xrd = 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");
    xrd.addService(atAuthService);

    try {
      GCSAuthority auth = new GCSAuthority("@");
      cache.put(auth.toString(), false, false, xrd.toString().getBytes("UTF-8"), 1000);
View Full Code Here

    }

    public void run()
    {
      XRD xrd = 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");
      xrd.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" };
View Full Code Here

    for (String path : this.paths) paths.add(new SEPPath(path, null, Boolean.TRUE));
    for (String mediaType : this.mediaTypes) mediaTypes.add(new SEPMediaType(mediaType, null, Boolean.TRUE));

    // create service endpoint and add it to the XRD

    Service service = new Service();
    service.setProviderId(canonicalIDString);
    service.setURIs(uris);
    service.setTypes(types);
    service.setPaths(paths);
    service.setMediaTypes(mediaTypes);

    xrd.addService(service);

    // done
View Full Code Here

           
            // create and configure a resolver
            Resolver resolver = new Resolver();
           
            XRD eqRoot = new XRD();
            Service eqAuthService = new Service();
            eqAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
            eqAuthService.addType(Tags.SERVICE_AUTH_RES);
            eqAuthService.addURI(msRootEqualsURI);
            eqRoot.addService(eqAuthService);
           
            XRD atRoot = new XRD();
            Service atAuthService = new Service();
            atAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none");
            atAuthService.addType(Tags.SERVICE_AUTH_RES);
            atAuthService.addURI(msRootAtURI);
            atRoot.addService(atAuthService);

            resolver.setAuthority("=", eqRoot);
            resolver.setAuthority("@", atRoot);
View Full Code Here

            // AuthorityID
            assertEquals(
                "urn:uuid:D5CFA9CB-F43B-228C-3CEE-C5E9F2D3CB15",
                oDesc.getProviderID().trim());

            Service authService = oDesc.getServiceAt(0);
            // Authority
            assertNotNull(authService);

            // Authority/AuthorityID
            assertEquals(
                "urn:uuid:C5C9EECF-A3BC-4883-8852-8EECB54CE1D5",
                authService.getProviderId().trim());

            // Authority/URI(s)
            assertEquals(3, authService.getNumURIs());
            assertEquals(
                "http://test.epok.net/foo/bar",
                authService.getURIForScheme("http").getURI().toString());
            assertEquals(
                "https://test.epok.net/foo/bar",
                authService.getURIForScheme("https").getURI().toString());

            // Authority/URI(s)
            /*
            assertEquals(3, oDesc.getServiceForType(Tags.SERVICE_AUTH_TRUSTED).getNumURIs());
            assertEquals(
                "http://test.epok.net/foo/bar",
                oDesc.getXRIAuthority().getTrustedURIForScheme("http") + "");
                */
           
            // Authority/KeyInfo
            assertNotNull(authService.getKeyInfo());

            // Services
            Service oLA = oDesc.getServiceAt(1);
            assertTrue("Incorrect type", oLA.getTypeAt(0).getType().equals("xri:@epok/foo"));
            assertTrue("Incorrect URI for Local Access", oLA.getNumURIs() == 0);

            oLA = oDesc.getServiceAt(2);
            assertTrue("Incorrect type", oLA.getTypeAt(0).getType().equals("xri:@epok/foo2"));
            assertTrue(
                "Incorrect URI for Local Access2", oLA.getNumURIs() == 1);
            assertTrue(
                "Incorrect Value for Custom Data",
                oLA.getOtherTagValues("Custom") != null);
            assertTrue(
                "Incorrect Value for Custom Data2",
                oLA.getOtherTagValues("Custom2") != null);

            // Synonyms
            assertTrue(
                "Incorrect # for Internal", oDesc.getNumLocalIDs() == 1);
            assertTrue(
View Full Code Here

      if (xrd.getSelectedServices().getList().size() < 1) {
        log.error("SEP Selection succeeded but no Service found!?");
        return new ArrayList();
      }
     
      Service topService = (Service)xrd.getSelectedServices().getList().get(0);

      ArrayList urisOut = new ArrayList();
      ArrayList uris = topService.getPrioritizedURIs();
      for (int i = 0; uris != null && i < uris.size(); i++) {
        SEPUri uri = (SEPUri)uris.get(i);
        String append = uri.getAppend();
        if (append == null)
          append = SEPUri.APPEND_LOCAL;
View Full Code Here

  public SEPTemplatesModel() {

    try {

      this.list = Arrays.asList(new Service[] {
          new Service(),
          new DefaultService(new URI("http://__mydefaultendpoint__")),
          new AuthorityResolutionService(new URI("http://__myauthorityresolver__"), "__myproviderid__", new TrustType(TrustType.TRUST_NONE), SEPUri.APPEND_NONE),
          new ProxyResolutionService(new URI[] { new URI("http://__myproxyserver__"), new URI("https://__mysecureproxyserver__") }, "__myproviderid__", new TrustType(TrustType.TRUST_NONE), Boolean.TRUE, Boolean.TRUE),
          new AuthenticationService(new URI[] { new URI("http://__myauthenticationprovider__"), new URI("https://__mysecureauthenticationprovider__") }, "__myproviderid__", null, true),
          new ContactService(new URI("http://__mycontactprovider__"), "__myproviderid__", false),
          new ForwardingService(new URI("http://__myforwardingprovider__"), "__myproviderid__", false, true),
          new XDIService(new URI("http://__myxdiendpoint__"), "__myproviderid__")
      });

      this.names = new String[] {

          "Blank SEP",
          "Default SEP",
          "Authority Resolution SEP",
          "Proxy Resolution SEP",
          "Authentication SEP",
          "Contact SEP",
          "Forwarding SEP",
          "XDI SEP"
      };
    } catch (Exception ex) {

      this.list = Arrays.asList(new Service[] {
          new Service()
      });
    }
  }
View Full Code Here

     
      ///// Try each URI in each selected service in turn
      Exception savedException = null;
      Iterator srvIterator = selectedServices.iterator();
      while (srvIterator.hasNext()) {
        Service srv = (Service)srvIterator.next();
       
        Iterator uriIterator = srv.getPrioritizedURIs().iterator();
          ///// try each selected service URI in turn (skip only if nothing was read)
          while (uriIterator.hasNext()) {
            SEPUri sepURI = (SEPUri)uriIterator.next();
            URI uri = sepURI.getURI();
           
View Full Code Here

TOP

Related Classes of org.openxri.xml.Service

Copyright © 2018 www.massapicom. 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.