Package org.apache.juddi.uuidgen

Examples of org.apache.juddi.uuidgen.UUIDGen


  }

  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 Category KeyedReference objects
        BusinessCategoryTable.insert(businessKey, keyRefs, connection);

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

        // insert another Collection of new Category KeyedReference objects
        BusinessCategoryTable.insert(
          business.getBusinessKey(),
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;

        Vector descList = new Vector();
        descList.add(new Description("blah, blah, blah", "en"));
        descList.add(new Description("Yadda, Yadda, Yadda", "it"));
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 authorizedUserID = "sviens";

        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");
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.steveviens.com/overviewdoc.html");

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

        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 TModel
        TModelTable.insert(tModel, authorizedUserID, connection);

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

        // insert another new TModel
        tModel.setTModelKey(uuidgen.uuidgen());
        TModelTable.insert(tModel, authorizedUserID, connection);

        // insert another Collection of new Identifier KeyedReference objects
        TModelIdentifierTable.insert(
          tModel.getTModelKey(),
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.setServiceKey(serviceKey);
        service.setBusinessKey(businessKey);

        Vector nameList = new Vector();
View Full Code Here

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

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

        String authToken1 = "juddi:"+uuidgen.uuidgen();
        AuthTokenTable.insert(authToken1,new Publisher("sviens","Steve Viens"),connection);
        AuthTokenTable.selectLastUsed(authToken1,connection);

        String authToken2 = "juddi:"+uuidgen.uuidgen();
        AuthTokenTable.insert(authToken2,new Publisher("sviens","Steve Viens"),connection);
        AuthTokenTable.selectLastUsed(authToken2,connection);

        System.out.println("PublisherID: "+AuthTokenTable.selectPublisher(authToken1,connection));
View Full Code Here

    SaveBusiness request = (SaveBusiness)regObject;
    String generic = request.getGeneric();
    AuthInfo authInfo = request.getAuthInfo();
    Vector businessVector = request.getBusinessEntityVector();
    Vector uploadRegVector = request.getUploadRegisterVector();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    // UploadRegistry functionality is not currently supported.
    if ((uploadRegVector != null) && (uploadRegVector.size() > 0))
      throw new UnsupportedException("Saving BusinessEntities via " +
        "UploadRegistry is not supported.");

    // aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    try
    {
      dataStore.beginTrans();

      // Validate authentication parameters
      Publisher publisher = getPublisher(authInfo,dataStore);

      String publisherID = publisher.getPublisherID();
      String authorizedName = publisher.getName();

      // Validate request parameters & execute
      for (int i=0; i<businessVector.size(); i++)
      {
        // Move the BusinessEntity into a form we can work with easily
        BusinessEntity business = (BusinessEntity)businessVector.elementAt(i);

        String businessKey = business.getBusinessKey();

        // If a BusinessKey was specified then make sure it's a valid one.
        if ((businessKey != null) && (businessKey.length() > 0) && (!dataStore.isValidBusinessKey(businessKey)))
          throw new InvalidKeyPassedException("businessKey="+businessKey);

        // If a BusinessKey was specified then make sure 'publisherID' controls it.
        if ((businessKey != null) && (businessKey.length() > 0) && (!dataStore.isBusinessPublisher(businessKey,publisherID)))
          throw new UserMismatchException("businessKey="+businessKey);

        // Normally, a valid tModelKey MUST be specified for the keyedReference
        // to be valid. However, in the case of a keyedReference that is used in
        // a categoryBag, the tModelKey may be omitted or specified as a
        // zero-length string to indicate that the taxonomy being used is
        // uddi-org:general_keywords. When it is omitted in this manner, the UDDI
        // registry will insert the proper key during the save_xx operation.
        // - UDDI Programmers API v2.04 Section 4.3.5.1 Specifying keyedReferences
        //
        CategoryBag categoryBag = business.getCategoryBag();
        if (categoryBag != null)
        {
          Vector keyedRefVector = categoryBag.getKeyedReferenceVector();
          if (keyedRefVector != null)
          {
            int vectorSize = keyedRefVector.size();
            if (vectorSize > 0)
            {
              for (int j=0; j<vectorSize; j++)
              {
                KeyedReference keyedRef = (KeyedReference)keyedRefVector.elementAt(j);
                String key = keyedRef.getTModelKey();
               
                // A null or zero-length tModelKey is treated as
                // though the tModelKey for uddiorg:general_keywords
                // had been specified.
                //
                if ((key == null) || (key.trim().length() == 0))
                  keyedRef.setTModelKey(TModel.GENERAL_KEYWORDS_TMODEL_KEY);
              }
            }
          }
        }
      }

      for (int i=0; i<businessVector.size(); i++)
      {
        // move the BusinessEntity into a form we can work with easily
        BusinessEntity business = (BusinessEntity)businessVector.elementAt(i);

        String businessKey = business.getBusinessKey();

        // If the new BusinessEntity has a BusinessKey then it must already
        // exists so delete the old one. It a BusinessKey isn't specified then
        // this is a new BusinessEntity so create a new BusinessKey for it.
        //
        if ((businessKey != null) && (businessKey.length() > 0))
        {
          dataStore.deleteBusiness(businessKey);
        }
        else
        {
          business.setBusinessKey(uuidgen.uuidgen());
        }

        // check if the business has DiscoveryURL with
        // useType as 'businessEntity' if not create one
        // and add it to the business object.
View Full Code Here

  {
    SaveBinding request = (SaveBinding)regObject;
    String generic = request.getGeneric();
    AuthInfo authInfo = request.getAuthInfo();
    Vector bindingVector = request.getBindingTemplateVector();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    // Aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    try
    {
      dataStore.beginTrans();

      // Validate authentication parameters
      Publisher publisher = getPublisher(authInfo,dataStore);
      String publisherID = publisher.getPublisherID();

      // Validate request parameters
      for (int i=0; i<bindingVector.size(); i++)
      {
        // Move the BindingTemplate into a form we can work with easily
        BindingTemplate binding = (BindingTemplate)bindingVector.elementAt(i);
        String serviceKey = binding.getServiceKey();
        String bindingKey = binding.getBindingKey();

        // Confirm that the 'BusinessService' that this binding belongs to
        // really exists. If not then throw an InvalidKeyPassedException.
       if ((serviceKey == null) || (serviceKey.length() == 0) || (!dataStore.isValidServiceKey(serviceKey)))
          throw new InvalidKeyPassedException("ServiceKey: "+serviceKey);

        // Confirm that 'publisherID' controls the BusinessService that this
        // binding template belongs to.  If not then throw a UserMismatchException.
        if (!dataStore.isServicePublisher(serviceKey,publisherID))
          throw new UserMismatchException("ServiceKey: "+serviceKey);

        // If a BindingKey was specified then make sure it's a valid one.
        if ((bindingKey != null) && (bindingKey.length() > 0) && (!dataStore.isValidBindingKey(bindingKey)))
          throw new InvalidKeyPassedException("BindingKey: "+bindingKey);

        // Normally, a valid tModelKey MUST be specified for the keyedReference
        // to be valid. However, in the case of a keyedReference that is used in
        // a categoryBag, the tModelKey may be omitted or specified as a
        // zero-length string to indicate that the taxonomy being used is
        // uddi-org:general_keywords. When it is omitted in this manner, the UDDI
        // registry will insert the proper key during the save_xx operation.
        // - UDDI Programmers API v2.04 Section 4.3.5.1 Specifying keyedReferences
        //
        CategoryBag categoryBag = binding.getCategoryBag();
        if (categoryBag != null)
        {
          Vector keyedRefVector = categoryBag.getKeyedReferenceVector();
          if (keyedRefVector != null)
          {
            int vectorSize = keyedRefVector.size();
            if (vectorSize > 0)
            {
              for (int j=0; j<vectorSize; j++)
              {
                KeyedReference keyedRef = (KeyedReference)keyedRefVector.elementAt(j);
                String key = keyedRef.getTModelKey();
               
                // A null or zero-length tModelKey is treated as
                // though the tModelKey for uddiorg:general_keywords
                // had been specified.
                //
                if ((key == null) || (key.trim().length() == 0))
                  keyedRef.setTModelKey(TModel.GENERAL_KEYWORDS_TMODEL_KEY);
              }
            }
          }
        }
      }

      for (int i=0; i<bindingVector.size(); i++)
      {
        // move the BindingTemplate data into a form we can work with easily
        BindingTemplate binding = (BindingTemplate)bindingVector.elementAt(i);
        String bindingKey = binding.getBindingKey();

        // If the new BindingTemplate has a BindingKey then it must already
        // exists so delete the old one. It a BindingKey isn't specified then
        // this is a new BindingTemplate so create a new BindingKey for it.
        if ((bindingKey != null) && (bindingKey.length() > 0))
          dataStore.deleteBinding(bindingKey);
        else
          binding.setBindingKey(uuidgen.uuidgen());

        // everything checks out so let's save it.
        dataStore.saveBinding(binding);
      }
View Full Code Here

    SaveTModel request = (SaveTModel)regObject;
    String generic = request.getGeneric();
    AuthInfo authInfo = request.getAuthInfo();
    Vector tModelVector = request.getTModelVector();
    Vector uploadRegVector = request.getUploadRegisterVector();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    // UploadRegistry functionality is not currently supported.
    if ((uploadRegVector != null) && (uploadRegVector.size() > 0))
      throw new UnsupportedException("Saving TModels via " +
        "UploadRegistry is not supported.");

    // aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    try
    {
      dataStore.beginTrans();

      // validate authentication parameters
      Publisher publisher = getPublisher(authInfo,dataStore);
      String publisherID = publisher.getPublisherID();
      String authorizedName = publisher.getName();

      // Validate request parameters
      for (int i=0; i<tModelVector.size(); i++)
      {
        // move the TModel into a form we can work with easily
        TModel tModel = (TModel)tModelVector.elementAt(i);
        String tModelKey = tModel.getTModelKey();

        // If a TModelKey was specified then make sure it's a valid one.
        if (((tModelKey != null) && (tModelKey.length() > 0)) && (!dataStore.isValidTModelKey(tModelKey)))
          throw new InvalidKeyPassedException("TModelKey: "+tModelKey);

        // If a TModelKey was specified then make sure 'publisherID' controls it.
        if (((tModelKey != null) && (tModelKey.length() > 0)) && !dataStore.isTModelPublisher(tModelKey,publisherID))
          throw new UserMismatchException("TModelKey: "+tModelKey);

        // Normally, a valid tModelKey MUST be specified for the keyedReference
        // to be valid. However, in the case of a keyedReference that is used in
        // a categoryBag, the tModelKey may be omitted or specified as a
        // zero-length string to indicate that the taxonomy being used is
        // uddi-org:general_keywords. When it is omitted in this manner, the UDDI
        // registry will insert the proper key during the save_xx operation.
        // - UDDI Programmers API v2.04 Section 4.3.5.1 Specifying keyedReferences
        //
        CategoryBag categoryBag = tModel.getCategoryBag();
        if (categoryBag != null)
        {
          Vector keyedRefVector = categoryBag.getKeyedReferenceVector();
          if (keyedRefVector != null)
          {
            int vectorSize = keyedRefVector.size();
            if (vectorSize > 0)
            {
              for (int j=0; j<vectorSize; j++)
              {
                KeyedReference keyedRef = (KeyedReference)keyedRefVector.elementAt(j);
                String key = keyedRef.getTModelKey();
               
                // A null or zero-length tModelKey is treated as
                // though the tModelKey for uddiorg:general_keywords
                // had been specified.
                //
                if ((key == null) || (key.trim().length() == 0))
                  keyedRef.setTModelKey(TModel.GENERAL_KEYWORDS_TMODEL_KEY);
              }
            }
          }
        }
      }

      for (int i=0; i<tModelVector.size(); i++)
      {
        // move the TModel into a form we can work with easily
        TModel tModel = (TModel)tModelVector.elementAt(i);
        String tModelKey = tModel.getTModelKey();

        // If the new TModel has a TModelKey then it must already exists
        // so delete the old one. It a TModelKey isn't specified then
        // this is a new TModel so create a new TModelKey for it.
        if ((tModelKey != null) && (tModelKey.length() > 0))
          dataStore.deleteTModel(tModelKey);
        else
          tModel.setTModelKey("uuid:"+uuidgen.uuidgen());

        // Everything checks out so let's save it. First store
        // 'authorizedName' and 'operator' values in each TModel.
        tModel.setAuthorizedName(authorizedName);
        tModel.setOperator(Config.getOperator());
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);
View Full Code Here

TOP

Related Classes of org.apache.juddi.uuidgen.UUIDGen

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.