Search in sources :

Example 1 with CompositeEntityIdentifier

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

the class JpaAggregatedGroupLookupDao method getGroupMapping.

@OpenEntityManager(unitName = BaseAggrEventsJpaDao.PERSISTENCE_UNIT_NAME)
@Override
public AggregatedGroupMapping getGroupMapping(final String portalGroupKey) {
    final IEntityGroup group = compositeGroupService.findGroup(portalGroupKey);
    if (group == null) {
        if (warnedGroupKeys.add(portalGroupKey)) {
            logger.warn("No group found for key {}, no aggregate group mapping will be done and the group key will be ignored.", portalGroupKey);
        }
        final CompositeEntityIdentifier compositeEntityIdentifier = new CompositeEntityIdentifier(portalGroupKey, IEntityGroup.class);
        final String serviceName = compositeEntityIdentifier.getServiceName().toString();
        final String groupKey = compositeEntityIdentifier.getLocalKey();
        return this.getGroupMapping(serviceName, groupKey);
    }
    final String groupService = group.getServiceName().toString();
    final String groupName = group.getName();
    return this.getGroupMapping(groupService, groupName);
}
Also used : IEntityGroup(org.apereo.portal.groups.IEntityGroup) CompositeEntityIdentifier(org.apereo.portal.groups.CompositeEntityIdentifier) OpenEntityManager(org.apereo.portal.jpa.OpenEntityManager)

Aggregations

CompositeEntityIdentifier (org.apereo.portal.groups.CompositeEntityIdentifier)1 IEntityGroup (org.apereo.portal.groups.IEntityGroup)1 OpenEntityManager (org.apereo.portal.jpa.OpenEntityManager)1