Package org.apache.axis2.description

Examples of org.apache.axis2.description.PolicyInclude$PolicyElement


        }
    }

    private static void populatePolicy(WSDLDescription description,
                                       WSDLBinding wsdlBinding, AxisService axisService) {
        PolicyInclude policyInclude = axisService.getPolicyInclude();

        List policyList = policyInclude
                .getPolicyElements(PolicyInclude.AXIS_SERVICE_POLICY);
        addPolicyAsExtElements(description, policyList, wsdlBinding,
                policyInclude);

        policyList = policyInclude
                .getPolicyElements(PolicyInclude.BINDING_POLICY);
        addPolicyAsExtElements(description, policyList, wsdlBinding,
                policyInclude);

        Iterator wsdlOperations = wsdlBinding.getBindingOperations().values()
View Full Code Here


    private static void populatePolicy(WSDLDescription description,
                                       WSDLBindingOperation wsdlBindingOperation,
                                       AxisOperation axisOperation) {

        PolicyInclude policyInclude = axisOperation.getPolicyInclude();
        List policyList = policyInclude
                .getPolicyElements(PolicyInclude.BINDING_OPERATION_POLICY);
        addPolicyAsExtElements(description, policyList, wsdlBindingOperation,
                policyInclude);

        //
        policyList = policyInclude
                .getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
        addPolicyAsExtElements(description, policyList, wsdlBindingOperation,
                policyInclude);

        if (WSDLConstants.MEP_URI_IN_ONLY.equals(axisOperation
                .getMessageExchangePattern())) {
            AxisMessage input = axisOperation
                    .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            PolicyInclude policyInclude2 = input.getPolicyInclude();

            // wsdl:Binding -> wsdl:Operation -> wsdl:Input
            List policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.INPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);

            //
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);

        } else if (WSDLConstants.MEP_URI_IN_OUT.equals(axisOperation
                .getMessageExchangePattern())) {
            PolicyInclude policyInclude2;
            List policyList2;

            AxisMessage input = axisOperation
                    .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            policyInclude2 = input.getPolicyInclude();

            // wsdl:Binding -> wsdl:Operation -> wsdl:Input
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.INPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);
            //
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);

            AxisMessage output = axisOperation
                    .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            policyInclude2 = output.getPolicyInclude();

            // wsdl:Binding -> wsdl:Operation -> wsdl:Output
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.OUTPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getOutput(), policyInclude2);
            //
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);
        }
    }
View Full Code Here

                    loadModuleClass(module, moduleClass);
                }
            }

            // setting the PolicyInclude
            PolicyInclude policyInclude;

            if (axisConfig != null) {
                PolicyInclude parent = axisConfig.getPolicyInclude();
                policyInclude = new PolicyInclude(parent);

            } else {
                policyInclude = new PolicyInclude();
            }
            module.setPolicyInclude(policyInclude);

            // processing <wsp:Policy> .. </..> elements
            Iterator policyElements = moduleElement.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY));
View Full Code Here

            if (hostElement != null) {
                processHostCongiguration(hostElement, axisConfig);
            }

            // setting the PolicyInclude
            PolicyInclude policyInclude = new PolicyInclude();
            axisConfig.setPolicyInclude(policyInclude);

            // processing <wsp:Policy> .. </..> elements
            Iterator policyElements = config_element.getChildrenWithName(new QName(POLICY_NS_URI,
                    TAG_POLICY));
View Full Code Here

        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

            configureOperationPolices(axisOp);
        }
    }

    public void configureOperationPolices(AxisOperation op) throws AxisFault {
        PolicyInclude policyInclude = op.getPolicyInclude();
        Policy policy = policyInclude.getEffectivePolicy();
        if (policy != null) {

            policy = (Policy) policy.normalize(policyInclude
                    .getPolicyRegistry(), false);

            for (Iterator iterator = policy.getAlternatives(); iterator
                    .hasNext();) {
View Full Code Here

                //add header ops for input
                addHeaderOperations(soapHeaderInputParameterList, axisOperation, true);
                //add header ops for output
                addHeaderOperations(soapHeaderOutputParameterList, axisOperation, 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

    public Policy lookup(String key) {
        if (subject == null) {
            return null;
        }
       
        PolicyInclude policyInclude = subject.getPolicyInclude();
        PolicyRegistry policyRegistry = policyInclude.getPolicyRegistry();
        Policy policy = policyRegistry.lookup(key);
       
        if (policy != null) {
            return policy;
        }
View Full Code Here

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

                    } else {

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

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

        Document document = getEmptyDocument();
        Element rootElement = document.createElement("module-codegen-policy-extensions");

        AxisOperation axisOperation;
        QName opName;
        PolicyInclude policyInclude;
        Policy policy;

        List axisServices = configuration.getAxisServices();
        AxisService axisService;
        for (Iterator servicesIter = axisServices.iterator(); servicesIter.hasNext();) {
            axisService = (AxisService)servicesIter.next();
            for (Iterator iterator = axisService.getOperations(); iterator.hasNext();) {
                axisOperation = (AxisOperation)iterator.next();
                opName = axisOperation.getName();

                policyInclude = axisOperation.getPolicyInclude();
                policy = policyInclude.getEffectivePolicy();

                if (policy != null) {
                    processPolicies(document, rootElement, policy, opName, namespace2ExtMap);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.PolicyInclude$PolicyElement

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.