Package org.apache.juddi.datatype.service

Examples of org.apache.juddi.datatype.service.BusinessService


    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    BusinessService service = (BusinessService)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);
    AbstractHandler handler = null;

    String serviceKey = service.getServiceKey();
    if (serviceKey != null)
      element.setAttribute("serviceKey",serviceKey);

    String businessKey = service.getBusinessKey();
    if (businessKey != null)
      element.setAttribute("businessKey",businessKey);

    Vector nameVector = service.getNameVector();
    if ((nameVector!=null) && (nameVector.size() > 0))
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      for (int i=0; i < nameVector.size(); i++)
        handler.marshal((Name)nameVector.elementAt(i),element);
    }

    Vector descrVector = service.getDescriptionVector();
    if ((descrVector!=null) && (descrVector.size() > 0))
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      for (int i=0; i < descrVector.size(); i++)
        handler.marshal((Description)descrVector.elementAt(i),element);
    }

    BindingTemplates bindings = service.getBindingTemplates();
    if (bindings != null)
    {
      handler = maker.lookup(BindingTemplatesHandler.TAG_NAME);
      handler.marshal(bindings,element);
    }

    CategoryBag categoryBag = service.getCategoryBag();
    if (categoryBag != null)
    {
      handler = maker.lookup(CategoryBagHandler.TAG_NAME);
      handler.marshal(categoryBag,element);
    }
View Full Code Here


    CategoryBag catBag = new CategoryBag();
    catBag.addKeyedReference(new KeyedReference("keyName","keyValue"));
    catBag.addKeyedReference(new KeyedReference("uuid:dfddb58c-4853-4a71-865c-f84509017cc7","keyName2","keyValue2"));

    BusinessService service = new BusinessService();
    service.setServiceKey("fe8af00d-3a2c-4e05-b7ca-95a1259aad4f");
    service.setBusinessKey("b8cc7266-9eed-4675-b621-34697f252a77");
    service.setBindingTemplates(bindings);
    service.setCategoryBag(catBag);
    service.addName(new Name("serviceNm"));
    service.addName(new Name("serviceNm2","en"));
    service.addDescription(new Description("service whatever"));
    service.addDescription(new Description("service whatever too","it"));

    System.out.println();

    RegistryObject regObject = service;
    handler.marshal(regObject,parent);
View Full Code Here

    if (serviceVector == null)
      return null;
   
    for (int i=0; i<serviceVector.size(); i++)
    {
      BusinessService service = (BusinessService)serviceVector.elementAt(i);
     
      CategoryBag catBag = service.getCategoryBag();
      if (catBag != null)
      {
        Vector refs = catBag.getKeyedReferenceVector();
        if ((refs != null) && (refs.size() > 0))
          validate(refs);
      }
     
      BindingTemplates templates = service.getBindingTemplates();
      if (templates != null)
      {
        Vector bindings = templates.getBindingTemplateVector();
        if (bindings != null)
          validateBindingVector(bindings);
View Full Code Here

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

   * @throws java.sql.SQLException
   */
  public static BusinessService select(String serviceKey,Connection connection)
    throws java.sql.SQLException
  {
    BusinessService service = null;
    PreparedStatement statement = null;
    ResultSet resultSet = null;

    try
    {
      statement = connection.prepareStatement(selectSQL);
      statement.setString(1,serviceKey.toString());

      log.debug("select from BUSINESS_SERVICE table:\n\n\t" + selectSQL +
        "\n\t SERVICE_KEY=" + serviceKey.toString() + "\n");

      resultSet = statement.executeQuery();
      if (resultSet.next())
      {
        service = new BusinessService();
        service.setBusinessKey(resultSet.getString(1));//("BUSINESS_KEY"));
        service.setServiceKey(serviceKey);
      }

      return service;
    }
    finally
View Full Code Here

      // execute the statement
      resultSet = statement.executeQuery();
      while (resultSet.next())
      {
        BusinessService service = new BusinessService();
        service.setBusinessKey(businessKey);
        service.setServiceKey(resultSet.getString(1));//("SERVICE_KEY"));
        serviceList.add(service);
      }

      return serviceList;
    }
View Full Code Here

        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

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

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

        String authorizedUserID = "sviens";

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

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

        // insert another new BusinessService
        service.setServiceKey(uuidgen.uuidgen());
        BusinessServiceTable.insert(service,connection);

        // insert one more new BusinessService
        service.setServiceKey(uuidgen.uuidgen());
        BusinessServiceTable.insert(service,connection);

        // select a BusinessService object
        service = BusinessServiceTable.select(serviceKey,connection);
View Full Code Here

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

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

        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 Collection of new Category KeyedReference objects
        ServiceCategoryTable.insert(serviceKey, keyRefs, connection);

        // insert another new BusinessService
        service.setServiceKey(uuidgen.uuidgen());
        BusinessServiceTable.insert(service, connection);

        // insert another Collection of new Category KeyedReference objects
        ServiceCategoryTable.insert(
          service.getServiceKey(),
          keyRefs,
          connection);

        // select a Collection of Category KeyedReference objects
        keyRefs = ServiceCategoryTable.select(serviceKey, connection);
View Full Code Here

      // validate request parameters & execute
      for (int i=0; i<serviceVector.size(); i++)
      {
        // move the BusinessService data into a form we can work with easily
        BusinessService service = (BusinessService)serviceVector.elementAt(i);
        String businessKey = service.getBusinessKey();
        String serviceKey = service.getServiceKey();

        // If a BusinessKey wasn't included or it is an invalid BusinessKey then
        // throw an InvalidKeyPassedException
        if ((businessKey == null) || (businessKey.length() == 0) || (!dataStore.isValidBusinessKey(businessKey)))
          throw new InvalidKeyPassedException("businessKey="+businessKey);

        // Confirm that 'publisherID' controls the BusinessEntity that this
        // BusinessService belongs to.  If not then throw a UserMismatchException.
        if (!dataStore.isBusinessPublisher(businessKey,publisherID))
          throw new UserMismatchException("businessKey="+serviceKey);

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

      for (int i=0; i<serviceVector.size(); i++)
      {
        // move the BusinessService data into a form we can work with easily
        BusinessService service = (BusinessService)serviceVector.elementAt(i);
        String serviceKey = service.getServiceKey();

        // If the new BusinessService has a ServiceKey then it must already
        // exists so delete the old one. It a ServiceKey isn't specified then
        // this is a new BusinessService so create a new ServiceKey for it.
        if ((serviceKey != null) && (serviceKey.length() > 0))
          dataStore.deleteService(serviceKey);
        else
          service.setServiceKey(uuidgen.uuidgen());

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

TOP

Related Classes of org.apache.juddi.datatype.service.BusinessService

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.