Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.ProviderConfig


           
        return result;
    }

    private final boolean isReferencedByParent(final ConfigContextEvent cce) throws ConfigException {
        final ProviderConfig pc = getProviderConfig(cce);
        final MessageSecurityConfig msc = (MessageSecurityConfig) pc.parent().parent();
        return msc.getDefaultProvider() != null && msc.getDefaultProvider().equals(pc.getProviderId());
    }
View Full Code Here


           messageSecurity.setAuthLayer(messageLayer);
           bMessageConfigJustCreated = true;
        }
       
        //provider-config
        ProviderConfig provider = new ProviderConfig();
        provider.setClassName(providerClassName);
        provider.setProviderId(providerId);
        provider.setProviderType(providerType);
       
        //properties
        if (null != props)
        {
            provider.setElementProperty(convertPropertiesToElementProperties(props));
        }

        //request-policy
        if(requestAuthSource!=null || requestAuthRecipient!=null )
        {
            RequestPolicy requestPolicy = new RequestPolicy();
            if(requestAuthSource!=null)
                requestPolicy.setAuthSource(requestAuthSource);
            if(requestAuthRecipient!=null)
                requestPolicy.setAuthRecipient(requestAuthRecipient);
            provider.setRequestPolicy(requestPolicy);
        }

        //response-policy
        if(responseAuthSource!=null || responseAuthRecipient!=null )
        {
            ResponsePolicy responsePolicy = new ResponsePolicy();
            if(responseAuthSource!=null)
                responsePolicy.setAuthSource(responseAuthSource);
            if(responseAuthRecipient!=null)
                responsePolicy.setAuthRecipient(responseAuthRecipient);
            provider.setResponsePolicy(responsePolicy);
        }

        messageSecurity.addProviderConfig(provider);
        //set default provider
        if(isDefaultProvider)
View Full Code Here

        if(providers.length==1 && providerId.equals(providers[0].getProviderId()))
        {
            securityService.removeMessageSecurityConfig(messageSecurity);
            return true;
        }
        ProviderConfig provider = messageSecurity.getProviderConfigByProviderId(providerId);
        if(provider==null)
        {
            String msg = localStrings.getString( "admin.mbeans.configs.security_provider_not_found", new Object[]{providerId, messageLayer, targetName});
            throw new MBeanConfigException(msg);
        }
View Full Code Here

        Iterator<ProviderConfig> pit = provList.iterator();
       
        while (pit.hasNext()) {
     
      ProviderConfig provider = pit.next();
      parseIDEntry(provider, newConfig, intercept);
        }
    }
      }
  }
View Full Code Here

        Iterator<ProviderConfig> pit = provList.iterator();
       
        while (pit.hasNext()) {
     
      ProviderConfig provider = pit.next();
      parseIDEntry(provider, newConfig, intercept);
        }
    }
      }
  }
View Full Code Here

            // No duplicate message security providers found. So add one.
            try {
                ConfigSupport.apply(new SingleConfigCode<MessageSecurityConfig>() {
                    public Object run(MessageSecurityConfig param)
                    throws PropertyVetoException, TransactionFailure {                       
                        ProviderConfig newPC = param.createChild(ProviderConfig.class);
                        populateProviderConfigElement(newPC);                   
                        param.getProviderConfig().add(newPC);
                        // Depending on the providerType of the new provider
                        // the isDefaultProvider=true results in creation of
                        // either default-provider attribute or
                        // default-client-provider or BOTH in the message
                        // security config object
                        if (isDefaultProvider) {
                            if (providerType.equals(SERVER) ||
                                providerType.equals(CLIENT_SERVER) )
                            param.setDefaultProvider(providerId);
                           
                            if (providerType.equals(CLIENT) ||
                                providerType.equals(CLIENT_SERVER) )
                            param.setDefaultClientProvider(providerId);
                        }
                        return newPC;
                    }
                }, msgSecCfg);
            } catch(TransactionFailure e) {
                report.setMessage(localStrings.getLocalString(
                    "create.message.security.provider.fail",
                    "Creation of message security provider named {0} failed",
                    providerId));
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setFailureCause(e);       
                return;
            }       
            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
            report.setMessage(localStrings.getLocalString(
                "create.message.security.provider.success",
                "Creation of message security provider named {0} completed " +
                "successfully", providerId));       
        }
        // Now if there is NO message security config for this type of layer
        // then, first add a message security config for the layer and then
        // add a provider config under this message security config
        else {
            try {
                ConfigSupport.apply(new SingleConfigCode<SecurityService>() {
                    public Object run(SecurityService param)
                    throws PropertyVetoException, TransactionFailure {                       
                        MessageSecurityConfig newMSC = param.createChild(MessageSecurityConfig.class);
                        newMSC.setAuthLayer(authLayer);
                        param.getMessageSecurityConfig().add(newMSC);

                        ProviderConfig newPC = newMSC.createChild(ProviderConfig.class);
                       
                        populateProviderConfigElement(newPC);                   
                        newMSC.getProviderConfig().add(newPC);
                        // Depending on the providerType of the new provider
                        // the isDefaultProvider=true results in creation of
View Full Code Here

            // No duplicate message security providers found. So add one.
            try {
                ConfigSupport.apply(new SingleConfigCode<MessageSecurityConfig>() {
                    public Object run(MessageSecurityConfig param)
                    throws PropertyVetoException, TransactionFailure {                       
                        ProviderConfig newPC = param.createChild(ProviderConfig.class);
                        populateProviderConfigElement(newPC);                   
                        param.getProviderConfig().add(newPC);
                        // Depending on the providerType of the new provider
                        // the isDefaultProvider=true results in creation of
                        // either default-provider attribute or
                        // default-client-provider or BOTH in the message
                        // security config object
                        if (isDefaultProvider) {
                            if (providerType.equals(SERVER) ||
                                providerType.equals(CLIENT_SERVER) )
                            param.setDefaultProvider(providerId);
                           
                            if (providerType.equals(CLIENT) ||
                                providerType.equals(CLIENT_SERVER) )
                            param.setDefaultClientProvider(providerId);
                        }
                        return newPC;
                    }
                }, msgSecCfg);
            } catch(TransactionFailure e) {
                report.setMessage(localStrings.getLocalString(
                    "create.message.security.provider.fail",
                    "Creation of message security provider named {0} failed",
                    providerId));
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setFailureCause(e);       
                return;
            }       
            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
            report.setMessage(localStrings.getLocalString(
                "create.message.security.provider.success",
                "Creation of message security provider named {0} completed " +
                "successfully", providerId));       
        }
        // Now if there is NO message security config for this type of layer
        // then, first add a message security config for the layer and then
        // add a provider config under this message security config
        else {
            try {
                ConfigSupport.apply(new SingleConfigCode<SecurityService>() {
                    public Object run(SecurityService param)
                    throws PropertyVetoException, TransactionFailure {                       
                        MessageSecurityConfig newMSC = param.createChild(MessageSecurityConfig.class);
                        newMSC.setAuthLayer(authLayer);
                        param.getMessageSecurityConfig().add(newMSC);

                        ProviderConfig newPC = newMSC.createChild(ProviderConfig.class);
                       
                        populateProviderConfigElement(newPC);                   
                        newMSC.getProviderConfig().add(newPC);
                        // Depending on the providerType of the new provider
                        // the isDefaultProvider=true results in creation of
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.ProviderConfig

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.