Package org.eclipse.wst.wsdl

Examples of org.eclipse.wst.wsdl.BindingOperation


            boolean foundMatch = false;
            Iterator bindingOperationsIt = bindingOperations.iterator();
            while (bindingOperationsIt.hasNext())
            {
              BindingOperation bindingOperation = (BindingOperation)bindingOperationsIt.next();

              if (namesEqual(bindingOperation.getName(), operation.getName()))
              {
                foundMatch = true;
                break;
              }
            }

            if (!foundMatch)
            {
              newBindingOpsNeeded.add(operation);
            }
          }
          // newBindingOpsNeeded is the List of Operations needing new corresponding
          // BindingOperation's
          List newBindingOps = createNewBindingOperations(newBindingOpsNeeded);

          // don't add required namespace if nothing is really being added
          if (!newBindingOps.isEmpty()) {
            addRequiredNamespaces(binding);           
          }
         
          // Generate the contents of the new BindingOperation's
          Iterator newBindingOpsIt = newBindingOps.iterator();
          while (newBindingOpsIt.hasNext())
          {
            BindingOperation newBindingOp = (BindingOperation)newBindingOpsIt.next();
            generateBindingOperation(newBindingOp);
            generateBindingOperationContent(newBindingOp);
          }
        }

        generateBindingContent(binding);
      }
      else
      {
        // Overwrite
        if (portType == null)
        {
          // We need to blow away everything under the Binding.  No PortType associated with this Binding
          bindingOperations.clear();
          return binding;
        }
        else
        {
          addRequiredNamespaces(binding);
          List operations = portType.getOperations();

          /******************************************************
           * Compare the Operations
           ******************************************************/
          // Remove any BindingOperations which are no longer used
          for (int index = 0; index < bindingOperations.size(); index++)
          {
            BindingOperation bindingOperation = (BindingOperation)bindingOperations.get(index);

            boolean foundMatch = false;
            Iterator operationsIt = operations.iterator();
            while (operationsIt.hasNext())
            {
              Operation operation = (Operation)operationsIt.next();

              if (namesEqual(bindingOperation.getName(), operation.getName()))
              {
                foundMatch = true;
                break;
              }
            }

            if (!foundMatch)
            {
              // We need to remove this BindingFault from the bindingFaults List
              bindingOperations.remove(index);
              index--;
            }
          }

          // Remove any Operations which already exists in bindingOperations.  What we
          // have left are the Operations which needs newly created BindingOperations
          List bindingOperationsNeeded = new ArrayList();
          for (int index = 0; index < operations.size(); index++)
          {
            Operation operation = (Operation)operations.get(index);

            boolean foundMatch = false;
            Iterator bindingOperationsIt = bindingOperations.iterator();
            while (bindingOperationsIt.hasNext())
            {
              BindingOperation bindingOperation = (BindingOperation)bindingOperationsIt.next();

              if (namesEqual(bindingOperation.getName(), operation.getName()))
              {
                foundMatch = true;
                break;
              }
            }
View Full Code Here


    Iterator neededBindingOperationsIt = operations.iterator();
    while (neededBindingOperationsIt.hasNext())
    {
      Operation operation = (Operation)neededBindingOperationsIt.next();
      BindingOperation newBindingOperation = factory.createBindingOperation();
      newBindingOperation.setEOperation(operation);
      newBindingOperation.setName(operation.getName());
      binding.addBindingOperation(newBindingOperation);

      newBindingOps.add(newBindingOperation);
    }
View Full Code Here

    }
  }

  protected void remove(Object component, Object modelObject)
  {
    BindingOperation bindingOperation = (BindingOperation)component;
    if (modelObject instanceof BindingInput)
    {
      bindingOperation.setEBindingInput(null);
    }
    else if (modelObject instanceof BindingOutput)
    {
      bindingOperation.setEBindingOutput(null);
    }
    else if (modelObject instanceof BindingFault)
    {
      bindingOperation.getEBindingFaults().remove(modelObject);
    }
    else
    {
      bindingOperation.getEExtensibilityElements().remove(modelObject);
    }
  }
View Full Code Here

    }
  }

  public Collection getModelObjects(Object component)
  {
    BindingOperation bindingOperation = (BindingOperation)component;

    List list = new ArrayList();

    if (bindingOperation.getEBindingInput() != null)
    {
      list.add(bindingOperation.getEBindingInput());
    }

    if (bindingOperation.getEBindingOutput() != null)
    {
      list.add(bindingOperation.getEBindingOutput());
    }

    list.addAll(bindingOperation.getEBindingFaults());
    list.addAll(bindingOperation.getEExtensibilityElements());

    return list;
  }
View Full Code Here

  // Resolve the reference to Fault
  public void reconcileReferences(boolean deep)
  {
    if (element != null)
    {
      BindingOperation bindingOperation = (BindingOperation)getContainer();
      Operation operation = bindingOperation.getEOperation();
      String faultName = getName();

      if (operation != null && faultName != null)
      {
        javax.wsdl.Fault fault = operation.getFault(faultName);
View Full Code Here

  // Resolve the reference to Output
  public void reconcileReferences(boolean deep)
  {
    if (element != null)
    {
      BindingOperation bop = (BindingOperation)getContainer();
      Operation op = bop.getEOperation();
      if (op != null)
      {
        setOutput(op.getEOutput());
      }
    }
View Full Code Here

  public void handleUnreconciledElement(Element child, Collection remainingModelObjects)
  {
    switch (WSDLUtil.getInstance().getWSDLType(child))
    {
      case WSDLConstants.OPERATION:
      BindingOperation operation = WSDLFactory.eINSTANCE.createBindingOperation();
      operation.setEnclosingDefinition(getEnclosingDefinition());
      operation.setElement(child);
      addBindingOperation(operation);
        break;
      default:
      super.handleUnreconciledElement(child, remainingModelObjects);
        break;
View Full Code Here

    }

    iterator = getEBindingOperations().iterator();
    while (iterator.hasNext())
    {
      BindingOperation operation = (BindingOperation)iterator.next();
      Element child = ((BindingOperationImpl)operation).createElement();
      newElement.appendChild(child);
    }

    return newElement;
View Full Code Here

    {
      Iterator operationsIt = binding.getEBindingOperations().iterator();

      while (operationsIt.hasNext())
      {
        BindingOperation op = (BindingOperation)operationsIt.next();
        list.add(op.getEBindingInput());
        list.add(op.getEBindingOutput());
        list.addAll(op.getEBindingFaults());
      }
    }

    return list;
  }
View Full Code Here

  // Resolve the reference to Input
  public void reconcileReferences(boolean deep)
  {
    if (element != null)
    {
      BindingOperation bop = (BindingOperation)getContainer();
      Operation op = bop.getEOperation();
      if (op != null)
      {
        setInput(op.getEInput());
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsdl.BindingOperation

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.