Package javax.xml.registry

Examples of javax.xml.registry.BusinessLifeCycleManager


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

      RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
           
            fromService.removeServiceBinding(binding);
            Collection bindings = new ArrayList();
            bindings.add(binding.getKey());
            blm.deleteServiceBindings(bindings);

            toService.addServiceBinding(binding);
            bindings = new ArrayList();
            bindings.add(binding);
            blm.saveServiceBindings(bindings);           
           
    catch (JAXRException je) {
            throw je;
    }
  }
View Full Code Here


  private void removeBindings(Collection keys, Connection connection)
    throws JAXRException
  {
    try {
      RegistryService rs = connection.getRegistryService();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
       
            blm.deleteServiceBindings(keys);
    catch (JAXRException je) {
          throw je;
    }
  }
View Full Code Here

  private void removeService(Service service, Connection connection)
    throws JAXRException
  {
    try {
      RegistryService rs = connection.getRegistryService();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
     
          Collection<Key> serviceKeys = new ArrayList<Key>();
          serviceKeys.add(service.getKey());
          blm.deleteServices(serviceKeys);
    catch (JAXRException je) {
          throw je;
    }
  }
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();
            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>();
View Full Code Here

    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      //Logging in
      RegistryService rs = connection.getRegistryService();
      //Building organization
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
        organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));

      User user = blm.createUser();
      organization.setPrimaryContact(user);
      PersonName personName = blm.createPersonName("JBossESB");
      TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
      telephoneNumber.setNumber("404 467-8555");
      telephoneNumber.setType(null);
      PostalAddress address = blm.createPostalAddress("3340",
          "Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
          "30326", "Office");
      Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
      postalAddresses.add(address);
      Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
      EmailAddress emailAddress = blm
          .createEmailAddress("jbossesb@jboss.com");
      emailAddresses.add(emailAddress);

      Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
      numbers.add(telephoneNumber);
View Full Code Here

      BulkResponse br = null;
      //Logging in
      RegistryService rs = connection.getRegistryService();
      //Building organization
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();

      final String interfaceName ;
      if (registryObject instanceof Organization) {
        interfaceName = Organization.class.getCanonicalName() ;
        Collection<Organization> orginations = new ArrayList<Organization>();
       
        orginations.add((Organization) registryObject);
        br = blm.saveOrganizations(orginations);
      } else if (registryObject instanceof Service) {
        interfaceName = Organization.class.getCanonicalName() ;
        Collection<Service> services = new ArrayList<Service>();
        services.add((Service) registryObject);
        br = blm.saveServices(services);
      } else if (registryObject instanceof ServiceBinding) {
        interfaceName = Organization.class.getCanonicalName() ;
        Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
        serviceBindings.add((ServiceBinding) registryObject);
        br = blm.saveServiceBindings(serviceBindings);
      } else {
        logger.log(Level.ERROR, "Trying to save an unsupported RegistryObject");
        throw new JAXRException("Trying to save an unsupported RegistryObject");
      }
            //Verify the return
View Full Code Here

    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);
View Full Code Here

        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");

            Association a = blm.createAssociation(pubTarget, associationType);
            a.setSourceObject(pubSource);

            blm2.confirmAssociation(a);

            Collection associations = new ArrayList();
            associations.add(a);
            br = blm2.saveAssociations(associations, false);
            if (br.getExceptions() != null)
            {
                fail(" Save Association did not complete due to errors");
            }

            associationKeys = br.getCollection();
            iter = associationKeys.iterator();

            Collection associationTypes = new ArrayList();
            associationTypes.add(associationType);
            //confirmedByCaller = false, confirmedByOtherParty = true.
            br = bqm.findCallerAssociations(null,
                    new Boolean(false),
                    new Boolean(true), associationTypes);
            if (br.getExceptions() != null)
            {
                fail(" Find Caller Association failed");
            }
            associations = br.getCollection();
            if (associations.size() == 0)
            {
                fail(" Retrieving Associations failed");
            }
            iter = associations.iterator();
            while (iter.hasNext())
            {
                a = (Association) iter.next();
            }

            assertNotNull("Association type:", a.getAssociationType().getValue());
            if (a.isConfirmed())
            {
                fail("FAIL: isConfirmed returned true  ");
            }
            if (a.isConfirmedBySourceOwner())
            {
                fail("FAIL: isConfirmedBySourceOwner returned true  ");
            }

            blm.confirmAssociation(a);
            br = blm.saveAssociations(associations, false);
            if (br.getExceptions() != null)
            {
                fail("Error:  saveAssociations failed  ");
            }


            br = bqm.findCallerAssociations(null, new Boolean(true), new Boolean(true), associationTypes);

            if (br.getExceptions() != null)
            {
                fail("Error:  findCallerAssociations failed  ");
            }

            associations = br.getCollection();
            iter = associations.iterator();
            while (iter.hasNext())
            {
                a = (Association) iter.next();
            }

            if (!(a.isConfirmed()))
            {
                fail("FAIL: isConfirmed incorrectly returned false ");
            }

            if (!(a.isConfirmedBySourceOwner()))
            {
                fail("FAIL: isConfirmedBySourceOwner incorrectly returned false ");
            }
        } catch (Exception e)
        {
            e.printStackTrace();
            fail("Caught unexpected exception: " + e.getMessage());
        } finally
        {
            // Clean up
            try
            {
                blm2.deleteOrganizations(targetKeys);
                blm.deleteOrganizations(sourceKeys);
            } catch (JAXRException je)
            {
                fail("Error: not able to delete registry objects");
            }
View Full Code Here

      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");

         Association a = blm.createAssociation(pubTarget, associationType);
         a.setSourceObject(pubSource);

         blm.confirmAssociation(a); //First user
         blm2.confirmAssociation(a); //Second user

         // publish Association
         Collection associations = new ArrayList();
         associations.add(a);
         // Second user saves the association.
         br = blm2.saveAssociations(associations, false);

         if (br.getExceptions() != null)
         {
            fail("Error:Save Associations failed \n");
         }
         BulkResponse targetAssoc = bqm.findCallerAssociations(null,
                 new Boolean(true),
                 new Boolean(true),
                 null);

         if (targetAssoc.getExceptions() == null)
         {
            Collection targetCol = targetAssoc.getCollection();
            if (targetCol.size() > 0)
            {
               iter = targetCol.iterator();
               while (iter.hasNext())
               {
                  Association a1 = (Association)iter.next();
                  Organization o = (Organization)a1.getSourceObject();
                  o = (Organization)a1.getTargetObject();
                  Concept atype = a1.getAssociationType();
                  assertNotNull("Concept Type stored in Association", atype);
               }
            }
         }


         br = null;
         Collection associationTypes = new ArrayList();
         associationTypes.add(type);
         br = bqm.findAssociations(null, sourceId, targetId, null);
         if (br.getExceptions() != null)
         {
            fail("Error:    findAssociations failed ");
         }
         associations = null;
         associations = br.getCollection();
         if (associations.size() > 0)
         {
            iter = associations.iterator();
            while (iter.hasNext())
            {
               Association a1 = (Association)iter.next();
               assockey = a1.getKey();
               ScoutUtil.validateAssociation(a1,orgSource);
            }
         }
      }
      catch (Exception e)
      {
         e.printStackTrace();
         fail(" Test failed ");
      }
      finally
      {
         //Clean Up
         try
         {
            if (assockey != null)
            {
               associationKeys = new ArrayList();
               associationKeys.add(assockey);
               blm.deleteAssociations(associationKeys);
            }
            blm2.deleteOrganizations(targetKeys);
            blm.deleteOrganizations(sourceKeys);
         }
         catch (JAXRException ex)
         {
            ex.printStackTrace();
View Full Code Here

    }

    public RegistryObject getRegistryObject(String id, String objectType) throws JAXRException
    {
        IRegistryV3 registry = (IRegistryV3) registryService.getRegistry();
        BusinessLifeCycleManager lcm = registryService.getBusinessLifeCycleManager();

        if (LifeCycleManager.CLASSIFICATION_SCHEME.equalsIgnoreCase(objectType)) {

            try {
View Full Code Here

TOP

Related Classes of javax.xml.registry.BusinessLifeCycleManager

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.