Examples of GerSecurityType


Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        XmlObject[] items = container.selectChildren(SECURITY_QNAME_SET);
        if (items.length > 1) {
            throw new DeploymentException("Unexpected count of security elements in geronimo plan " + items.length + " qnameset: " + SECURITY_QNAME_SET);
        }
        if (items.length == 1) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(items[0], GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
            Security security = buildSecurityConfig(securityType);
            ClassLoader classLoader = applicationContext.getClassLoader();
            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
            earContext.setSecurityConfiguration(securityConfiguration);
           
            Naming naming = earContext.getNaming();
            GBeanData roleMapperData = configureRoleMapper(naming, earContext.getModuleName(), securityConfiguration);
            try {
                earContext.addGBean(roleMapperData);
            } catch (GBeanAlreadyExistsException e) {
                throw new DeploymentException("Role mapper gbean already present", e);
            }
            AbstractNameQuery credentialStoreName;
            if (securityType.isSetCredentialStoreRef()) {
                PatternType credentialStoreType = securityType.getCredentialStoreRef();
                credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, NameFactory.GERONIMO_SERVICE, Collections.singleton(CredentialStore.class.getName()));
            } else {
                credentialStoreName = this.credentialStoreName;
            }
            GBeanData jaccBeanData = configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), securityConfiguration, credentialStoreName);
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType


    public void build(XmlObject container, DeploymentContext applicationContext, DeploymentContext moduleContext) throws DeploymentException {
        XmlObject[] items = container.selectChildren(SECURITY_QNAME);
        for (XmlObject item : items) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(item, GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        public ModuleSecurityConfig(WARConfigData warConfig) {
            roleMappings = new ModuleSecurityJsonTree(warConfig);
            setSecurityRealmName(warConfig.getWebApp().getSecurityRealmName());

            GerSecurityType security = warConfig.getSecurity();

            GerRoleType[] roles = security.getRoleMappings().getRoleArray();
            runAsSubjects = new Hashtable<String, Subject>();
            for (int i = 0; i < roles.length; i++) {
                GerSubjectInfoType runAsSubject = roles[i].getRunAsSubject();
                if (runAsSubject != null && runAsSubject.getId() != null && runAsSubject.getRealm() != null) {
                    runAsSubjects.put(roles[i].getRoleName(), new Subject(runAsSubject.getId(), runAsSubject.getRealm()));
                }
            }

            GerSubjectInfoType gerDefaultSubject = security.getDefaultSubject();
            if (gerDefaultSubject != null && gerDefaultSubject.getId() != null && gerDefaultSubject.getRealm() != null) {
                defaultSubjectId = gerDefaultSubject.getId();
                defaultSubjectRealm = gerDefaultSubject.getRealm();
            }

            if (security.isSetCredentialStoreRef()) {
                PatternType c = security.getCredentialStoreRef();
                credentialStoreRef = new CredentialStoreRef(c.getGroupId(), c.getArtifactId(), c.getVersion(), c.getType(), c.getModule(), c.getName());
            }
            doasCurrentCaller = security.getDoasCurrentCaller();
            useContextHandler = security.getUseContextHandler();
        }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        public void save(WARConfigData warConfig) {
            roleMappings.save(warConfig, runAsSubjects);
            warConfig.getWebApp().setSecurityRealmName(securityRealmName);

            GerSecurityType security = warConfig.getSecurity();

            if (security.isSetDefaultSubject())
                security.unsetDefaultSubject();
            if (defaultSubjectRealm != null && defaultSubjectId != null) {
                GerSubjectInfoType gerDefaultSubject = security
                        .addNewDefaultSubject();
                gerDefaultSubject.setId(defaultSubjectId);
                gerDefaultSubject.setRealm(defaultSubjectRealm);
            }

            if (security.isSetCredentialStoreRef())
                security.unsetCredentialStoreRef();
            if (credentialStoreRef != null)
                credentialStoreRef.save(security.addNewCredentialStoreRef());

            if (security.isSetDoasCurrentCaller())
                security.unsetDoasCurrentCaller();
            if (doasCurrentCaller)
                security.setDoasCurrentCaller(doasCurrentCaller);

            if (security.isSetUseContextHandler())
                security.unsetUseContextHandler();
            if (useContextHandler)
                security.setUseContextHandler(useContextHandler);
        }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType


    public void build(XmlObject container, DeploymentContext applicationContext, DeploymentContext moduleContext) throws DeploymentException {
        XmlObject[] items = container.selectChildren(SECURITY_QNAME);
        for (XmlObject item : items) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(item, GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        public ModuleSecurityConfig(WARConfigData warConfig) {
            roleMappings = new ModuleSecurityJsonTree(warConfig);
            setSecurityRealmName(warConfig.getWebApp().getSecurityRealmName());

            GerSecurityType security = warConfig.getSecurity();

            GerRoleType[] roles = security.getRoleMappings().getRoleArray();
            runAsSubjects = new Hashtable<String, Subject>();
            for (int i = 0; i < roles.length; i++) {
                GerSubjectInfoType runAsSubject = roles[i].getRunAsSubject();
                if (runAsSubject != null && runAsSubject.getId() != null && runAsSubject.getRealm() != null) {
                    runAsSubjects.put(roles[i].getRoleName(), new Subject(runAsSubject.getId(), runAsSubject.getRealm()));
                }
            }

            GerSubjectInfoType gerDefaultSubject = security.getDefaultSubject();
            if (gerDefaultSubject != null && gerDefaultSubject.getId() != null && gerDefaultSubject.getRealm() != null) {
                defaultSubjectId = gerDefaultSubject.getId();
                defaultSubjectRealm = gerDefaultSubject.getRealm();
            }

            if (security.isSetCredentialStoreRef()) {
                PatternType c = security.getCredentialStoreRef();
                credentialStoreRef = new CredentialStoreRef(c.getGroupId(), c.getArtifactId(), c.getVersion(), c.getType(), c.getModule(), c.getName());
            }
            doasCurrentCaller = security.getDoasCurrentCaller();
            useContextHandler = security.getUseContextHandler();
        }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        public void save(WARConfigData warConfig) {
            roleMappings.save(warConfig, runAsSubjects);
            warConfig.getWebApp().setSecurityRealmName(securityRealmName);

            GerSecurityType security = warConfig.getSecurity();

            if (security.isSetDefaultSubject())
                security.unsetDefaultSubject();
            if (defaultSubjectRealm != null && defaultSubjectId != null) {
                GerSubjectInfoType gerDefaultSubject = security
                        .addNewDefaultSubject();
                gerDefaultSubject.setId(defaultSubjectId);
                gerDefaultSubject.setRealm(defaultSubjectRealm);
            }

            if (security.isSetCredentialStoreRef())
                security.unsetCredentialStoreRef();
            if (credentialStoreRef != null)
                credentialStoreRef.save(security.addNewCredentialStoreRef());

            if (security.isSetDoasCurrentCaller())
                security.unsetDoasCurrentCaller();
            if (doasCurrentCaller)
                security.setDoasCurrentCaller(doasCurrentCaller);

            if (security.isSetUseContextHandler())
                security.unsetUseContextHandler();
            if (useContextHandler)
                security.setUseContextHandler(useContextHandler);
        }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType


    public void build(XmlObject container, DeploymentContext applicationContext, DeploymentContext moduleContext) throws DeploymentException {
        XmlObject[] items = container.selectChildren(SECURITY_QNAME);
        for (XmlObject item : items) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(item, GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        XmlObject[] items = container.selectChildren(SECURITY_QNAME_SET);
        if (items.length > 1) {
            throw new DeploymentException("Unexpected count of security elements in geronimo plan " + items.length + " qnameset: " + SECURITY_QNAME_SET);
        }
        if (items.length == 1) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(items[0], GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
            Security security = buildSecurityConfig(securityType);
            ClassLoader classLoader = applicationContext.getClassLoader();
            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
            earContext.setSecurityConfiguration(securityConfiguration);
           
            Naming naming = earContext.getNaming();
            GBeanData roleMapperData = configureRoleMapper(naming, earContext.getModuleName(), securityConfiguration);
            try {
                earContext.addGBean(roleMapperData);
            } catch (GBeanAlreadyExistsException e) {
                throw new DeploymentException("Role mapper gbean already present", e);
            }
            AbstractNameQuery credentialStoreName;
            if (securityType.isSetCredentialStoreRef()) {
                PatternType credentialStoreType = securityType.getCredentialStoreRef();
                credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, NameFactory.GERONIMO_SERVICE, Collections.singleton(CredentialStore.class.getName()));
            } else {
                credentialStoreName = this.credentialStoreName;
            }
            GBeanData jaccBeanData = configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), securityConfiguration, credentialStoreName);
View Full Code Here

Examples of org.apache.geronimo.xbeans.geronimo.security.GerSecurityType

        XmlObject[] items = container.selectChildren(SECURITY_QNAME_SET);
        if (items.length > 1) {
            throw new DeploymentException("Unexpected count of security elements in geronimo plan " + items.length + " qnameset: " + SECURITY_QNAME_SET);
        }
        if (items.length == 1) {
            GerSecurityType securityType;
            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(items[0], GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
            Security security = buildSecurityConfig(securityType);
            ClassLoader classLoader = applicationContext.getClassLoader();
            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
            earContext.setSecurityConfiguration(securityConfiguration);
           
            Naming naming = earContext.getNaming();
            GBeanData roleMapperData = configureRoleMapper(naming, earContext.getModuleName(), securityConfiguration);
            try {
                earContext.addGBean(roleMapperData);
            } catch (GBeanAlreadyExistsException e) {
                throw new DeploymentException("Role mapper gbean already present", e);
            }
            AbstractNameQuery credentialStoreName;
            if (securityType.isSetCredentialStoreRef()) {
                PatternType credentialStoreType = securityType.getCredentialStoreRef();
                credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, NameFactory.GERONIMO_SERVICE, Collections.singleton(CredentialStore.class.getName()));
            } else {
                credentialStoreName = this.credentialStoreName;
            }
            GBeanData jaccBeanData = configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), securityConfiguration, credentialStoreName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.