Package org.apache.ws.scout.model.uddi.v2

Examples of org.apache.ws.scout.model.uddi.v2.CategoryBag


            st.setAuthInfo(key);
            TModel tm = new TModel();
            tm.setName(new Name());
            tm.getName().setValue("My Company's Keymodel generator");
            tm.getName().setLang("en");
            tm.setCategoryBag(new CategoryBag());
            KeyedReference kr = new KeyedReference();
            kr.setTModelKey("uddi:uddi.org:categorization:types");
            kr.setKeyName("uddi-org:keyGenerator");
            kr.setKeyValue("keyGenerator");
            tm.getCategoryBag().getKeyedReference().add(kr);
View Full Code Here


            overviewURL.setValue(wsdlURL);
            OverviewDoc overviewDoc = new OverviewDoc();
            overviewDoc.setOverviewURL(overviewURL);
            tModel.getOverviewDoc().add(overviewDoc);
            // Set the categoryBag
            CategoryBag categoryBag = new CategoryBag();

            if (namespace != null && !"".equals(namespace)) {
                // A keyedReference with a tModelKey of the WSDL Entity Type category system and a keyValue of "binding".
                KeyedReference namespaceReference = newKeyedReference(
                        "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                categoryBag.getKeyedReference().add(namespaceReference);
            }

            // A keyedReference with a tModelKey of the WSDL Entity Type category system and a keyValue of "binding".
            KeyedReference typesReference = newKeyedReference(
                    "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "binding");
            categoryBag.getKeyedReference().add(typesReference);

            // A keyedReference with a tModelKey of the WSDL portType Reference category system and a keyValue
            // of the tModelKey that models the wsdl:portType to which the wsdl:binding relates.
            Binding binding = bindings.get(qName);
            String portTypeKey = keyDomainURI + binding.getPortType().getQName().getLocalPart();
            KeyedReference namespaceReference = newKeyedReference(
                    "uddi:uddi.org:wsdl:porttypereference", "uddi-org:wsdl:portTypeReference",
                    portTypeKey);
            categoryBag.getKeyedReference().add(namespaceReference);

            //  A keyedReference with a tModelKey of the UDDI Types category system and a keyValue of
            // "wsdlSpec" for backward compatibility.
            KeyedReference typesReferenceBackwardsCompatible = newKeyedReference(
                    "uddi:uddi.org:categorization:types", "uddi-org:types", "wsdlSpec");
            categoryBag.getKeyedReference().add(typesReferenceBackwardsCompatible);

            // One or two keyedReferences as required to capture the protocol
            for (Object object : binding.getExtensibilityElements()) {
                if (SOAPBinding.class.isAssignableFrom(object.getClass())) {
                    // If the wsdl:binding contains a soap:binding extensibility element from the
                    // 'http://schemas.xmlsoap.org/wsdl/soap/' namespace then the categoryBag MUST
                    //include a keyedReference with a tModelKey of the Protocol Categorization
                    // category system and a keyValue of the tModelKey of the SOAP Protocol tModel.
                    SOAPBinding soapBinding = (SOAPBinding) object;
                    KeyedReference soapProtocol = newKeyedReference(
                            "uddi:uddi.org:wsdl:categorization:protocol", "uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
                    categoryBag.getKeyedReference().add(soapProtocol);
                    // If the value of the transport attribute of the soap:binding element
                    // is 'http://schemas.xmlsoap.org/soap/http' then the categoryBag MUST
                    // include a keyedReference with a tModelKey of the Transport Categorization
                    // category system and a keyValue of the tModelKey of the HTTP Transport tModel.
                    if ("http://schemas.xmlsoap.org/soap/http".equals(soapBinding.getTransportURI())) {
                        KeyedReference httpTransport = newKeyedReference(
                                "uddi:uddi.org:wsdl:categorization:transport", "uddi-org:http", "uddi:uddi.org:transport:http");
                        categoryBag.getKeyedReference().add(httpTransport);
                    } else if (soapBinding.getTransportURI() != null) {
                        // TODO If the value of the transport attribute is anything else,
                        // then the bindingTemplate MUST include an additional keyedReference with a tModelKey
                        // of the Transport Categorization category system and a keyValue of the tModelKey of
                        // an appropriate transport tModel.
                        log.warn("not implemented");
                    }


                } else if (object.getClass().isInstance(HTTPBinding.class)) {

                    // If the wsdl:binding contains an http:binding extensibility element from the
                    // http://schemas.xmlsoap.org/wsdl/http/ namespace then the categoryBag MUST
                    // include a keyedReference with a tModelKey of the Protocol Categorization
                    // category system and a keyValue of the tModelKey of the HTTP Protocol tModel.
                    KeyedReference soapProtocol = newKeyedReference(
                            "uddi:uddi.org:wsdl:categorization:protocol", "uddi-org:protocol:http", "uddi:uddi.org:protocol:http");
                    categoryBag.getKeyedReference().add(soapProtocol);
                }
            }


            tModel.setCategoryBag(categoryBag);
View Full Code Here

            overviewURL.setValue(wsdlURL);
            OverviewDoc overviewDoc = new OverviewDoc();
            overviewDoc.setOverviewURL(overviewURL);
            tModel.getOverviewDoc().add(overviewDoc);
            // Create the categoryBag, The tModel MUST contain a categoryBag
            CategoryBag categoryBag = new CategoryBag();

            // the categoryBag MUST contain a keyedReference with a tModelKey of the WSDL
            // Entity Type category system and a keyValue of "portType".
            KeyedReference typesReference = newKeyedReference(
                    "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType");
            categoryBag.getKeyedReference().add(typesReference);

            // If the wsdl:portType has a targetNamespace then the categoryBag MUST also contain an
            // additional keyedReference with a tModelKey of the XML Namespace category system and a
            // keyValue of the target namespace of the wsdl:definitions element that contains the
            // wsdl:portType. If the targetNamespace is absent from the portType, a categoryBag
            // MUST NOT contain a keyedReference to the XML Namespace category system.
            if (namespace != null && !"".equals(namespace)) {
                KeyedReference namespaceReference = newKeyedReference(
                        "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                categoryBag.getKeyedReference().add(namespaceReference);
            }

            tModel.setCategoryBag(categoryBag);
            tModels.add(tModel);
        }
View Full Code Here

     * @return
     */
    public static FindTModel createFindBindingTModelForPortType(String portType, String namespace) {

        FindTModel findTModel = new FindTModel();
        CategoryBag categoryBag = new CategoryBag();

        if (namespace != null && namespace.length() != 0) {
            KeyedReference namespaceReference = newKeyedReference(
                    "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
            categoryBag.getKeyedReference().add(namespaceReference);
        }
        KeyedReference bindingReference = newKeyedReference(
                "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "binding");
        categoryBag.getKeyedReference().add(bindingReference);

        KeyedReference portTypeReference = newKeyedReference(
                "uddi:uddi.org:wsdl:porttypereference", "uddi-org:wsdl:portTypeReference", portType);
        categoryBag.getKeyedReference().add(portTypeReference);

        findTModel.setCategoryBag(categoryBag);

        if (log.isDebugEnabled()) {
            log.debug(new PrintUDDI<FindTModel>().print(findTModel));
View Full Code Here

        Name name = new Name();
        name.setLang("en");
        name.setValue(portTypeName);
        findTModel.setName(name);

        CategoryBag categoryBag = new CategoryBag();
        if (namespace != null && namespace.length() != 0) {
            KeyedReference namespaceReference = newKeyedReference(
                    "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
            categoryBag.getKeyedReference().add(namespaceReference);
        }
        KeyedReference bindingReference = newKeyedReference(
                "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType");
        categoryBag.getKeyedReference().add(bindingReference);

        findTModel.setCategoryBag(categoryBag);

        if (log.isDebugEnabled()) {
            log.debug(new PrintUDDI<FindTModel>().print(findTModel));
View Full Code Here

        Name sName = new Name();
        sName.setLang(lang);
        sName.setValue(serviceQName.getLocalPart());
        service.getName().add(sName);

        CategoryBag categoryBag = new CategoryBag();

        String namespace = serviceQName.getNamespaceURI();
        if (namespace != null && namespace != "") {
            KeyedReference namespaceReference = newKeyedReference(
                    "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
            categoryBag.getKeyedReference().add(namespaceReference);
        }

        KeyedReference serviceReference = newKeyedReference(
                "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "service");
        categoryBag.getKeyedReference().add(serviceReference);

        KeyedReference localNameReference = newKeyedReference(
                "uddi:uddi.org:xml:localname", "uddi-org:xml:localName", serviceQName.getLocalPart());
        categoryBag.getKeyedReference().add(localNameReference);

        service.setCategoryBag(categoryBag);

        return service;
    }
View Full Code Here

      description.setValue(TokenResolver.replaceTokens(uddiService.description(),properties));
      service.getDescription().add(description);
     
      //categoryBag on the service
      if (!"".equals(uddiService.categoryBag())) {
        CategoryBag categoryBag = parseCategoryBag(uddiService.categoryBag());
            service.setCategoryBag(categoryBag);
      }
     
      //bindingTemplate on service
      BindingTemplate bindingTemplate = parseServiceBinding(clazz, lang, webServiceAnnotation, properties);
View Full Code Here

          bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().add(instanceInfo);
        }
      }
      //categoryBag on the binding
      if (!"".equals(uddiServiceBinding.categoryBag())) {
        CategoryBag categoryBag = parseCategoryBag(uddiServiceBinding.categoryBag());
            bindingTemplate.setCategoryBag(categoryBag);
      }
    } else {
      log.error("Missing UDDIServiceBinding annotation in class " + classWithAnnotations);
    }
View Full Code Here

   * @param categoryBagStr
   * @return
   */
  protected CategoryBag parseCategoryBag(String categoryBagStr) {
   
    CategoryBag categoryBag = new CategoryBag();
    log.debug("CategoryBag Annotation=" + categoryBagStr);
    if (!"".equals(categoryBagStr)) {
      String[] sections = categoryBagStr.split(",");
          for (String section : sections) {
            if (section.startsWith(KEYED_REFERENCE)) {
                String keyedReferenceStr = section.substring(KEYED_REFERENCE.length(),section.length());
                log.debug("Found KeyedReference=" + keyedReferenceStr);
                String[] keyedReferences = keyedReferenceStr.split(";");
                KeyedReference keyedReference = new KeyedReference();
                for (String key : keyedReferences) {
            if (key.startsWith(KEY_NAME)) keyedReference.setKeyName(key.substring(KEY_NAME.length(),key.length()));
            if (key.startsWith(KEY_VALUE)) keyedReference.setKeyValue(key.substring(KEY_VALUE.length(),key.length()));
            if (key.startsWith(TMODEL_KEY)) keyedReference.setTModelKey(key.substring(TMODEL_KEY.length(),key.length()));
          }
                log.debug("KeyedReference = " + KEY_NAME + keyedReference.getKeyName() + " "
                                          + KEY_VALUE + keyedReference.getKeyValue() + " "
                                          + TMODEL_KEY + keyedReference.getTModelKey());
                categoryBag.getKeyedReference().add(keyedReference);
            } else {
              log.warn("Ignoring " + section);
                   //TODO add support for KeyedReferenceGroups?
            }
          }
View Full Code Here

            TModelDetail tModelDetail = clerk.getTModelDetail(findAllPortTypesForProcess);
            if (tModelDetail!=null) {
              List<TModel> tModelPortTypeList = tModelDetail.getTModel();
              if (tModelPortTypeList!=null && tModelPortTypeList.size()>0) {
                TModel bpel4WSTModel = tModelPortTypeList.get(0);
                CategoryBag categoryBag = bpel4WSTModel.getCategoryBag();
                if (categoryBag!=null && categoryBag.getKeyedReference()!=null) {
                  List<KeyedReference> portTypeTModelKeys = new ArrayList<KeyedReference>();
                  KeyedReference namespaceRef = null;
                  for (KeyedReference keyedReference : categoryBag.getKeyedReference()) {
                    if ("uddi:uddi.org:wsdl:porttypereference".equals(keyedReference.getTModelKey()) ) {
                      portTypeTModelKeys.add(keyedReference);
                    }
                    if ("uddi:uddi.org:xml:namespace".equals(keyedReference.getTModelKey()) ) {
                      namespaceRef = keyedReference;
View Full Code Here

TOP

Related Classes of org.apache.ws.scout.model.uddi.v2.CategoryBag

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.