Package com.sun.enterprise.config.serverbeans

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


    /**
    This operation returns list of AuthRealm's ids  connected to current SecurityService.
     */
    public String[] listAuthRealms() throws ConfigException
    {
        SecurityService securityService = (SecurityService)getConfigBeanByXPath( ServerXPathHelper.getSecurityServiceXpath() );
        AuthRealm[]     authRealms  = securityService.getAuthRealm();
        String[]        res        = new String[authRealms.length];
        for(int i=0; i<authRealms.length; i++)
        {
            res[i] = authRealms[i].getName();
        }
View Full Code Here


     *            SynchronizationException
     */
    private void createRealm(AuthRealmEvent event) throws Exception {
        ConfigContext configContext = event.getConfigContext();
        String realmName = event.getAuthRealmName();
        SecurityService security =
            ServerBeansFactory.getSecurityServiceBean(configContext);
        AuthRealm authRealm = security.getAuthRealmByName(realmName);
        //authRealm cannot be null here
        String className = authRealm.getClassname();
        ElementProperty[] elementProps = authRealm.getElementProperty();
        int size = (elementProps != null) ? elementProps.length : 0;
        Properties props = new Properties();
View Full Code Here

        // auth-layer
        String intercept = null;

        try {
            Server configBean = ServerBeansFactory.getServerBean(configCtx);
            SecurityService secService =
                ServerBeansFactory.getSecurityServiceBean(configCtx);

            com.sun.enterprise.config.serverbeans.MessageSecurityConfig[]
                msgConfigs = secService.getMessageSecurityConfig();

            for (int j = 0; msgConfigs != null &&
                    j < msgConfigs.length; j++) {

                // single message-security-config for each auth-layer
View Full Code Here

               
                Server configBean =
                ServerBeansFactory.getServerBean(configContext);
                assert(configBean != null);
               
                SecurityService securityBean =
                ServerBeansFactory.getSecurityServiceBean(configContext);
                assert(securityBean != null);
               
                defaultRoleName = securityBean.getAnonymousRole();
               
            } catch (Exception e) {
                _logger.log(Level.WARNING,
                "java_security.anonymous_role_reading_exception",
                e);
View Full Code Here

        try {
            ServerContext serverContext = ApplicationServer.getServerContext();
            if (serverContext != null) {
                ConfigContext configContext = serverContext.getConfigContext();
                if (configContext != null) {
                    SecurityService securityService =
                        ServerBeansFactory.getSecurityServiceBean(configContext);
                    if (securityService != null &&
                        securityService.isActivateDefaultPrincipalToRoleMapping()==true) {
                        className = securityService.getMappedPrincipalClass();
                        if (className==null || "".equals(className))
          className = "com.sun.enterprise.deployment.Group";
                    }
                }
            }
View Full Code Here

                                                    String          targetName)
    throws Exception
    {
        final Target target = getTarget(targetName);
        final ConfigTarget configTarget = target.getConfigTarget();
        SecurityService securityService = getSecurityServiceConfigBean(configTarget.getName());
        return createIdentityAssertionTrust(attrList, entityList, props, configTarget.getName(), securityService);

    }
View Full Code Here

    public boolean deleteIdentityAssertionTrust( String id, String targetName )
    throws Exception
    {
        final Target target = getTarget(targetName);
//        check1ToN(target);
        SecurityService securityService = getSecurityServiceConfigBean(target.getConfigTarget().getName());
        IdentityAssertionTrust trustConfig = securityService.getIdentityAssertionTrustById(id);

        if (trustConfig == null)
        {
            String msg = _strMgr.getString("IdentityTrustDoesntExist", id);
            throw new MBeanConfigException(msg);
        }

        securityService.removeIdentityAssertionTrust(trustConfig);

        return true;
    }
View Full Code Here

     */
    public Object[] listIdentityAssertionTrusts( String trustId, String targetName )
    throws Exception
    {
        final Target target = getListTarget(targetName);
        SecurityService securityService = getSecurityServiceConfigBean(target.getConfigTarget().getName());

        // if trustId is specified, list all trusted entities for that config
        if (trustId != null)
        {
            IdentityAssertionTrust trustConfig =
                   securityService.getIdentityAssertionTrustById(trustId);
            if (trustConfig == null)
            {
                String msg = _strMgr.getString("IdentityTrustDoesntExist", trustId);
                throw new MBeanConfigException(msg);
            }
            return getTrustedEntities(trustConfig);
        }

        // trustId is not specified, list all trust configs
        IdentityAssertionTrust[] trustConfigs = securityService.getIdentityAssertionTrust();
        return ConfigMBeanHelper.getConfigBeansObjectNames(
            this.getMBeanRegistry(), this.getDomainName(), trustConfigs);
    }
View Full Code Here

        String host = null;
        String principal = null;

        final Target target = getTarget(targetName);
//        check1ToN(target);
        SecurityService securityService = getSecurityServiceConfigBean(target.getConfigTarget().getName());

        for (int i = 0; i <attrList.size(); i++) {
            Attribute attr = (Attribute)attrList.get(i);
            if (isAttrNameMatch(attr, "id"))
                id = (String)attr.getValue();
            else if (isAttrNameMatch(attr, "trusted-as"))
                trustedAs = (String)attr.getValue();
            else if (isAttrNameMatch(attr, "ip-address"))
                ipAdd = (String)attr.getValue();
            else if (isAttrNameMatch(attr, "host-name"))
                host = (String)attr.getValue();
            else if (isAttrNameMatch(attr, "principal"))
                principal = (String)attr.getValue();
        }

        IdentityAssertionTrust trustConfig =
            securityService.getIdentityAssertionTrustById(trustId);
        // invalid trustId was specified
        if (trustConfig == null)
        {
            String msg = _strMgr.getString("IdentityTrustDoesntExist", trustId);
            throw new MBeanConfigException(msg);
View Full Code Here

    public boolean deleteTrustedEntity( String entityId, String trustId, String targetName )
    throws Exception
    {
        final Target target = getTarget(targetName);
//        check1ToN(target);
        SecurityService securityService = getSecurityServiceConfigBean(target.getConfigTarget().getName());
        IdentityAssertionTrust trustConfig =
            securityService.getIdentityAssertionTrustById(trustId);
        // invalid trustId was specified
        if (trustConfig == null)
        {
            String msg = _strMgr.getString("IdentityTrustDoesntExist", trustId);
            throw new MBeanConfigException(msg);
        }
        TrustedEntity[] entities = trustConfig.getTrustedEntity();
        // if its THE only trusted entity element, we might as well
        // remove the trust config itself
        if (entities.length==1 && entityId.equals(trustConfig.getTrustedEntity(0).getId()))
        {
            securityService.removeIdentityAssertionTrust(trustConfig);
            return true;
        }
        // get the trusted entity from the trust config and remove
        TrustedEntity tEntity = trustConfig.getTrustedEntityById(entityId);
        if (tEntity == null)
View Full Code Here

TOP

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

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.