Package org.apache.juddi.registry

Examples of org.apache.juddi.registry.RegistryEngine



  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here



  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here

  /***************************************************************************/

  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
      // create a request
      Vector nameVector = new Vector(5);
      nameVector.addElement(new Name("InflexionPoint"));
      nameVector.addElement(new Name("SteveViens.com"));
      nameVector.addElement(new Name("Liberty Mutual"));
      nameVector.addElement(new Name("Bowstreet"));
      nameVector.addElement(new Name("CMGi"));
      //nameVector.addElement(new Name("BusinessName #6 (1 over the maximum)"));

      Vector qualifierVector = new Vector(1);
      qualifierVector.add(
        new FindQualifier(FindQualifier.EXACT_NAME_MATCH));
      //qualifierVector.add(new FindQualifier("anInvalidFindQualifier"));

      FindQualifiers qualifiers = new FindQualifiers();
      qualifiers.setFindQualifierVector(qualifierVector);

      Vector categoryVector = new Vector();
      categoryVector.addElement(new KeyedReference("name1", "value1"));
      categoryVector.addElement(new KeyedReference("name2", "value2"));
      categoryVector.addElement(new KeyedReference("name3", "value3"));

      CategoryBag categoryBag = new CategoryBag();
      categoryBag.setKeyedReferenceVector(categoryVector);

      Vector identifierVector = new Vector();
      identifierVector.addElement(new KeyedReference("name1", "value1"));
      identifierVector.addElement(new KeyedReference("name1", "value1"));
      identifierVector.addElement(new KeyedReference("name1", "value1"));

      IdentifierBag identifierBag = new IdentifierBag();
      identifierBag.setKeyedReferenceVector(identifierVector);

      Vector tModelKeyVector = new Vector();
      tModelKeyVector.addElement(
        new String("6240b6f0-d4dd-4091-851b-d59fedbd0491"));
      tModelKeyVector.addElement(
        new String("ee0a154b-43ed-47be-b24f-878ab2956a31"));

      TModelBag tModelBag = new TModelBag();
      tModelBag.setTModelKeyVector(tModelKeyVector);

      Vector discoveryURLVector = new Vector();
      discoveryURLVector.addElement(new DiscoveryURL());
      discoveryURLVector.addElement(new DiscoveryURL());
      discoveryURLVector.addElement(new DiscoveryURL());

      DiscoveryURLs discoveryURLs = new DiscoveryURLs();
      discoveryURLs.setDiscoveryURLVector(discoveryURLVector);

      FindBusiness request = new FindBusiness();
      request.setNameVector(nameVector);
      request.setMaxRows(10);
      request.setCategoryBag(categoryBag);
      request.setIdentifierBag(identifierBag);
      request.setTModelBag(tModelBag);
      request.setDiscoveryURLs(discoveryURLs);
      request.setFindQualifiers(qualifiers);

      // invoke the server
      BusinessList response =
        (BusinessList) (new FindBusinessFunction(reg).execute(request));
      System.out.println(response);
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
      // valid request
      GetAuthToken request = new GetAuthToken("sviens","password");
      AuthToken response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println("Function: getAuthToken(sviens/password)");
      System.out.println(" AuthInfo: "+response.getAuthInfo());

      // invalid (unknown user) request
      request = new GetAuthToken("jdoe","password");
      System.out.println("Function: getAuthToken(jdoe/password)");
      response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println(" AuthInfo: "+response.getAuthInfo());

      // invalid (invalid credential) request
      request = new GetAuthToken("guest","password");
      System.out.println("Function: getAuthToken(guest/password)");
      response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println(" AuthInfo: "+response.getAuthInfo());
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
      // generate an AuthToken
      GetAuthToken authTokenRequest = new GetAuthToken("sviens","password");
      GetAuthTokenFunction authTokenService = new GetAuthTokenFunction(reg);
      AuthToken authToken = (AuthToken)authTokenService.execute(authTokenRequest);
      String authInfo = authToken.getAuthInfo().getValue();

      // create a couple of BusinessEntities
      BusinessEntity business1 = new BusinessEntity();
      business1.addName(new Name("Blockbuster","en"));

      BusinessEntity business2 = new BusinessEntity();
      business2.addName(new Name("Moonlighting","en"));

      Vector businessVector = new Vector(2);
      businessVector.addElement(business1);
      businessVector.addElement(business2);

      // create a SaveBusiness request & invoke the server
      SaveBusiness sbReq = new SaveBusiness();
      sbReq.setAuthInfo(new AuthInfo(authInfo));
      sbReq.setBusinessEntityVector(businessVector);
      BusinessDetail detail = (BusinessDetail)(new SaveBusinessFunction(reg).execute(sbReq));
      Vector detailVector = detail.getBusinessEntityVector();
      BusinessEntity b1 = (BusinessEntity)detailVector.elementAt(0);
      BusinessEntity b2 = (BusinessEntity)detailVector.elementAt(1);

      // create a new PublisherAssertion
      String fromKey = b1.getBusinessKey();
      String toKey = b2.getBusinessKey();
      KeyedReference keyedReference = new KeyedReference ("Partner Company","peer-peer");
      keyedReference.setTModelKey(TModel.RELATIONSHIPS_TMODEL_KEY);
      PublisherAssertion assertion = new PublisherAssertion(fromKey,toKey,keyedReference);

      // create a PublisherAssertion Vector
      Vector assertionVector = new Vector();
      assertionVector.addElement(assertion);

      // create an AddPublisherAssertions request & invoke the server
      AddPublisherAssertions apaReq = new AddPublisherAssertions();
      apaReq.setAuthInfo(new AuthInfo(authInfo));
      apaReq.setPublisherAssertionVector(assertionVector);
      DispositionReport dspRpt1 = (DispositionReport)(new AddPublisherAssertionsFunction(reg).execute(apaReq));
      System.out.println("errno: "+dspRpt1.toString());
      DispositionReport dspRpt2 = (DispositionReport)(new AddPublisherAssertionsFunction(reg).execute(apaReq));
      System.out.println("errno: "+dspRpt2.toString());

      // create an DeletePublisherAssertions request & invoke the server
      DeletePublisherAssertions dpaReq = new DeletePublisherAssertions();
      dpaReq.setAuthInfo(new AuthInfo(authInfo));
      dpaReq.setPublisherAssertionVector(assertionVector);
      DispositionReport response = (DispositionReport)(new DeletePublisherAssertionsFunction(reg).execute(dpaReq));
      System.out.println("errno: "+response.toString());
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
      // create & execute the GetAuthToken request
      GetAuthToken authTokenRequest = new GetAuthToken("sviens","password");
      AuthToken authToken = (AuthToken)reg.execute(authTokenRequest);
      AuthInfo authInfo = authToken.getAuthInfo();

      // generate a Name Vector
      Vector nameVector = new Vector();
      nameVector.add(new Name("IBM"));
      nameVector.add(new Name("Microsoft"));

      // generate a BusinessEntity
      BusinessEntity businessEntity = new BusinessEntity();
      businessEntity.setBusinessKey(null);
      businessEntity.setNameVector(nameVector);

      // generate a BusinessEntity Vector
      Vector businessEntityVector = new Vector();
      businessEntityVector.add(businessEntity);

      // create & execute the SaveBusiness request
      SaveBusiness request = new SaveBusiness();
      request.setAuthInfo(authInfo);
      request.setBusinessEntityVector(businessEntityVector);
      BusinessDetail detail = (BusinessDetail)reg.execute(request);
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here


  public static void main(String[] args)
  {
    // initialize the registry
    RegistryEngine reg = new RegistryEngine();
    reg.init();

    try
    {
    }
    catch (Exception ex)
    {
      // write execption to the console
      ex.printStackTrace();
    }
    finally
    {
      // destroy the registry
      reg.dispose();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.registry.RegistryEngine

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.