Package javax.xml.registry

Examples of javax.xml.registry.Connection


        return cs;
    }

    protected Connection loginSecondUser()
    {
        Connection con = null;
        try
        {
            if (factory == null)
                throw new IllegalStateException("ConnectionFactory is null");
            con = factory.createConnection();
        } catch (JAXRException e)
        {
            e.printStackTrace();
        }
        PasswordAuthentication passwdAuth = new PasswordAuthentication("jbosscts",
                passwd.toCharArray());
        Set creds = new HashSet();
        creds.add(passwdAuth);

        try
        {
            con.setCredentials(creds);
        } catch (JAXRException e)
        {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here


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

   * We're ignoring this test until I come up with a patch.
   *
   */
  public void findServicesByClassification() throws ConfigurationException {
        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");
View Full Code Here

    if (epr == null)
    {
      throw new RegistryException("Null EPR argument specified") ;
    }
    JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Connection connection = jaxrConnectionFactory.getConnection();
        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);
View Full Code Here

        }
  }
 
  public Collection findMultipleServices(String category, String name) throws ConfigurationException, JAXRException, RegistryException {
    JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Connection connection = jaxrConnectionFactory.getConnection();
    try {
      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 =
View Full Code Here

   */
  protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException
  {
    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)))) {
View Full Code Here

   * @throws RegistryException
   * @throws ServiceNotFoundException
   */
    public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException{
        //    first find the ServiceBindings for this service
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
        Service service = null;
        try {
            service = findService(category, serviceName);
            if (service==null) {
                throw new ServiceNotFoundException("No such EPR found for service with name = " + serviceName);
            }
            RegistryService rs = connection.getRegistryService();
            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
            Collection<Key> serviceKeys = new ArrayList<Key>();
            serviceKeys.add(service.getKey());
            blm.deleteServices(serviceKeys);
        } catch (JAXRException je) {
View Full Code Here

    }
    if (epr == null)
    {
      throw new RegistryException("Null EPR argument specified") ;
    }
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
        try {
      final Concept jbossTModel = getJBossESBTModel(connection);
   
            //Find the service
            Service service = findService(category,serviceName);
            if (service==null) {
                logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
                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);
View Full Code Here

   * @throws RegistryException
   * @throws ServiceNotFoundException
   */
  public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException, ServiceNotFoundException{
        //first find the ServiceBindings for this service
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
        Service service = null;
        try {
            service = findService(category, serviceName);
            if (service==null) {
                throw new ServiceNotFoundException("No such Service found for service with category= "
                        + category + " and name = " + serviceName);
            }
            Collection serviceBindings = findServiceBindings(service);
            String toBeDeletedEPRXml = EPRHelper.toXMLString(toBeDeletedEPR).trim();
            for (Iterator i=serviceBindings.iterator();i.hasNext();){
                ServiceBinding serviceBinding = (ServiceBinding) i.next();
                String eprXML = serviceBinding.getAccessURI().trim();
                // for backwards compatibility still have the decoder if
                // unmarchalling fails
                try {
                    EPRHelper.fromXMLString(eprXML);
                } catch (UnmarshalException unme) {
                    try {
                        eprXML = URLDecoder.decode(eprXML, "UTF-8").trim();
                    } catch (UnsupportedEncodingException ue) {
                        logger.error(unme.getMessage(), unme);
                        logger.error(ue.getMessage(), ue);
                    }
                }
                if (eprXML.equals(toBeDeletedEPRXml)) {
                    RegistryService rs = connection.getRegistryService();
                    BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
                    Collection<Key> serviceBindingKeys = new ArrayList<Key>();
                    serviceBindingKeys.add(serviceBinding.getKey());
                    blm.deleteServiceBindings(serviceBindingKeys);
                    return;
View Full Code Here

   */
  public List<EPR> findEPRs(String category, String serviceName) throws RegistryException, ServiceNotFoundException
  {
    List<EPR> eprs = new ArrayList<EPR>();

    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      final Concept jbossTModel = getJBossESBTModel(connection);

      Service service = findService(category, serviceName);
      if (service==null){
View Full Code Here

TOP

Related Classes of javax.xml.registry.Connection

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.