Package org.apache.axis2.description

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


            StandardFileSystemManager fsm = new StandardFileSystemManager();
            fsm.setConfiguration(getClass().getClassLoader().getResource("providers.xml"));
            fsm.init();
            this.workerPool = super.workerPool;
            fsManager = fsm;
            Parameter lockFlagParam = getTransportInDescription().getParameter(VFSConstants.TRANSPORT_FILE_LOCKING);
            if (lockFlagParam != null) {
                String strLockingFlag = lockFlagParam.getValue().toString();
                // by-default enabled, if explicitly specified as "disable" make it disable
                if (VFSConstants.TRANSPORT_FILE_LOCKING_DISABLED.equals(strLockingFlag)) {
                    globalFileLockingFlag = false;
                }
            }
View Full Code Here


        if (cTypeProperty != null) {
            return cTypeProperty.toString();
        }

        // Try to get the content type from the axis configuration
        Parameter cTypeParam = cfgCtx.getAxisConfiguration().getParameter(
                NhttpConstants.CONTENT_TYPE);
        if (cTypeParam != null) {
            return cTypeParam.getValue().toString();
        }

        // Unable to determine the content type - Return default value
        return NhttpConstants.DEFAULT_CONTENT_TYPE;
    }
View Full Code Here

            fileName = (String) transportHeaders.get(VFSConstants.REPLY_FILE_NAME);
        }

        // if not, does the service (in its service.xml) specify one?
        if (fileName == null) {
            Parameter param = msgCtx.getAxisService().getParameter(VFSConstants.REPLY_FILE_NAME);
            if (param != null) {
                fileName = (String) param.getValue();
            }
        }

        // next check if the OutTransportInfo specifies one
        if (fileName == null) {
View Full Code Here

                } else {
                    Axis2MessageContext axis2smc = (Axis2MessageContext) messageOut;
                    org.apache.axis2.context.MessageContext axis2MessageCtx =
                            axis2smc.getAxis2MessageContext();
                    axis2MessageCtx.getTransportOut().addParameter(
                            new Parameter(HTTPConstants.OMIT_SOAP_12_ACTION, true));
                }

            }

           //After setting all the options we need to find the MEP of the Message
View Full Code Here

     * @return The value of the parameter
     */
    private static String getAxis2ParameterValue(AxisConfiguration axisConfiguration,
                                                 String paramKey) {

        Parameter parameter = axisConfiguration.getParameter(paramKey);
        if (parameter == null) {
            return null;
        }
        Object value = parameter.getValue();
        if (value != null && value instanceof String) {
            return (String) parameter.getValue();
        } else {
            return null;
        }
    }
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

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

                    } else {

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

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

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

                    } else {

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

                        if (effecPolicy != null) {
                            XMLStreamWriter writer;

                            try {
View Full Code Here

                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

                    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

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.