Package javax.xml.registry

Examples of javax.xml.registry.BusinessQueryManager


    }
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
            //Create classification
            Classification classification =
                blm.createClassification(
                  cScheme,
                  "category", category );

      // Define find qualifiers and name patterns
            Collection<String> findQualifiers = new ArrayList<String>();
            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
      findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
      Collection<Classification> classifications = new ArrayList<Classification>();
            classifications.add(classification);
          //Find based upon qualifier type and values
      logger.log(Level.DEBUG, "Going to query the registry for classification " + classifications);
      BulkResponse response = bqm.findServices(null, findQualifiers,
          null, classifications, null);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        services = (Collection<Service>) response.getCollection();
      }
      return services;
View Full Code Here


   */
    protected synchronized Concept getJBossESBTModel(Connection connection) throws JAXRException
  {
    if (jbossTModelXXX == null) {
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
           
            Collection<String> findQualifiers = new ArrayList<String>();
            findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
            Collection<String> namePatterns = new ArrayList<String>();
            if (isV3) {
                namePatterns.add(orgCategory);
            } else {
              namePatterns.add("%" + orgCategory + "%");
            }
           
            BulkResponse response = bqm.findConcepts(findQualifiers, namePatterns, null, null, null);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        Collection<RegistryObject> regs = (Collection<RegistryObject>) response.getCollection();
        Iterator<RegistryObject> orgIter = regs.iterator();
        if (orgIter.hasNext())
        {
View Full Code Here

    Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      final Concept jbossTModel = getJBossESBTModel(connection);
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      Collection<String> findQualifiers = null;
      //Collection<String> findQualifiers = new ArrayList<String>();
      //findQualifiers.add(FindQualifier.SORT_BY_DATE_ASC);
      ArrayList<SpecificationLink> specs = new ArrayList<SpecificationLink>();
            SpecificationLink sl = new SpecificationLinkImpl(blm);
            sl.setSpecificationObject(jbossTModel);

      specs.add(sl);
      BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,specs);
      if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
        serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
        for (Iterator bindIter = serviceBindings.iterator(); bindIter.hasNext();)
        {
          ServiceBinding binding = (ServiceBinding) bindIter.next();
View Full Code Here

     */
    public void testDeleteAssociations() throws JAXRException
    {
        Key savekey = null;
        Key assockey = null;
        BusinessQueryManager bqm2 = null;
        BusinessLifeCycleManager blm2 = null;
        Collection sourceKeys = null;
        Collection targetKeys = null;


        try
        {
            login();
            getJAXREssentials();
            // second user.
            Connection con2 = loginSecondUser();
            RegistryService rs2 = con2.getRegistryService();
            blm2 = rs2.getBusinessLifeCycleManager();
            bqm2 = rs2.getBusinessQueryManager();
            String orgTarget = "Target Organization";
            String orgSource = "Source Organization";

            Organization target = blm2.createOrganization(blm.createInternationalString(orgTarget));
            Organization source = blm.createOrganization(blm.createInternationalString(orgSource));

            Collection orgs = new ArrayList();
            orgs.add(source);
            br = blm.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail(" Source::Save Organizations failed");
            }
            sourceKeys = br.getCollection();
            Iterator iter = sourceKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            String sourceid = savekey.getId();
            String objectType = LifeCycleManager.ORGANIZATION;

            Organization pubSource = (Organization) bqm.getRegistryObject(sourceid, objectType);
            assertNotNull("Source Org", pubSource.getName().getValue());

            orgs.clear();
            orgs.add(target);
            br = blm2.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail("Target:: Save Organizations failed");
            }
            targetKeys = br.getCollection();
            iter = targetKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            String targetid = savekey.getId();
            Organization targetOrg = (Organization) bqm2.getRegistryObject(targetid, objectType);
            assertNotNull("Target Org", targetOrg.getName().getValue());

            Concept associationType = getAssociationConcept("Implements");
            assertNotNull("AssociationType", associationType);

View Full Code Here

        Collection associationKeys = null;
        Collection sourceKeys = null;
        Collection targetKeys = null;
        String targetId = null;
        String sourceId = null;
        BusinessQueryManager bqm2 = null;
        BusinessLifeCycleManager blm2 = null;


        try
        {
            login();
            getJAXREssentials();

            // second user.
            Connection con2 = loginSecondUser();
            RegistryService rs2 = con2.getRegistryService();
            blm2 = rs2.getBusinessLifeCycleManager();
            bqm2 = rs2.getBusinessQueryManager();

            Organization target = blm2.createOrganization(blm.createInternationalString(orgTarget));
            Organization source = blm.createOrganization(blm.createInternationalString(orgSource));

            Collection orgs = new ArrayList();
            orgs.add(source);
            br = blm.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail(" Source:Save Orgs failed");
            }

            sourceKeys = br.getCollection();
            Iterator iter = sourceKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            sourceId = savekey.getId();

            String objectType = LifeCycleManager.ORGANIZATION;
            Organization pubSource = (Organization) bqm.getRegistryObject(sourceId, objectType);
            assertNotNull("Source retrieved: ", pubSource.getName().getValue());

            orgs.clear();
            orgs.add(target);
            br = blm2.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail("Target:Save Orgs failed");
            }
            targetKeys = br.getCollection();
            iter = targetKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            targetId = savekey.getId();

            Organization pubTarget = (Organization) bqm2.getRegistryObject(targetId, objectType);
            assertNotNull("Target: ", pubTarget.getName().getValue());

            Concept associationType = getAssociationConcept(type);
            if (associationType == null)
                fail(" getAssociationConcept returned null");
View Full Code Here

      String type = "Implements";

      Key savekey = null;
      Key assockey = null;

      BusinessQueryManager bqm2 = null;
      BusinessLifeCycleManager blm2 = null;
      Collection associationKeys = null;
      Collection sourceKeys = null;
      Collection targetKeys = null;
      String targetId = null;
      String sourceId = null;
      String orgTarget = "Target Organization";

      try
      {
         login();
         getJAXREssentials();
         // Authenticate second user
         Connection con2 = loginSecondUser();
         RegistryService rs2 = con2.getRegistryService();
         blm2 = rs2.getBusinessLifeCycleManager();
         bqm2 = rs2.getBusinessQueryManager();

         Organization source = blm.createOrganization(blm.createInternationalString(orgSource));
         Organization target = blm2.createOrganization(blm.createInternationalString(orgTarget));

         // publish the source organization
         Collection orgs = new ArrayList();
         orgs.add(source);
         br = blm.saveOrganizations(orgs);
         if (br.getExceptions() != null)
         {
            fail(" Source:Save Orgs failed");
         }

         sourceKeys = br.getCollection();
         Iterator iter = sourceKeys.iterator();
         while (iter.hasNext())
         {
            savekey = (Key)iter.next();
         }
         sourceId = savekey.getId();
         String objectType = LifeCycleManager.ORGANIZATION;
         Organization pubSource = (Organization)bqm.getRegistryObject(sourceId, objectType);
         assertNotNull(pubSource.getName().getValue());

         // publish the target
         orgs.clear();
         orgs.add(target);
         br = blm2.saveOrganizations(orgs);
         if (br.getExceptions() != null)
         {
            fail(" Target:Save Orgs failed");
         }
         targetKeys = br.getCollection();
         iter = targetKeys.iterator();
         while (iter.hasNext())
         {
            savekey = (Key)iter.next();
         }
         targetId = savekey.getId();
         Organization pubTarget = (Organization)bqm2.getRegistryObject(targetId, objectType);

         Concept associationType = getAssociationConcept(type);
         if (associationType == null)
            fail(" getAssociationConcept returned null associationType");
View Full Code Here

    public static void main(String[] args) {
        try {
            setProperties();
            Connection conn = getConnection();
            RegistryService rs = conn.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ArrayList names = new ArrayList();
            //String qname= "%S%";
            String qname = "%";
            names.add(qname);
            Collection fQualifiers = new ArrayList();
            fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
            Key key = new KeyImpl("67AB9FD0-C3D9-11D8-BC4B-D52B9593C1C0");
            BulkResponse br = bqm.findServices(key, fQualifiers,
                    names, null, null);
            if (br != null &&
                    br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
                System.out.println("Successfully queried the  registry");
                System.out.println("for services matching the " +
View Full Code Here

    public static void main(String[] args) {
        try {
            setProperties();
            Connection conn = getConnection();
            RegistryService rs = conn.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ArrayList names = new ArrayList();
            //String qname= "%S%";
            String qname = "%";
            names.add(qname);
            Collection fQualifiers = new ArrayList();
            fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
            BulkResponse br = bqm.findOrganizations(fQualifiers,
                    names, null, null, null, null);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
                System.out.println("Successfully queried the  registry");
                System.out.println("for organizations matching the " +
                        "name pattern: \"" + qname + "\"");
View Full Code Here

        if (org == null) {
          if (super.getSubmittingOrganization() != null) {
            return super.getSubmittingOrganization();
          } else {
            RegistryService rs = super.getLifeCycleManager().getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            if (orgKey==null) return null;
                Organization o = (Organization) bqm.getRegistryObject(orgKey,
                        LifeCycleManager.ORGANIZATION);
                setProvidingOrganization(o)
                return o;
          }
        }
View Full Code Here

    {
        login();
        try
        {
            RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            blm = rs.getBusinessLifeCycleManager();
          
            Concept concept = blm.createConcept(null, CONCEPT_NAME, "");
            InternationalString is = blm.createInternationalString("This is the concept for Apache Scout Test");
            concept.setDescription(is);

            //Lets provide a link to juddi registry
            ExternalLink wslink =
                    blm.createExternalLink("http://to-rhaps4.toronto.redhat.com:9000/juddi",
                            "juddi");
            concept.addExternalLink(wslink);
            Classification cl = createClassificationForUDDI(bqm);

            concept.addClassification(cl);

            Collection<Concept> concepts = new ArrayList<Concept>();
            concepts.add(concept);

            Key key=null;
            BulkResponse br = blm.saveConcepts(concepts);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
            {
                System.out.println("Concept Saved");
                Collection coll = br.getCollection();
                Iterator iter = coll.iterator();
                while (iter.hasNext())
                {
                    key = (Key) iter.next();
                    System.out.println("Saved Key=" + key.getId());
                }//end while
            } else
            {
                System.err.println("JAXRExceptions " +
                        "occurred during save:");
                Collection exceptions = br.getExceptions();
                Iterator iter = exceptions.iterator();
                while (iter.hasNext())
                {
                    Exception e = (Exception) iter.next();
                    System.err.println(e.toString());
                    fail(e.toString());
                }
            }
           
            Concept savedConcept = (Concept)bqm.getRegistryObject(key.getId(),LifeCycleManager.CONCEPT);
            System.out.println("Save concept=" + savedConcept);
           
        } catch (JAXRException e)
        {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of javax.xml.registry.BusinessQueryManager

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.