Service Registry 3.1 Update 1 Developer's Guide

Creating and Retrieving an Organization Hierarchy: Examples

For examples of publishing and retrieving an organization hierarchy, see JAXRPublishOrgFamily.java and JAXRSearchOrgFamily.java in the directory install/registry-samples/organizations/src.

ProcedureTo Run the JAXRPublishOrgFamily and JAXRSearchOrgFamily Examples

  1. Go to the directory install/registry-samples/organizations.

  2. Type the following command to publish the organizations:


    Ant-base/ant pub-fam
    

    The output of the pub-fam target looks something like this:


    pub-fam:
         [java] Query URL is http://localhost:6480/soar/registry/soap
         [java] Publish URL is http://localhost:6480/soar/registry/soap
         [java] Created connection to registry
         [java] Established security credentials
         [java] Got registry service, query manager, and life cycle manager
         [java] Parent organization URN is urn:uuid:f1141478-17c7-476e-9fdd-e3d8fb022575
         [java] Parent user URN is urn:uuid:796502fe-ca6b-459d-96da-8bbb3813a58e
         [java] Child 1 organization URN is urn:uuid:176d2620-7733-4d74-9525-854dd4d2dbe0
         [java] Child 1 user URN is urn:uuid:ef08d809-a3f0-461f-a4e6-987956a43c44
         [java] Child 2 organization URN is urn:uuid:0302e35b-c104-41c7-85f1-96f51f9ac56b
         [java] Child 2 user URN is urn:uuid:84129c25-e18a-4ad3-ae58-9685d9797bd6
         [java] Grandchild organization URN is urn:uuid:0f3ffa7b-469a-4c10-99a2-f5052af19c85
         [java] Grandchild user URN is urn:uuid:b3473b0a-54c5-49af-87cd-e73ef4a1ad32
         [java] Organizations saved
  3. Type the following command to retrieve the organizations that you published:


    Ant-base/ant search-fam
    

    The output of the search-fam target looks something like this:


    search-fam:
         [java] Search string is parent
         [java] Query URL is http://localhost:6480/soar/registry/soap
         [java] Created connection to registry
         [java] Got registry service and query manager
         [java] Org name: Parent Organization
         [java] Org description: parent organization
         [java] Org key id: urn:uuid:f1141478-17c7-476e-9fdd-e3d8fb022575
         [java] Retrieving child organizations
         [java]  Child org name: Child Organization 1
         [java]  Child org description: child organization 1
         [java]  Child org key id: urn:uuid:176d2620-7733-4d74-9525-854dd4d2dbe0
         [java]  Parent org name: Parent Organization
         [java]  Child org name: Child Organization 2
         [java]  Child org description: child organization 2
         [java]  Child org key id: urn:uuid:0302e35b-c104-41c7-85f1-96f51f9ac56b
         [java]  Parent org name: Parent Organization
         [java] Retrieving descendant organizations
         [java]  Descendant org name: Child Organization 1
         [java]  Descendant org description: child organization 1
         [java]  Descendant org key id: urn:uuid:176d2620-7733-4d74-9525-854dd4d2dbe0
         [java]  Parent org name: Parent Organization
         [java]  Root org name: Parent Organization
         [java]  Descendant org name: Child Organization 2
         [java]  Descendant org description: child organization 2
         [java]  Descendant org key id: urn:uuid:0302e35b-c104-41c7-85f1-96f51f9ac56b
         [java]  Parent org name: Parent Organization
         [java]  Root org name: Parent Organization
         [java]  Descendant org name: Grandchild Organization
         [java]  Descendant org description: grandchild of Parent Organization
         [java]  Descendant org key id: urn:uuid:0f3ffa7b-469a-4c10-99a2-f5052af19c85
         [java]  Parent org name: Child Organization 1
         [java]  Root org name: Parent Organization