Examples of BusinessService


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

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

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

  AbstractHandler handler = maker.lookup(ValidateValuesHandler.TAG_NAME);
    Element parent = XMLUtils.newRootElement();
    Element child = null;

    BusinessEntity business = new BusinessEntity();
    BusinessService service = new BusinessService();
    TModel tModel = new TModel();

    ValidateValues request = new ValidateValues();
    request.addBusinessEntity(business);
    request.addBusinessService(service);
View Full Code Here

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

    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

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

    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

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

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    BusinessService service = (BusinessService)object;
    String generic = getGeneric(null);
    String namespace = getUDDINamespace(generic);
    Element element = parent.getOwnerDocument().createElementNS(namespace,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

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

    System.out.println();

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

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

      // 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("save_service: "+
              "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("save_service: "+
              "userID="+publisherID+", "+
              "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("save_service: "+
              "serviceKey="+serviceKey);

        // 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 = service.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<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

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

      // generate a Name Vector
      Vector nameVector = new Vector();
      nameVector.add(new Name("Dow Chemical"));

      // generate a BusinessService
      BusinessService service = new BusinessService();
      service.addName(new Name("Reaction Finder"));
      service.addDescription(new Description("Finds side effects when combining chemicals"));

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

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 detail = new ServiceDetail();
    //detail.setGeneric("2.0");
    //detail.setOperator("jUDDI.org");
    detail.setTruncated(false);
View Full Code Here

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

          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
TOP
Copyright © 2018 www.massapi.com. 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.