Package org.apache.juddi.datatype.service

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


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

    ServiceDetail object = new ServiceDetail();
    object.setGeneric("2.0");
    object.setOperator("jUDDI.org");
    object.setTruncated(false);
View Full Code Here


    contact.addAddress(address);

    Contacts contacts = new Contacts();
    contacts.addContact(contact);

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

    BusinessServices services = new BusinessServices();
    services.addBusinessService(service);
    services.addBusinessService(service);
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    BusinessService obj = new BusinessService();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    obj.setBusinessKey(element.getAttribute("businessKey"));
    obj.setServiceKey(element.getAttribute("serviceKey"));

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,NameHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      Name name = (Name )handler.unmarshal((Element)nodeList.elementAt(i));
      if (name != null)
        obj.addName(name);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,DescriptionHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      Description descr = (Description)handler.unmarshal((Element)nodeList.elementAt(i));
      if (descr != null)
        obj.addDescription(descr);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,BindingTemplatesHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(BindingTemplatesHandler.TAG_NAME);
      obj.setBindingTemplates((BindingTemplates)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,CategoryBagHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(CategoryBagHandler.TAG_NAME);
      obj.setCategoryBag((CategoryBag)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here

    return obj;
  }

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

    String serviceKey = service.getServiceKey();
    if (serviceKey != null)
      element.setAttribute("serviceKey",serviceKey);
    else
      element.setAttribute("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) && (categoryBag.getKeyedReferenceVector() != null) && (!categoryBag.getKeyedReferenceVector().isEmpty()))
    {
      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

          UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();
          Vector serviceVector = services.getBusinessServiceVector();
          int serviceListSize = serviceVector.size();
          for (int j=0; j<serviceListSize; j++)
          {
            BusinessService service = (BusinessService)serviceVector.elementAt(j);
            service.setBusinessKey(businessKey);

            // create a new key if serviceKey isn't specified
            String serviceKey = service.getServiceKey();
            if ((serviceKey == null) || (serviceKey.length() == 0)) {
              service.setServiceKey(uuidgen.uuidgen());
            }
           
            saveService(service);
          }
        }
View Full Code Here

   *
   */
  public BusinessService fetchService(String serviceKey)
    throws org.apache.juddi.error.RegistryException
  {
    BusinessService service = null;

    try
    {
      if ((serviceKey != null) && (connection != null))
      {
        service = BusinessServiceTable.select(serviceKey,connection);
        service.setNameVector(ServiceNameTable.select(serviceKey,connection));
        service.setDescriptionVector(ServiceDescTable.select(serviceKey,connection));

        Vector catVector = ServiceCategoryTable.select(serviceKey,connection);
        if (catVector.size() > 0)
        {
          CategoryBag bag = new CategoryBag();
          bag.setKeyedReferenceVector(catVector);
          service.setCategoryBag(bag);
        }

        // 'fetch' the BusinessService's BindingTemplate objects
        Vector bindingVector = fetchBindingByServiceKey(serviceKey);
        BindingTemplates bindings = new BindingTemplates();
        bindings.setBindingTemplateVector(bindingVector);
        service.setBindingTemplates(bindings);
      }
    }
    catch(java.sql.SQLException sqlex)
    {
      throw new RegistryException(sqlex);
View Full Code Here

      if ((businessKey != null) && (connection != null))
      {
        Vector tempList = BusinessServiceTable.selectByBusinessKey(businessKey,connection);
        for (int i=0; i<tempList.size(); i++)
        {
          BusinessService service = (BusinessService)tempList.elementAt(i);
          serviceList.add(fetchService(service.getServiceKey()));
        }
      }
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

        // loop through the vector deleting each server in turn
        int listSize = services.size();
        for (int i=0; i<listSize; i++)
        {
          BusinessService service = (BusinessService)services.elementAt(i);
          deleteService(service.getServiceKey());
        }
      }
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

        Vector services = BusinessServiceTable.selectByBusinessKey(businessKey,connection);
        for (int i=0; i<services.size(); i++)
        {
          // make a reference to this BusinessServce to
          // easily harvest ServiceInfo data from it.
          BusinessService service = (BusinessService)services.elementAt(i);
          String serviceKey = service.getServiceKey();

          // okay, create a new ServiceInfo
          ServiceInfo info = new ServiceInfo();
          info.setServiceKey(serviceKey);
          info.setBusinessKey(businessKey);
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.