Package org.apache.juddi.util.jdbc

Examples of org.apache.juddi.util.jdbc.Transaction


    keysIn.add("901b15c5-799c-4387-8337-a1a35fceb791");
    keysIn.add("80fdae14-0e5d-4ea6-8eb8-50fde422056d");
    keysIn.add("e1996c33-c436-4004-9e3e-14de191bcc6b");
    keysIn.add("3ef4772f-e04b-46ed-8065-c5a4e167b5ba");

    Transaction txn = new Transaction();

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        FindServiceByNameQuery.select(businessKey,names,keysIn,null,connection);
        FindServiceByNameQuery.select(businessKey,names,null,null,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here


    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        //BusinessKey businessKey = BusinessKey.createKey();
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        //ServiceKey serviceKey = ServiceKey.createKey();
        String serviceKey = uuidgen.uuidgen();
        BusinessService service = new BusinessService();
        service.setServiceKey(serviceKey);
        service.setBusinessKey(businessKey);

        //BindingKey bindingKey = BindingKey.createKey();
        String bindingKey = uuidgen.uuidgen();
        BindingTemplate binding = new BindingTemplate();
        binding.setAccessPoint(
          new AccessPoint("http://www.juddi.org/binding.html", "http"));
        binding.setHostingRedirector(null);
        binding.setBindingKey(bindingKey);
        binding.setServiceKey(serviceKey);

        // Keyed References for the Binding Template CategoryBag.
        Vector keyRefs = new Vector();
        keyRefs.add(
          new KeyedReference(
            "uuid:" + uuidgen.uuidgen(),
            "alpha",
            "abcdefghi"));
        keyRefs.add(
          new KeyedReference("uuid:" + uuidgen.uuidgen(), "beta", "jklmnopqr"));
        keyRefs.add(
          new KeyedReference("uuid:" + uuidgen.uuidgen(), "omega", "stuvwxyz"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new BusinessService
        BusinessServiceTable.insert(service, connection);

        // insert a new BindingTemplate
        BindingTemplateTable.insert(binding, connection);

        // insert a Collection of new Category KeyedReference objects
        BindingCategoryTable.insert(bindingKey, keyRefs, connection);

        // select the Collection of KeyedReference objects
        keyRefs = BindingCategoryTable.select(bindingKey, connection);

        for (int i = 0; i < keyRefs.size(); i++)
        {
          KeyedReference keyRef = (KeyedReference) keyRefs.elementAt(i);
          System.out.println(" Key Name: " + keyRef.getKeyName());
          System.out.println("Key Value: " + keyRef.getKeyValue());
          System.out.println("TModelKey: " + keyRef.getTModelKey());
        }

        // delete the Collection of KeyedReference objects
        BindingCategoryTable.delete(bindingKey, connection);

        // select the Collection of KeyedReference objects
        keyRefs = BindingCategoryTable.select(bindingKey, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

  */
  public void beginTrans()
    throws org.apache.juddi.error.RegistryException
  {
    try {
      this.transaction = new Transaction();
      this.transaction.begin(connection);
    }
    catch(SQLException sqlex) {
      throw new RegistryException(sqlex);
    }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector contactList = new Vector();
        Contact contact = new Contact("Billy Bob");
        contact.setUseType("server");
        contactList.add(contact);
        int contactID = 0;

        Vector emailList = new Vector();
        Email email = null;

        email = new Email("support@steveviens.com");
        email.setUseType("Support");
        emailList.add(email);

        email = new Email("marketing@steveviens.com");
        email.setUseType("Advertising");
        emailList.add(email);

        email = new Email("info@steveviens.com");
        email.setUseType("Information");
        emailList.add(email);

        email = new Email("admin@steveviens.com");
        email.setUseType("Administration");
        emailList.add(email);

        email = new Email("webmaster@steveviens.com");
        email.setUseType("Web Master");
        emailList.add(email);

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new Contact
        ContactTable.insert(businessKey, contactList, connection);

        // insert a Collection of Email objects
        EmailTable.insert(businessKey, contactID, emailList, connection);

        // select a Collection of Email objects by BusinessKey
        emailList = EmailTable.select(businessKey, contactID, connection);

        // delete a Collection of Email objects by BusinessKey
        EmailTable.delete(businessKey, connection);

        // re-select a Collection of Email objects by BusinessKey
        emailList = EmailTable.select(businessKey, contactID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

  }

  public static void test(Connection connection)
    throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        OverviewDoc overviewDoc = new OverviewDoc();
        overviewDoc.setOverviewURL("http://www.sviens.com/jtruss.html");

        String tModelKey = uuidgen.uuidgen();
        TModel tModel = new TModel();
        tModel.setTModelKey(tModelKey);
        tModel.setAuthorizedName("Steve Viens");
        tModel.setOperator("WebServiceRegistry.com");
        tModel.setName("Tuscany Web Service Company");
        tModel.setOverviewDoc(overviewDoc);

        String publisherID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new TModel
        TModelTable.insert(tModel,publisherID,connection);

        // select one of the TModel objects
        tModel = TModelTable.select(tModelKey,connection);

        // select a Collection of TModel keys by PublisherID
        TModelTable.selectByPublisherID(publisherID,connection);

        TModelTable.verifyOwnership(tModelKey,"mviens",connection);
        TModelTable.verifyOwnership(tModelKey,"sviens",connection);

        // delete that TModel object
        //TModelTable.delete(tModelKey,connection);

        // re-select that TModel object
        tModel = TModelTable.select(tModelKey,connection);

        // re-select a Collection of TModel keys by PublisherID
        TModelTable.selectByPublisherID(publisherID,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here

    keysIn.add("uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4");
    keysIn.add("uuid:CD153257-086A-4237-B336-6BDCBDCC6634");
    keysIn.add("uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384");
    keysIn.add("uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E");   
   
    Transaction txn = new Transaction();

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        select(name,keysIn,null,connection);       
        select(name,null,null,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector keyRefs = new Vector();
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "blah, blah, blah"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "Yadda, Yadda, Yadda"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "WhoobWhoobWhoobWhoob"));
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "Haachachachacha"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a Collection of new Identifier KeyedReference objects
        BusinessIdentifierTable.insert(businessKey, keyRefs, connection);

        // insert another new BusinessEntity
        business.setBusinessKey(uuidgen.uuidgen());
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert another Collection of new Identifier KeyedReference objects
        BusinessIdentifierTable.insert(
          business.getBusinessKey(),
          keyRefs,
          connection);

        // select a Collection of Identifier KeyedReference objects
        keyRefs = BusinessIdentifierTable.select(businessKey, connection);

        // delete a Collection of Identifier KeyedReference objects
        BusinessIdentifierTable.delete(businessKey, connection);

        // re-select a Collection of Identifier KeyedReference objects
        keyRefs = BusinessIdentifierTable.select(businessKey, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector contactList = new Vector();
        Contact contact = new Contact("John Smith");
        contact.setUseType("tech support");
        contactList.add(contact);
        int contactID = 0;

        Vector phoneList = new Vector();
        Phone phone = null;

        phone = new Phone("603.457.8110");
        phone.setUseType("Voice Mailbox");
        phoneList.add(phone);

        phone = new Phone("603.457.8111");
        phone.setUseType("Fax");
        phoneList.add(phone);

        phone = new Phone("603.457.8112");
        phone.setUseType("Mobil");
        phoneList.add(phone);

        phone = new Phone("603.457.8113");
        phone.setUseType("Pager");
        phoneList.add(phone);

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new Contact
        ContactTable.insert(businessKey, contactList, connection);

        // insert a Collection of Phone objects
        PhoneTable.insert(businessKey, contactID, phoneList, connection);

        // select a Collection of Phone objects by BusinessKey
        phoneList = PhoneTable.select(businessKey, contactID, connection);

        // delete a Collection of Phone objects by BusinessKey
        PhoneTable.delete(businessKey, connection);

        // re-select a Collection of Phone objects by BusinessKey
        phoneList = PhoneTable.select(businessKey, contactID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        String serviceKey = uuidgen.uuidgen();
        BusinessService service = new BusinessService();
        service.setBusinessKey(businessKey);
        service.setServiceKey(serviceKey);

        String bindingKey = uuidgen.uuidgen();
        BindingTemplate binding = new BindingTemplate();
        binding.setServiceKey(serviceKey);
        binding.setBindingKey(bindingKey);
        binding.setAccessPoint(
          new AccessPoint("http://www.juddi.org/bindingtemplate.html", "http"));

        Vector infoList = new Vector();
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        int infoID = 0;

        OverviewDoc overviewDoc = new OverviewDoc();
        overviewDoc.setOverviewURL("http://www.juddi.org/overviewdoc.html");

        Vector descList = new Vector();
        descList.add(new Description("blah, blah, blah", "en"));
        descList.add(new Description("Yadda, Yadda, Yadda", "it"));
        descList.add(new Description("WhoobWhoobWhoobWhoob", "cy"));
        descList.add(new Description("Haachachachacha", "km"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new BusinessService
        BusinessServiceTable.insert(service, connection);

        // insert a new BindingTemplate
        BindingTemplateTable.insert(binding, connection);

        // insert a Collection of TModelInstanceInfo objects
        TModelInstanceInfoTable.insert(bindingKey, infoList, connection);

        // insert a Collection of Description objects
        InstanceDetailsDocDescTable.insert(
          bindingKey,
          infoID,
          descList,
          connection);

        // select the Collection of Description objects
        descList =
          InstanceDetailsDocDescTable.select(bindingKey, infoID, connection);

        // delete the Collection of Description objects
        InstanceDetailsDocDescTable.delete(bindingKey, connection);

        // re-select the Collection of Description objects
        descList =
          InstanceDetailsDocDescTable.select(bindingKey, infoID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        // Description List
        Vector descList = new Vector();
        descList.add(new Description("blah, blah, blah", "en"));
        descList.add(new Description("Yadda, Yadda, Yadda", "it"));
        descList.add(new Description("WhoobWhoobWhoobWhoob", "cy"));
        descList.add(new Description("Haachachachacha", "km"));

        // Contact
        Contact contact = new Contact("Anthony Michaels");
        contact.setUseType("sales");
        contact.setDescriptionVector(descList);

        // Contact List
        Vector contactList = new Vector();
        contactList.add(contact);
        Contacts contacts = new Contacts();
        contacts.setContactVector(contactList);

        // Business Entity
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");
        business.setContacts(contacts);

        int contactID = 0;

        // begin a new transaction
        txn.begin(connection);

        String authorizedUserID = "sviens";

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new Contact
        ContactTable.insert(businessKey, contactList, connection);

        // insert a Collection of Description objects
        ContactDescTable.insert(businessKey, contactID, descList, connection);

        // select a Collection BusinessService objects by BusinessKey
        descList = ContactDescTable.select(businessKey, contactID, connection);

        // delete a Collection BusinessService objects by BusinessKey
        ContactDescTable.delete(businessKey, connection);

        // re-select a Collection Description objects by BusinessKey
        descList = ContactDescTable.select(businessKey, contactID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of org.apache.juddi.util.jdbc.Transaction

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.