Search in sources :

Example 1 with TestGroup

use of org.apereo.portal.groups.pags.TestGroup in project uPortal by Jasig.

the class EntityPersonAttributesGroupStore method initGroupDef.

private PagsGroup initGroupDef(IPersonAttributesGroupDefinition group) {
    Element element = this.pagsGroupCache.get(group.getName());
    if (element != null) {
        return (PagsGroup) element.getObjectValue();
    }
    PagsGroup groupDef = new PagsGroup();
    groupDef.setKey(group.getName());
    groupDef.setName(group.getName());
    groupDef.setDescription(group.getDescription());
    addMemberKeys(groupDef, group.getMembers());
    Set<IPersonAttributesGroupTestGroupDefinition> testGroups = group.getTestGroups();
    for (IPersonAttributesGroupTestGroupDefinition testGroup : testGroups) {
        TestGroup tg = new TestGroup();
        Set<IPersonAttributesGroupTestDefinition> tests = testGroup.getTests();
        for (IPersonAttributesGroupTestDefinition test : tests) {
            IPersonTester testerInst = initializeTester(test);
            if (testerInst == null) {
                /*
                     * A tester was intended that we cannot now recreate.  This
                     * is a potentially dangerous situation, since tests in PAGS
                     * are "or-ed" together;  a functioning group with a missing
                     * test would have a wider membership, not narrower.  (And
                     * remember -- permissions are tied to groups.)  We need to
                     * play it safe and keep this group out of the mix.
                     */
                return null;
            }
            tg.addTest(testerInst);
        }
        groupDef.addTestGroup(tg);
    }
    element = new Element(group.getName(), groupDef);
    this.pagsGroupCache.put(element);
    return groupDef;
}
Also used : PagsGroup(org.apereo.portal.groups.pags.PagsGroup) IPersonTester(org.apereo.portal.groups.pags.IPersonTester) Element(net.sf.ehcache.Element) TestGroup(org.apereo.portal.groups.pags.TestGroup)

Aggregations

Element (net.sf.ehcache.Element)1 IPersonTester (org.apereo.portal.groups.pags.IPersonTester)1 PagsGroup (org.apereo.portal.groups.pags.PagsGroup)1 TestGroup (org.apereo.portal.groups.pags.TestGroup)1