Package org.apache.ws.policy

Examples of org.apache.ws.policy.Policy


     *
     * @param epName
     * @return
     */
    public Policy getPolicyForEndPoint(QName epName) {
        Policy servicePolicy = null;
        Policy endPointPolicy = null;

        Iterator iterator = wsdlDescription.getServices().values().iterator();

        while (iterator.hasNext()) {
            WSDLService service = (WSDLService) iterator.next();
View Full Code Here


     * @param endPoint
     * @param operation
     * @return
     */
    public Policy getPolicyForOperation(QName endPoint, QName operation) {
        Policy endPointPolicy = getPolicyForEndPoint(endPoint);
        Policy operationPolicy = getOperationPolicy(endPoint, operation);

        //
        if (operationPolicy == null) {
            return endPointPolicy;

View Full Code Here

     * @param endPoint
     * @param operation
     * @return
     */
    public Policy getPolicyForInputMessage(QName endPoint, QName operation) {
        Policy operationPolicy = getPolicyForOperation(endPoint, operation);
        Policy inputMsgPolicy = getInputMeassagePolicy(endPoint, operation);

        if (operationPolicy == null) {
            return inputMsgPolicy;

        } else if (inputMsgPolicy == null) {
View Full Code Here

     * @param endPoint
     * @param operation
     * @return
     */
    public Policy getPolicyForOutputMessage(QName endPoint, QName operation) {
        Policy operationPolicy = getPolicyForOperation(endPoint, operation);
        Policy outputMsgPolicy = getOutputMeassagePolicy(endPoint, operation);

        if (operationPolicy == null) {
            return outputMsgPolicy;

        } else if (outputMsgPolicy == null) {
View Full Code Here

        if (service == null) {
            throw new IllegalArgumentException("no such service:" + qname);
        }

        Policy policy = getPolicyFromComponent(service);
        return (policy == null) ? null : (Policy) policy.normalize();
    }
View Full Code Here

        WSDLBindingMessageReference bindingInput = wsdlBindingOperation
                .getInput();

        //List extensibilityAttributes =
        // bindingInput.getExtensibilityAttributes();
        Policy bindingInputPolicy = getSinglePolicy(getPoliciesAsExtensibleElements(bindingInput));
        if (bindingInputPolicy != null) {
            policies.add(bindingInputPolicy);
        }

        // wsdl:portType/wsdl:operation/wsdl:input
        WSDLOperation wsdlOperation = wsdlBindingOperation.getOperation();
        MessageReference operationInput = wsdlOperation.getInputMessage();
        Policy operationInputPolicy = getSinglePolicy(getPoliciesAsExtensibilityAttribute(operationInput));
        if (operationInputPolicy != null) {
            policies.add(operationInputPolicy);
        }

        // wsdl:Message
View Full Code Here

        // wsdl:binding/wsdl:operation/wsdl:output
        WSDLBindingOperation wsdlBindingOperation = endPoint.getBinding()
                .getBindingOperation(opName);
        WSDLBindingMessageReference bindingOutput = wsdlBindingOperation
                .getOutput();
        Policy bindingOutputPolicy = getSinglePolicy(getPoliciesAsExtensibleElements(bindingOutput));
        if (bindingOutputPolicy != null) {
            policies.add(getPolicyFromComponent(bindingOutput));
        }

        // wsdl:portType/wsdl:operation/wsdl:output
        WSDLOperation wsdlOperation = wsdlBindingOperation.getOperation();
        MessageReference operationOutput = wsdlOperation.getOutputMessage();
        Policy operationOutputPolicy = getSinglePolicy(getPoliciesAsExtensibilityAttribute(operationOutput));
        if (operationOutputPolicy != null) {
            policies.add(operationOutputPolicy);
        }

        // wsdl:Message
View Full Code Here

    public Element getSchemaElement(String uri) {
        return schemaRegistry.lookup(uri);
    }

    private Policy getSinglePolicy(List policies) {
        Policy result = null;

        if (!policies.isEmpty()) {
            Iterator iter = policies.iterator();
            result = (Policy) iter.next();
            while (iter.hasNext()) {
                Policy next = (Policy) iter.next();
                result = (Policy) result.merge(next, reg);
            }
        }
        return result;
    }
View Full Code Here

        if (!policyURIStrings.isEmpty()) {
            iterator = policyURIStrings.iterator();

            do {
                String policyURIString = (String) iterator.next();
                Policy policy = getPolicyFromURI(policyURIString);
                policies.add(policy);
            } while (iterator.hasNext());
        }
        return policies;
    }
View Full Code Here

        }

        iterator = reg.keys();
        while (iterator.hasNext()) {
            String uriString = (String) iterator.next();
            Policy policy = reg.lookup(uriString);
            if (policy == null) {
                try {
                    URI policyURI = new URI(uriString);
                    URL policyURL = policyURI.toURL();
                    PolicyReader reader = PolicyFactory
                            .getPolicyReader(PolicyFactory.OM_POLICY_READER);
                    Policy newPolicy = reader
                            .readPolicy(policyURL.openStream());
                    reg.register(uriString, newPolicy);

                } catch (Exception e) {
                    e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.ws.policy.Policy

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.