Package org.openxri.xml

Examples of org.openxri.xml.Service


    ArrayList selectedServices = selectServices(services, type, path, mediaType);
    if (selectedServices == null || selectedServices.size() < 1)
      return uris;
   
    for (int i = 0; i < selectedServices.size(); i++) {
      Service s = (Service)selectedServices.get(i);
      uris.addAll(s.getPrioritizedURIs());
    }
    return uris;
  }
View Full Code Here


      return new ArrayList();
   
    // prioritization
    PrioritizedList list = new PrioritizedList();
    for (int i = 0; i < selectedServices.size(); i++) {
      Service s = (Service)selectedServices.get(i);
      String priority = (s.getPriority() == null) ? PrioritizedList.PRIORITY_NULL : s.getPriority().toString();
      list.addObject(priority, s);
    }
   
    return list.getList();
  }
View Full Code Here

   
  public static void main (String[] args) {
    Resolver resolver = new Resolver();
   
        XRD eqRoot = new XRD();
        Service eqAuthService = new Service();
        eqAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none", SEPElement.MATCH_ATTR_CONTENT, Boolean.FALSE);
        eqAuthService.addType(Tags.SERVICE_AUTH_RES);
        //eqAuthService.addURI("http://equal.beta.xri.net");
        eqAuthService.addURI("http://equal.xri.net");
        eqRoot.addService(eqAuthService);
        // System.out.println(eqRoot.toString());
       
        XRD atRoot = new XRD();
        Service atAuthService = new Service();
        atAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none", SEPElement.MATCH_ATTR_CONTENT, Boolean.FALSE);
        atAuthService.addType(Tags.SERVICE_AUTH_RES);
        //atAuthService.addURI("http://at.beta.xri.net/cgi-bin/xri");
        atAuthService.addURI("http://at.xri.net");
        //atAuthService.addURI("http://xria.2idi.com/@");
        atRoot.addService(atAuthService);
        // System.out.println(atRoot.toString());

        XRD bangRoot = new XRD();
        Service bangAuthService = new Service();
        bangAuthService.addMediaType(Tags.CONTENT_TYPE_XRDS + ";trust=none", SEPElement.MATCH_ATTR_CONTENT, Boolean.FALSE);
        bangAuthService.addType(Tags.SERVICE_AUTH_RES);
        bangAuthService.addURI("http://bang.beta.xri.net/cgi-bin/xri");
        bangRoot.addService(bangAuthService);
        // System.out.println(bangRoot.toString());

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

      }
    }

    // create XDI service endpoint and add it to the XRD

    Service xdiService = new XDIService(uris.toArray(new URI[uris.size()]), canonicalIDString);

    xrd.addService(xdiService);

    // done
View Full Code Here

  }

  private XRD makeSampleXRD() {

    XRD xrd = new XRD();
    Service defaultService;

    try {

      defaultService = new DefaultService(new URI("http://www.openxri.org"));
      xrd.addService(defaultService);
View Full Code Here

      }
    }

    // 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

      SEPTemplatesModel importSEPTemplatesModel = new SEPTemplatesModel();

      this.serviceTextArea = new TextArea("service");
      this.serviceTextArea.setOutputMarkupId(true);
      this.templateDropDownChoice = new DropDownChoice("template", new Model(new Service()), importSEPTemplatesModel, importSEPTemplatesModel);
      this.loadTemplateButton = new AjaxSubmitLink("loadTemplateButton", this) {

        private static final long serialVersionUID = -4311234326704642467L;

        @Override
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

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.