Package org.switchyard

Examples of org.switchyard.ServiceSecurity


                SecuritiesModel securities = domain.getSecurities();
                if (securities != null) {
                    for (SecurityModel security : securities.getSecurities()) {
                        if (security != null) {
                            PropertiesModel properties = security.getProperties();
                            ServiceSecurity value = new DefaultServiceSecurity()
                                .setName(security.getName())
                                .setCallbackHandler(security.getCallbackHandler(getClass().getClassLoader()))
                                .setProperties(properties != null ? properties.toMap() : null)
                                .setRolesAllowed(security.getRolesAllowed())
                                .setRunAs(security.getRunAs())
                                .setSecurityDomain(security.getSecurityDomain());
                            String key = value.getName();
                            if (!serviceSecurities.containsKey(key)) {
                                serviceSecurities.put(key, value);
                            } else {
                                throw BaseDeployMessages.MESSAGES.duplicateSecurityConfigurationNames(key);
                            }
View Full Code Here


     * @return the SecurityMetadata
     */
    public static final SecurityMetadata getSecurityMetadata(Exchange exchange) {
        Source source = null;
        ServiceDomain serviceDomain = null;
        ServiceSecurity serviceSecurity = null;
        Service service = exchange.getProvider();
        if (service != null) {
            source = Source.PROVIDER;
            serviceDomain = service.getDomain();
            serviceSecurity = service.getServiceMetadata().getSecurity();
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public ServiceSecurity getServiceSecurity(String name) {
        ServiceSecurity serviceSecurity = name != null ? _serviceSecurities.get(name) : null;
        if (serviceSecurity == null) {
            serviceSecurity = _serviceSecurities.get(ServiceSecurity.DEFAULT_NAME);
        }
        return serviceSecurity;
    }
View Full Code Here

     * @param exchange the Exchange
     */
    public DefaultExchangeSecurity(Exchange exchange) {
        _exchange = exchange;
        SecurityMetadata securityMetadata = SecurityMetadata.getSecurityMetadata(exchange);
        ServiceSecurity serviceSecurity = securityMetadata.getServiceSecurity();
        _securityDomain = serviceSecurity != null ? serviceSecurity.getSecurityDomain() : null;
        ServiceDomain serviceDomain = securityMetadata.getServiceDomain();
        _securityContextManager = serviceDomain != null ? new SecurityContextManager(serviceDomain) : null;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void handleMessage(Exchange exchange) throws HandlerException {
        ServiceSecurity serviceSecurity = SecurityMetadata.getServiceSecurity(exchange);
        if (serviceSecurity == null) {
            // nothing to do
            return;
        }
        switch (_securityAction) {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void handleFault(Exchange exchange) {
        ServiceSecurity serviceSecurity = SecurityMetadata.getServiceSecurity(exchange);
        if (serviceSecurity == null) {
            // nothing to do
            return;
        }
        try {
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void handleMessage(final Exchange exchange) throws HandlerException {
        final Service service = exchange.getProvider();
        ServiceSecurity serviceSecurity = service.getServiceMetadata().getSecurity();
        if (serviceSecurity != null) {
            SecurityContext securityContext = _securityContextManager.getContext(exchange);
            PrivilegedExceptionAction<Void> action = new PrivilegedExceptionAction<Void>() {
                public Void run() throws Exception {
                    service.getProviderHandler().handleMessage(exchange);
View Full Code Here

TOP

Related Classes of org.switchyard.ServiceSecurity

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.