Examples of PolicyInclude


Examples of org.apache.axis2.description.PolicyInclude

    return baos.toString();
  }

  public static String generateId(AxisDescription description) {
    PolicyInclude policyInclude = description.getPolicyInclude();
    String identifier = "-policy-1";

    if (description instanceof AxisMessage) {
      identifier = "msg-" + ((AxisMessage) description).getName()
          + identifier;
      description = description.getParent();
    }

    if (description instanceof AxisOperation) {
      identifier = "op-" + ((AxisOperation) description).getName()
          + identifier;
      description = description.getParent();
    }

    if (description instanceof AxisService) {
      identifier = "service-" + ((AxisService) description).getName()
          + identifier;
    }

    /*
     * Int 49 is the value of the Character '1'. Here we want to change '1'
     * to '2' or '2' to '3' .. etc. to construct a unique identifier.
     */
    for (int index = 49; policyInclude.getPolicy(identifier) != null; index++) {
      identifier = identifier.replace((char) index, (char) (index + 1));
    }

    return identifier;
  }
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                            out.write(outStr.getBytes());
                        }

                    } else {

                        PolicyInclude policyInclude = ((AxisService) serviceObj).getPolicyInclude();
                        Policy effecPolicy = policyInclude.getEffectivePolicy();

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                            out.write(outStr.getBytes());
                        }

                    } else {

                        PolicyInclude policyInclude = axisService.getPolicyInclude();
                        Policy effecPolicy = policyInclude.getEffectivePolicy();

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                outputStream.write(("<h4>Service " +
                                    serviceName +
                                    " is inactive. Cannot display policies.</h4>").getBytes());
                outputStream.flush();
            } else {
                PolicyInclude policyInclude = axisService.getPolicyInclude();
                if (policyInclude == null) {
                    response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                    outputStream.write("<h4>Policy element is not found!</h4>".getBytes());
                    outputStream.flush();
                    return;

                }
                ArrayList policyElements = policyInclude.getPolicyElements();

                if (policyElements == null) {
                    response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                    outputStream.write("<h4>Policy elements not found!</h4>".getBytes());
                    outputStream.flush();
                    return;
                }

                PolicyRegistry reg = policyInclude.getPolicyRegistry();

                ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                if (configCtx.getAxisConfiguration()
                        .getLocalPolicyAssertions() != null) {
                    serializer.setAssertionsToFilter(
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                    axisMessageEle.addAttribute(axisMessageLableAttr);

                    List axisMessageParameterList = axisMessage.getParameters();
                    serializeParameterList(axisMessageParameterList, axisMessageEle, fac, ns);

                    PolicyInclude policyInclude = operation.getPolicyInclude();
                    PolicyRegistry registry = policyInclude.getPolicyRegistry();
                    List policyList = policyInclude
                            .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
                    if (!policyList.isEmpty()) {
                        serializePolicyIncludes(axisMessageEle, policyList, registry);
                    }

                }

                PolicyInclude policyInclude = operation.getPolicyInclude();
                PolicyRegistry registry = policyInclude.getPolicyRegistry();
                List policyList = policyInclude
                        .getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
                if (!policyList.isEmpty()) {
                    serializePolicyIncludes(operationEle, policyList, registry);
                }
            }

        }

        List serviceParameterList = axisService.getParameters();
        serializeParameterList(serviceParameterList, serviceEle, fac, ns);

        //service level engaged modules.
        Collection serviceEngagedModuleCollection = axisService.getEngagedModules();
        AxisDescription parent = axisService.getParent();
        AxisServiceGroup asg = (AxisServiceGroup) parent;
        Collection asgEngagedModulesCollection = asg.getEngagedModules();
        List asOnlyModuleList = new ArrayList();
        for (Iterator iterator = serviceEngagedModuleCollection.iterator(); iterator.hasNext();) {
            AxisModule axisModule = (AxisModule) iterator.next();
            if (asgEngagedModulesCollection.contains(axisModule.getName())) {
                continue;
            }
            asOnlyModuleList.add(axisModule);
        }

        serializeModules(asOnlyModuleList, serviceEle, fac, ns, axisService);

        if (axisService.isCustomWsdl()) {
            OMElement package2QName = createOMElement(fac, ns,
                                                      DeploymentConstants.TAG_PACKAGE2QNAME);
            serviceEle.addChild(package2QName);
            TypeTable typeTable = axisService.getTypeTable();
            if (typeTable != null) {
                Map complexSchemaMap = typeTable.getComplexSchemaMap();
                Set complexSchemaSet = complexSchemaMap.entrySet();
                for (Iterator iterator = complexSchemaSet.iterator(); iterator.hasNext();) {
                    Map.Entry me = (Map.Entry) iterator.next();
                    String packageKey = (String) me.getKey();
                    QName qName = (QName) me.getValue();
                    OMElement mapping = createOMElement(fac, ns, DeploymentConstants.TAG_MAPPING);
                    OMAttribute packageAttr = createOMAttribute(fac, ns,
                                                                DeploymentConstants.TAG_PACKAGE_NAME, packageKey);
                    OMAttribute qNameAttr = createOMAttribute(fac, ns,
                                                              DeploymentConstants.TAG_QNAME, qName.getNamespaceURI());
                    mapping.addAttribute(packageAttr);
                    mapping.addAttribute(qNameAttr);
                    package2QName.addChild(mapping);
                }
            }
        }

        PolicyInclude policyInclude = axisService.getPolicyInclude();
        PolicyRegistry registry = policyInclude.getPolicyRegistry();

        // services.xml
        List policyList = policyInclude.getPolicyElements(PolicyInclude.AXIS_SERVICE_POLICY);
        if (!policyList.isEmpty()) {
            serializePolicyIncludes(serviceEle, policyList, registry);
        }

        //TODO - Datalocators
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                //add header ops for input
                addHeaderOperations(soapHeaderInputParameterList, axisBindingOperation, true);
                //add header ops for output
                addHeaderOperations(soapHeaderOutputParameterList, axisBindingOperation, false);

                PolicyInclude policyInclude = axisOperation.getPolicyInclude();
                Policy policy = policyInclude.getPolicy();
                if (policy != null) {
                    try {
                        addAttribute(doc, "policy", PolicyUtil.policyComponentToString(policy),
                                     methodElement);
                    } catch (Exception ex) {
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                            out.write(outStr.getBytes());
                        }

                    } else {

                        PolicyInclude policyInclude = ((AxisService) serviceObj).getPolicyInclude();
                        Policy effecPolicy = policyInclude.getEffectivePolicy();

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

                            out.write(outStr.getBytes());
                        }

                    } else {

                        PolicyInclude policyInclude = ((AxisService) serviceObj).getPolicyInclude();
                        Policy effecPolicy = policyInclude.getEffectivePolicy();

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

    return baos.toString();
  }

  public static String generateId(AxisDescription description) {
    PolicyInclude policyInclude = description.getPolicyInclude();
    String identifier = "-policy-1";

    if (description instanceof AxisMessage) {
      identifier = "msg-" + ((AxisMessage) description).getName()
          + identifier;
      description = description.getParent();
    }

    if (description instanceof AxisOperation) {
      identifier = "op-" + ((AxisOperation) description).getName()
          + identifier;
      description = description.getParent();
    }

    if (description instanceof AxisService) {
      identifier = "service-" + ((AxisService) description).getName()
          + identifier;
    }

    /*
     * Int 49 is the value of the Character '1'. Here we want to change '1'
     * to '2' or '2' to '3' .. etc. to construct a unique identifier.
     */
    for (int index = 49; policyInclude.getPolicy(identifier) != null; index++) {
      identifier = identifier.replace((char) index, (char) (index + 1));
    }

    return identifier;
  }
View Full Code Here

Examples of org.apache.axis2.description.PolicyInclude

    if (axisServiceGroup != null) {
      axisConfiguration = (AxisConfiguration) axisServiceGroup
          .getParent();
    }

    PolicyInclude servicePolicyInclude = axisService.getPolicyInclude();

    List policyList;

    // Policies defined in Axis2.xml
    if (axisConfiguration != null) {
      policyList = axisConfiguration.getPolicyInclude()
          .getPolicyElements(PolicyInclude.AXIS_POLICY);
      addPolicyAsExtElements(description, policyList, wsdlService,
          servicePolicyInclude);
    }

    // Policies defined in wsdl:Service
    policyList = servicePolicyInclude
        .getPolicyElements(PolicyInclude.SERVICE_POLICY);
    addPolicyAsExtElements(description, policyList, wsdlService,
        servicePolicyInclude);

    Iterator wsdlEndpoints = wsdlService.getEndpoints().values().iterator();
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.