Package org.apache.axis2.description

Examples of org.apache.axis2.description.PolicySubject


        }
        return (SynapseConfiguration) synCfgParam.getValue();
    }

    protected SynapseEnvironment getSynapseEnvironment() throws DeploymentException {
        Parameter synCfgParam =
                cfgCtx.getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_ENV);
        if (synCfgParam == null) {
            throw new DeploymentException("SynapseEnvironment not found. " +
                    "Are you sure that you are running Synapse?");
        }
        return (SynapseEnvironment) synCfgParam.getValue();
    }
View Full Code Here


        return (SynapseEnvironment) synCfgParam.getValue();
    }

    protected ServerConfigurationInformation getServerConfigurationInformation()
            throws DeploymentException {
        Parameter serverCfgParam =
                cfgCtx.getAxisConfiguration().getParameter(
                        SynapseConstants.SYNAPSE_SERVER_CONFIG_INFO);
        if (serverCfgParam == null) {
            throw new DeploymentException("SynapseConfigurationInformation not found. " +
                    "Are you sure that you are running Synapse?");
        }
        return (ServerConfigurationInformation) serverCfgParam.getValue();
    }
View Full Code Here

        return (ServerConfigurationInformation) serverCfgParam.getValue();
    }

    protected ServerContextInformation getServerContextInformation()
            throws DeploymentException {
        Parameter serverCtxParam =
                cfgCtx.getAxisConfiguration().getParameter(
                        SynapseConstants.SYNAPSE_SERVER_CTX_INFO);
        if (serverCtxParam == null) {
            throw new DeploymentException("ServerContextInformation not found. " +
                    "Are you sure that you are running Synapse?");
        }
        return (ServerContextInformation) serverCtxParam.getValue();
    }
View Full Code Here

        out.close();
    }

    protected void waitForCompletion() {
        long timeout = 2000L;
        Parameter param = cfgCtx.getAxisConfiguration().getParameter("hotupdate.timeout");
        if (param != null && param.getValue() != null) {
            timeout = Long.parseLong(param.getValue().toString());
        }

        try {
            Thread.sleep(timeout);
        } catch (InterruptedException ignored) {
View Full Code Here

        this.transportIn = transportIn;
        this.ssl = ssl;
    }

    public void build() throws AxisFault {
        Parameter param = transportIn.getParameter(TransportListener.PARAM_PORT);
        if (param != null) {
            port = Integer.parseInt((String) param.getValue());
        }

        int portOffset = 0;

        try {
            portOffset = Integer.parseInt(System.getProperty(NhttpConstants.PORT_OFFSET, "0"));
        } catch (NumberFormatException e) {
            handleException("portOffset System property should be a valid Integer", e);
        }

        port = port + portOffset;

        param = transportIn.getParameter(NhttpConstants.BIND_ADDRESS);
        if (param != null) {
            bindAddress = ((String) param.getValue()).trim();
        }

        param = transportIn.getParameter(TransportListener.HOST_ADDRESS);
        if (param != null) {
            host = ((String) param.getValue()).trim();
        } else {
            try {
                host = InetAddress.getLocalHost().getHostName();
            } catch (UnknownHostException e) {
                log.warn("Unable to lookup local host name, using 'localhost'");
            }
        }

        metrics = new NhttpMetricsCollector(true, ssl);

        // create the priority based executor and parser
        param = transportIn.getParameter(NhttpConstants.PRIORITY_CONFIG_FILE_NAME);
        if (param != null && param.getValue() != null) {
            createPriorityConfiguration(param.getValue().toString());
        }

        param = transportIn.getParameter(NhttpConstants.DISABLE_REST_SERVICE_DISPATCHING);
        if (param != null && param.getValue() != null) {
            if (param.getValue().equals("true")) {
                restDispatching = false;
            }
        }

        // create http Get processor
        param = transportIn.getParameter(NhttpConstants.HTTP_GET_PROCESSOR);
        if (param != null && param.getValue() != null) {
            httpGetRequestProcessor = createHttpGetProcessor(param.getValue().toString());
            if (httpGetRequestProcessor == null) {
                handleException("Cannot create HttpGetRequestProcessor");
            }
        } else {
            httpGetRequestProcessor = new DefaultHttpGetProcessor();
        }

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

            handleException("Error processing POST request ", e);
        }
    }

    private String inferContentType() {
        Parameter param = cfgCtx.getAxisConfiguration().
                getParameter(NhttpConstants.REQUEST_CONTENT_TYPE);
        if (param != null) {
            return param.getValue().toString();
        }
        return null;
    }
View Full Code Here

      SandeshaPolicyBean parentPropertyBean) throws SandeshaException {

        boolean found = false;
        Assertion assertion = null;

        PolicySubject policySubject = desc.getPolicySubject();
        if (policySubject == null) {
            return null;
        }
        Collection<PolicyComponent> policyComponents = policySubject.getAttachedPolicyComponents();
        if (policyComponents == null) {
            return null;
        }
        Iterator<PolicyComponent> policies = policyComponents.iterator();
        while (!found && policies.hasNext()) {
View Full Code Here

            Map endPointMap = service.getEndpoints();
            for (Object o : endPointMap.entrySet()) {
                Map.Entry entry = (Map.Entry) o;
                AxisEndpoint point = (AxisEndpoint) entry.getValue();
                AxisBinding binding = point.getBinding();
                PolicySubject subject = binding.getPolicySubject();
                subject.detachPolicyComponent(policyKey);
            }


        } catch (Exception e) {
            String msg = "Cannot remove service policy";
View Full Code Here

        if (axisService == null) {
            throw new AxisFault("invalid service name");
        }

        PolicySubject servicePolicySubject = axisService.getPolicySubject();
        List<PolicyComponent> policyList =
                new ArrayList<PolicyComponent>(servicePolicySubject.getAttachedPolicyComponents());
        Policy servicePolicy = org.apache.axis2.util.PolicyUtil.getMergedPolicy(policyList,
                                                                                axisService);

        if (servicePolicy == null) {
            return PolicyUtil.getEmptyPolicyAsOMElement().toString();
View Full Code Here

        if (axisModule == null) {
            throw new AxisFault("invalid service name");
        }

        PolicySubject modulePolicySubject = axisModule.getPolicySubject();
        List<PolicyComponent> policyList =
                new ArrayList<PolicyComponent>(modulePolicySubject.getAttachedPolicyComponents());

        // Get the merged module policy
        Policy policy = null;
        for (Iterator iterator = policyList.iterator(); iterator.hasNext();) {
            Object policyElement = iterator.next();
            if (policyElement instanceof Policy) {
                policy = (policy == null) ? (Policy) policyElement
                                          : policy.merge((Policy) policyElement);
            } else {
                PolicyReference policyReference = (PolicyReference) policyElement;

                String key = policyReference.getURI();
                int pos = key.indexOf("#");
                if (pos == 0) {
                    key = key.substring(1);
                } else if (pos > 0) {
                    key = key.substring(0, pos);
                }

                PolicyComponent attachedPolicyComponent = modulePolicySubject
                        .getAttachedPolicyComponent(key);

                if (attachedPolicyComponent != null
                    && attachedPolicyComponent instanceof Policy) {
                    policy = (Policy) attachedPolicyComponent;
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.PolicySubject

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.