Package org.uddi4j.datatype.tmodel

Examples of org.uddi4j.datatype.tmodel.TModel


      WSDLDocument wsdlDoc = null;
      try {
          UDDIProxy uddiProxy = new UDDIProxy();
          UDDIReference uddiReference = getAnalyzerConfig().getUDDIReference();
          uddiProxy.setInquiryURL(uddiReference.getInquiryURL());
          TModel tModel = null;

          if (uddiReference.getKeyType().equals(UDDIReference.BINDING_KEY)) {
              BindingDetail bindingDetail = uddiProxy.get_bindingDetail(
                      uddiReference.getKey());
              BindingTemplate bindingTemplate = (BindingTemplate) bindingDetail.
View Full Code Here


   * @throws UDDIException if the return value of a UDDI API cannot indicate
   *         an error condition.
   */
  public static TModel getTModelByKey(UDDIProxy proxy, String key)
  {
    TModel result = null;

    try
    {
      TModelDetail bd = proxy.get_tModelDetail(key);

View Full Code Here

    UDDIProxy uddiProxy,
    BindingTemplate bindingTemplate,
    boolean verboseOption)
    throws WSIException
  {
    TModel tModel = null;

    // Get the list of tModel references associated with this bindingTemplate
    Iterator iterator =
      bindingTemplate
        .getTModelInstanceDetails()
        .getTModelInstanceInfoVector()
        .iterator();

    // Process each tModel reference
    Vector tModelKeyList = new Vector();
    while (iterator.hasNext())
    {
      // Get tModelInstanceInfo
      TModelInstanceInfo tModelInstanceInfo =
        (TModelInstanceInfo) iterator.next();

      // Add key to list
      tModelKeyList.add(tModelInstanceInfo.getTModelKey());
    }

    // Get the tModels associated with the bindingTemplate
    if (tModelKeyList.size() > 0)
    {
      try
      {
        // Get the tModel details
        TModelDetail tModelDetail = uddiProxy.get_tModelDetail(tModelKeyList);

        // Get the list of tModels
        Iterator tModelIterator = tModelDetail.getTModelVector().iterator();

        //boolean tModelFound = false;
        TModel nextTModel = null;

        // Go through the list of tModels
        while ((tModelIterator.hasNext()) && (tModel == null))
        {
          // Get next tModel in list
View Full Code Here

    result = AssertionResult.RESULT_PASSED;

    Binding binding = null;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
      return validator.createAssertionResult(
        testAssertion,
        result,
        failureDetailMessage);
    }

    String key = tModel.getTModelKey();

    OverviewDoc doc = tModel.getOverviewDoc();
    if (doc != null)
    {
      String urlText = doc.getOverviewURLString();

      // Try to resolve the URL & check the WSDL
View Full Code Here

    EntryContext entryContext)
    throws WSIException
  {
    result = AssertionResult.RESULT_FAILED;

    TModel tModel =
      UDDIUtils.getTModelByKey(
        this.validator.uddiProxy,
        UDDIUtils.getWSIConformanceTModelKey(this.validator.uddiProxy));

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
    }
    else
    {
      boolean validURL =
        tModel.getOverviewDoc() != null
          && "http://ws-i.org/schemas/conformanceClaim/".equals(
            tModel.getOverviewDoc().getOverviewURLString());
      boolean validCategory = checkCategoryBag(tModel.getCategoryBag());

      if (validURL && validCategory)
      {
        result = AssertionResult.RESULT_PASSED;
      }
View Full Code Here

  {

    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
    }

    // If there is a tModel
    else
    {
      CategoryBag bag = tModel.getCategoryBag();

      try
      {
        if (!checkCategoryBag(this.validator.uddiProxy, bag))
        {
          // failed
          result = AssertionResult.RESULT_FAILED;
          failureDetailMessage =
            "The tModel key is: [" + tModel.getTModelKey() + "].";
        }
      }
      catch (IllegalStateException e)
      {
        result = AssertionResult.RESULT_FAILED;
View Full Code Here

    KeyedReference claimKeyedRef = null;

    // check whether a UDDI conformance claim is being made...

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();
    try
    {
      if ((claimKeyedRef = conformanceClaimMade(tModel)) == null)
      {
        throw new AssertionResultException(
          AssertionResult.RESULT_NOT_APPLICABLE);
      }

      // we have a conformance claim, so check the keyedReference keyValue
      if (!claimKeyedRef
        .getKeyValue()
        .equals(WSIConstants.ATTRVAL_UDDI_CLAIM_KEYVALUE))
      {
        throw new AssertionResultException(
          AssertionResult.RESULT_FAILED,
          "The tModel key is: ["
            + tModel.getTModelKey()
            + "].\nThe categoryBag is: ["
            + tModel.getCategoryBag()
            + "].");
      }
    }
    catch (AssertionResultException e)
    {
View Full Code Here

    throws WSIException
  {
    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
    }

    // If there is a tModel
    else
    {
      try
      {
        HashSet claimsFromUDDI = getConformanceClaimsFromUDDI(tModel);
        HashSet claimsFromWSDL = getConformanceClaimsFromWSDL(tModel);

        if (claimsFromUDDI.size() == 0)
        {
          result = AssertionResult.RESULT_PASSED;
        }
        else if (claimsFromUDDI.size() == claimsFromWSDL.size())
        {
          int counter = 0;
          for (Iterator iter = claimsFromWSDL.iterator(); iter.hasNext();)
          {
            String claim = (String) iter.next();

            for (Iterator iter2 = claimsFromUDDI.iterator();
              iter2.hasNext();
              )
            {
              String uddiClaim = (String) iter2.next();
              if (claim.equalsIgnoreCase(uddiClaim))
              {
                counter++;
                break;
              }
            }
          }

          if (counter != claimsFromWSDL.size())
          {
            // failed
            result = AssertionResult.RESULT_FAILED;
            failureDetailMessage =
              "The tModel key is: [" + tModel.getTModelKey() + "].";
          }
        }
        else
        {
          // failed
          result = AssertionResult.RESULT_FAILED;
          failureDetailMessage =
            "The tModel key is: [" + tModel.getTModelKey() + "].";
        }
      }
      catch (IllegalStateException e)
      {
        result = AssertionResult.RESULT_FAILED;
        failureDetailMessage =
          "The tModel key is: [" + tModel.getTModelKey() + "].";
      }

    }

    // Return assertion result
View Full Code Here

    throws WSIException
  {
    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage =
        "Could not locate a tModel with a categorization of 'wsdlSpec'.";
    }

    // If there is a tModel and it is not categorized as "wsdlSpec", then fail
    else if (!(UDDIUtils.isWsdlSpec(tModel)))
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage =
        "The tModel key is: ["
          + tModel.getTModelKey()
          + "]\n"
          + "The categoryBag is: ["
          + this.validator.categoryBagToString(tModel.getCategoryBag())
          + "]";
    }

    // Return assertion result
    return validator.createAssertionResult(testAssertion, result, failureDetailMessage);
View Full Code Here

  public void validateArtifact() throws WSIException
  {
    Entry entry = null;

    BindingTemplate bindingTemplate = null;
    TModel tModel = null;

    // it depricated after refactoring
    // now the inner classes moved out from validator
    //String classPrefix = this.getClass().getName() + "$";
    String classPrefix = this.getClass().getPackage().getName()+".";

    try
    {
      // Set up a reference to the UDDI registry
      uddiProxy = new UDDIProxy();

      //new Socket(new InetAddress(uddiReference.getInquiryURL()));
      uddiProxy.setInquiryURL(uddiReference.getInquiryURL());
      boolean wasEx = false;
      InputStream stream;
      try
      {
        URL url = StringUtils.getURL(null, uddiReference.getInquiryURL());
        stream = url.openStream();
        stream.close();
      }

      catch (UnknownHostException ex)
      {
        wasEx = true;
      }

      catch (IOException ex)
      {
      }

      if (!wasEx)
      {

        // If the UDDI reference is to a bindingTemplate then get it
        if (uddiReference.getKeyType().equals(UDDIReference.BINDING_KEY))
        {
          // Get binding detail which will contain the bindingTemplate
          BindingDetail bindingDetail =
            uddiProxy.get_bindingDetail(uddiReference.getKey());

          // Get bindingTemplate
          bindingTemplate =
            (BindingTemplate) bindingDetail
              .getBindingTemplateVector()
              .elementAt(
              0);

          if (verboseOption)
          {
            System.err.println(
              "    BindingTemplate - "
                + UDDIUtils.bindingTemplateToString(bindingTemplate));
          }

          // Get the wsdlSpec tModel
          tModel = UDDIUtils.findTModel(uddiProxy, bindingTemplate,
                  verboseOption);
        }

        // Else it has to be a tModel
        else
        {
          TModelDetail tModelDetail =
            uddiProxy.get_tModelDetail(uddiReference.getKey());
          tModel = (TModel) tModelDetail.getTModelVector().elementAt(0);
        }

        if (verboseOption)
        {
          System.err.println(
            "    TModel specified or found in bindingTemplate - "
              + UDDIUtils.tModelToString(tModel));
        }
      }

      if (bindingTemplate == null)
      {
        setMissingInput(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
      }

      // If there is a bindingTemplate, then process test assertions for it
      else
      {
        // Create entry
        entry = this.reporter.getReport().createEntry();
        entry.setEntryType(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
        entry.setReferenceID(bindingTemplate.getBindingKey());
        entry.setEntryDetail(bindingTemplate);

        // Process test assertions
        processAssertions(
          classPrefix,
          new EntryContext(entry, this.analyzerContext));
      }

      // NOTE: From this point forward, if a bindingTemplate does NOT have a wsdlSpec tModel,
      //       the tModel will be NULL.

      // Create entry
      entry = this.reporter.getReport().createEntry();
      entry.setEntryType(
        EntryType.getEntryType(TYPE_DISCOVERY_TMODEL));
      entry.setReferenceID(
        (tModel == null ? "[tModel]" : tModel.getTModelKey()));
      entry.setEntryDetail(tModel);

      // Process test assertions
      processAssertions(
        classPrefix,
View Full Code Here

TOP

Related Classes of org.uddi4j.datatype.tmodel.TModel

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.