Package org.openxri.store

Examples of org.openxri.store.Authority


    protected void onSubmit() {

      final Store openXRIStore = ((OpenXRIAdminApplication) this.getApplication()).getOpenXRIStore();

      XRD xrd = new XRD();
      Authority authority;
     
      try {

        authority = openXRIStore.createAuthority(xrd);
      } catch (StoreException ex) {
View Full Code Here


  {
    if (soLog.isDebugEnabled()) soLog.debug("lookupById(" + authorityId + "," + segment.toString() + ")");

    // find the authority object for this id

    Authority parent;
    try {

      parent = moStore.findAuthority(authorityId);
    } catch (StoreException ex) {
View Full Code Here

  {
    if (soLog.isDebugEnabled()) soLog.debug("lookupByNamespace(" + namespace + "," + segment.toString() + ")");

    // find the authority object for this namespace

    Authority parent;

    try {

      parent = moStore.findRootAuthority(namespace);
    } catch (StoreException ex) {
View Full Code Here

          soLog.warn("Cannot find subsegment: " + subSegmentName);
          return(null);
        }

        Authority authority = moStore.getSubSegmentAuthority(subSegment);

        // look up Refs and Services from the store, as well as LocalIDs if the store supports it

        Ref[] refs = moStore.getAuthorityRefs(authority);
        Service[] services = moStore.getAuthorityServices(authority);
        LocalID[] localIds;

        if (moStore instanceof StoreBetterLookup) {

          localIds = ((StoreBetterLookup) moStore).getSubSegmentLocalIds(subSegment);
        } else {

          localIds = new LocalID[0];
        }

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

        if (authority.getLocalAuthService().equals(Boolean.TRUE)) {

          URI[] uris;

          try {

            uris = new URI[2];
            uris[0] = fillURI(authority.getAuthorityId(), "http");
            uris[1] = fillURI(authority.getAuthorityId(), "https");
          } 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

  public boolean equals(Object object) {

    if (object == this) return(true);
    if (object == null || ! (object instanceof Authority)) return(false);

    Authority other = (Authority) object;

    Long id1 = this.getId();
    Long id2 = other.getId();
   
    if (id1 == null || id2 == null) return(false);
   
    return(id1.equals(id2));
  }
View Full Code Here

    SubSegment[] childSubSegments = ((StoreBetterLookup) openXRIStore).getAuthorityChildSubSegments(authority);

    this.parentAuthorities = new HashMap<String, List<String>> ();
    for (SubSegment subSegment : subSegments) {

      Authority parentAuthority = openXRIStore.getSubSegmentParentAuthority(subSegment);

      String authorityText;
      if (parentAuthority == null || parentAuthority.getXrd() == null)
        authorityText = "-";
      else if (parentAuthority.getXrd().getCanonicalID() != null)
        authorityText = parentAuthority.getXrd().getCanonicalID().getValue();
      else
        authorityText = parentAuthority.getId().toString();

      List<String> subSegmentNames = this.parentAuthorities.get(authorityText);
      if (subSegmentNames == null) {

        subSegmentNames = new ArrayList<String> ();
        this.parentAuthorities.put(authorityText, subSegmentNames);
      }
      subSegmentNames.add(subSegment.getName());
    }

    this.childAuthorities = new HashMap<String, List<String>> ();
    for (SubSegment childSubSegment : childSubSegments) {

      Authority childAuthority = openXRIStore.getSubSegmentAuthority(childSubSegment);

      String authorityText;
      if (childAuthority == null || childAuthority.getXrd() == null)
        authorityText = "-";
      else if (childAuthority.getXrd().getCanonicalID() != null)
        authorityText = childAuthority.getXrd().getCanonicalID().getValue();
      else
        authorityText = childAuthority.getId().toString();

      List<String> subSegmentNames = this.childAuthorities.get(authorityText);
      if (subSegmentNames == null) {

        subSegmentNames = new ArrayList<String> ();
View Full Code Here

      final Store openXRIStore = ((OpenXRIAdminApplication) this.getApplication()).getOpenXRIStore();

      // find the authority

      Authority authority;

      try {

        XRI xri = new XRI(this.xri);
        XRIAuthority xriAuthority = ((XRIAuthority) xri.getAuthorityPath());
View Full Code Here

    return(list);
  }

  public Object getDisplayValue(Object object) {

    Authority rootAuthority = (Authority) object;

    return(rootAuthority.getId().toString());
  }
View Full Code Here

      private static final long serialVersionUID = 8715382715578294263L;

      @Override
      protected void populateItem(ListItem item) {

        final Authority authority = (Authority) item.getModelObject();

        PageLink link = new PageLink("link", new IPageLink() {

          private static final long serialVersionUID = 8137543413717092367L;

          public Page getPage() {
           
            return(new AuthorityDetails(authority));
          }

          public Class<?> getPageIdentity() {
           
            return(AuthorityDetails.class);
          }
        });
       
        link.add(new Label("id", authority.getId().toString()));
        item.add(link);
      }
    });
  }
View Full Code Here

      throw ex2;
    }

    XRIAuthority authorityPath = new GCSAuthority(utf8Namespace);

    Authority namespaceAuthority;
    setParentQueryName(utf8Namespace);

    try {

      namespaceAuthority = this.store.localLookup(authorityPath);
View Full Code Here

TOP

Related Classes of org.openxri.store.Authority

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.