Package org.openxri.store

Examples of org.openxri.store.Store


    }

    @Override
    protected void onSubmit() {

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

      // find authorities in store

      try {
View Full Code Here


      Constructor oConstructor = oClass.getConstructor(oConstructorArgs);

      Object[] oArgs = new Object[1];
      oArgs[0] = oConfig.getStoreImplArgs();
      Store oImpl = (Store) oConstructor.newInstance(oArgs);

      oImpl.init();

      soLog.debug("Successfully constructed Store implementation.");

      return oImpl;
    }
View Full Code Here

    }

    @Override
    protected void onSubmit() {

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

      SubSegment subSegment;
      Authority authority;
     
      try {

        XRD xrd = new XRD();
       
        subSegment = openXRIStore.registerSubsegment(
            this.parentAuthority,
            this.name,
            xrd);
       
        authority = openXRIStore.getSubSegmentAuthority(subSegment);
      } catch (StoreException ex) {

        CreateSubSegment.log.error(ex);
        CreateSubSegment.this.error(CreateSubSegment.this.getString("storefail") + ex.getLocalizedMessage());
        return;
View Full Code Here

    }

    @Override
    protected void onSubmit() {

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

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

        authority = openXRIStore.createAuthority(xrd);
      } catch (StoreException ex) {

        CreateAuthority.log.error(ex);
        CreateAuthority.this.error(CreateAuthority.this.getString("storefail") + ex.getLocalizedMessage());
        return;
View Full Code Here

    }

    @Override
    protected void onSubmit() {

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

      // find subsegments in store
     
      try {
View Full Code Here

    if (subSegment == null) throw new NullPointerException();
   
    this.setTitle(this.getString("title"));
    this.setModel(new CompoundPropertyModel(this));

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

    this.subSegment = subSegment;

    // get information from the store

    try {

      this.parentAuthority = openXRIStore.getSubSegmentParentAuthority(this.subSegment);
      this.authority = openXRIStore.getSubSegmentAuthority(this.subSegment);
    } catch (StoreException ex) {

      log.error(ex);
      this.error(this._storefail + ex.getLocalizedMessage());
    }
View Full Code Here

  }

  @Override
  protected void onBeforeRender() {

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

    // get information from the store

    try {

      this.subSegmentId = this.subSegment.getId();
      this.name = this.subSegment.getName();
      this.parentAuthority = openXRIStore.getSubSegmentParentAuthority(this.subSegment);
      this.authority = openXRIStore.getSubSegmentAuthority(this.subSegment);
    } catch (StoreException ex) {

      log.error(ex);
      this.error(this._storefail + ex.getLocalizedMessage());
    }
View Full Code Here

                return FAILURE;
            }

            int iLength = sSubcommandArgs.length;

            Store oAdmin = getXRIAdministration(sOutput);
            if (oAdmin == null)
            {
                return FAILURE;
            }

            // process the subcommand
            if (msSubcommand.equalsIgnoreCase(CMD_CREATE_ROOT_AUTHORITY))
            {
                // args:  namespace [-output_auth_id_only]
                if (iLength != 1)
                {
                    outputSubcommandArgError(
                        sOutput, CMD_CREATE_ROOT_AUTHORITY);
                    return FAILURE;
                }

                String sNamespace = sSubcommandArgs[0];
                Service oAuthority = oAdmin.createRootAuthority(sNamespace);
                if (mbOutputAuthIDOnly)
                {
                    sOutput.append(oAuthority.getProviderID());
                }
                else
                {
                    sOutput.append(oAuthority.dump());
                }
            }

            else if (msSubcommand.equalsIgnoreCase(CMD_DELETE_ROOT_AUTHORITY))
            {
                sOutput.append(
                    CMD_DELETE_ROOT_AUTHORITY +
                    ": CURRENTLY NOT IMPLEMENTED.\n");
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_FIND_ROOT_AUTHORITY))
            {
                // args:  namespace [-output_auth_id_only]
                if (iLength != 1)
                {
                    outputSubcommandArgError(sOutput, CMD_FIND_ROOT_AUTHORITY);
                    return FAILURE;
                }

                // we'll do special error handling here, because we don't want to
                // treat 'not found' as a FAILURE condition -- else caller could
                // not distinguish between that and bad argument error
                try
                {
                    String sNamespace = sSubcommandArgs[0];
                    Service oAuthority = oAdmin.findRootAuthority(sNamespace);
                    sOutput.append(
                        mbOutputAuthIDOnly ? oAuthority.getProviderID()
                                           : oAuthority.toString());
                }
                catch (StoreException oEx)
                {
                    // we intepret the following as not-found namespace
                    if (
                        (oEx.getExMessage() != null) &&
                        (oEx.getExMessage().indexOf("namespace") != -1))
                    {
                        sOutput.setLength(0); // not needed -- just for illustration
                    }
                    else
                    {
                        throw oEx;
                    }
                }
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_LIST_ROOT_AUTHORITIES))
            {
                sOutput.append(
                    CMD_LIST_ROOT_AUTHORITIES +
                    ": CURRENTLY NOT IMPLEMENTED.\n");
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_CREATE_AUTHORITY))
            {
                sOutput.append(
                    CMD_CREATE_AUTHORITY + ": CURRENTLY NOT IMPLEMENTED.\n");
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_DELETE_AUTHORITY))
            {
                sOutput.append(
                    CMD_DELETE_AUTHORITY + ": CURRENTLY NOT IMPLEMENTED.\n");
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_REG_LOCAL_AUTHORITY))
            {
                sOutput.append(
                    CMD_REG_LOCAL_AUTHORITY + ": CURRENTLY NOT IMPLEMENTED.\n");
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_REG_SUBSEGMENT))
            {
                // args:  parent_id subsegment auth_id auth_uri
                //        [-auth_type <type>] [-add_uri <uri>] [-service <service>]
                //        [-internal <synonym>] [-external <synonym]
                //
                // all optional args may have 0..n, except auth_type which is 0..1.
                if (iLength != 4)
                {
                    outputSubcommandArgError(sOutput, CMD_REG_SUBSEGMENT);
                    return FAILURE;
                }

                String sParentID = sSubcommandArgs[0];
                String sSubsegment = sSubcommandArgs[1];
                String sAuthID = sSubcommandArgs[2];
                String sAuthURI = sSubcommandArgs[3];

                // set up the uris. the non-optional one goes first, then append
                // the optional ones
                String[] sAuthURIs = new String[moAuthURIs.size() + 1];
                sAuthURIs[0] = sAuthURI;
                for (int i = 1; i < sAuthURIs.length; i++)
                {
                    sAuthURIs[i] = (String) moAuthURIs.get(i - 1);
                }

                // set up the authority object
                Service oChildAuthority = new Service();
                oChildAuthority.setProviderID(sAuthID);
                oChildAuthority.setType(msAuthType);
                for (int i = 0; i < sAuthURIs.length; i++)
                {
                    oChildAuthority.addURI(sAuthURIs[i]);
                }

                // invoke the command on the server. TODO: currently the services and
                // synonyms are not supported
                oAdmin.registerSubsegment(
                    sParentID, sSubsegment, new Service[0], new String[0],
                    new String[0], oChildAuthority);
            }
            else if (msSubcommand.equalsIgnoreCase(CMD_RELEASE_SUBSEGMENT))
            {
View Full Code Here

                oEx.getClass().getName() + ": " + oEx.getMessage());

            return null;
        }

        Store oAdmin = null;

        if (sIOR != null)
        {
            ORB oORB = ORB.init(new String[0], null);
View Full Code Here

    }

    @Override
    protected void onBeforeRender() {

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

      // get information from the store

      try {
View Full Code Here

TOP

Related Classes of org.openxri.store.Store

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.