Package javax.xml.registry

Examples of javax.xml.registry.BusinessQueryManager


    protected Concept getAssociationConcept(String associationType)
    {
        try
        {
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ClassificationScheme associationTypes =
                    bqm.findClassificationSchemeByName(null, "AssociationType");
            Collection types = associationTypes.getChildrenConcepts();
            Iterator iter = types.iterator();
            Concept concept = null;
            while (iter.hasNext())
            {
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;
        Association association = 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

     */
    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");
            }
            log.debug("Saved Source Organization");
           
            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

        try {
      final Concept jbossTModel = registry.getJBossESBTModel(connection);

      RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ServiceBinding serviceBinding = blm.createServiceBinding();
            String xml = EPRHelper.toXMLString(epr);
            serviceBinding.setAccessURI(xml);
           
            ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
View Full Code Here

      JAXRRegistryImpl registry = new JAXRRegistryImpl();
     
      final Concept jbossTModel = registry.getJBossESBTModel(connection);
      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            final ClassificationScheme cScheme = registry.getClassificationScheme(bqm, blm) ;
            Collection<Classification> classifications = new ArrayList<Classification>();
            Classification classification =
                blm.createClassification(
                  cScheme,
                  "category", category);
            classifications.add(classification);
      Collection<String> namePatterns = new ArrayList<String>();
      namePatterns.add(name);

            Collection<SpecificationLink> specifications = new ArrayList<SpecificationLink>();
           
          //Find based upon qualifier type and values
      Collection<String> findQualifiers = new ArrayList<String>();
      findQualifiers.add(FindQualifier.AND_ALL_KEYS);
      findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
      findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
      logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
      BulkResponse response = bqm.findServices(null, findQualifiers,
          namePatterns, classifications, specifications);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        return response.getCollection();
      } else {
        throw new RegistryException();
View Full Code Here

        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
        Connection connection = jaxrConnectionFactory.getConnection();
    try {
      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      ClassificationScheme classificationScheme = bqm.findClassificationSchemeByName(null, "uddi-org:general_keywords");
      Classification classification = blm.createClassification(classificationScheme,
          "Test transformation service", "transformation");
      Collection<Classification> classifications = new ArrayList<Classification>();
      classifications.add(classification);
      //Here I'd like to test filtering by this classification, but scout ignored the classification
      String name=classificationScheme.getName().getValue();
      logger.debug("Name=" + name);
      Collection<String> nameParams = new ArrayList<String>();
      //The name of the service is wild
      nameParams.add("%");
      BulkResponse bs = bqm.findServices(null, null,nameParams,classifications, null);
      int status = bs.getStatus();
      logger.debug("status=" + status);
    } catch (JAXRException je) {
      logger.error(je);
    }
View Full Code Here

    Service service =null;
    Organization organization = getJBossESBOrganization();
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
        //Adding the category as prefix for the name
      service = blm.createService(blm.createInternationalString(serviceName));
      if (isV3 && ((serviceDescription == null) || ("".equals(serviceDescription)))) {
        service.setDescription(blm.createInternationalString(SERVICE_DESCRIPTION));
View Full Code Here

                service = registerService(category, serviceName, serviceDescription);
            }

            RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            ServiceBinding serviceBinding = blm.createServiceBinding();
            String xml = EPRHelper.toXMLString(epr);
            serviceBinding.setAccessURI(xml);
           
            ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
View Full Code Here

      }
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
      // Define find qualifiers and name patterns
      Collection<String> findQualifiers = new ArrayList<String>();
      findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
      Collection<String> namePatterns = new ArrayList<String>();
   
      if (isV3) {
        namePatterns.add(organizationName);     
      } else {
        namePatterns.add("%" + organizationName + "%");
      }
          //Find based upon qualifier type and values
      logger.log(Level.DEBUG,"Going to query the registry for name pattern " + namePatterns);
      BulkResponse response = bqm.findOrganizations(findQualifiers,
          namePatterns, null, null, null, null);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();)
        {
          Organization org = (Organization) orgIter.next();
View Full Code Here

    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      final Concept jbossTModel = getJBossESBTModel(connection);
      // Get registry service and business query manager
      RegistryService rs = connection.getRegistryService();
      BusinessQueryManager bqm = rs.getBusinessQueryManager();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            final ClassificationScheme cScheme = getClassificationScheme(bqm, blm) ;
            Collection<Classification> classifications = new ArrayList<Classification>();
            Classification classification =
                blm.createClassification(
                  cScheme,
                  "category", category );
            classifications.add(classification);
      Collection<String> namePatterns = new ArrayList<String>();
      namePatterns.add(serviceName);

            Collection<SpecificationLink> specifications = new ArrayList<SpecificationLink>();
            SpecificationLink sl = new SpecificationLinkImpl(blm);
            sl.setSpecificationObject(jbossTModel);
      specifications.add(sl);
           
          //Find based upon qualifier type and values
      Collection<String> findQualifiers = new ArrayList<String>();
      findQualifiers.add(FindQualifier.AND_ALL_KEYS);
      findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
      findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
      logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
      BulkResponse response = bqm.findServices(null, findQualifiers,
          namePatterns, classifications, specifications);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        if (response.getCollection().size() <= 1) {
          for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();)
          {
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.