Package org.jasig.portal.events.aggr

Examples of org.jasig.portal.events.aggr.AggregatedGroupConfig


        when(compositeGroupService.findGroup("local.0")).thenReturn(everyoneGroup);
       
      this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupConfig defaultAggregatedGroupConfig = eventAggregationManagementDao.getDefaultAggregatedGroupConfig();
                assertNotNull(defaultAggregatedGroupConfig);
                assertEquals(0, defaultAggregatedGroupConfig.getExcluded().size());
                assertEquals(0, defaultAggregatedGroupConfig.getIncluded().size());
               
                AggregatedGroupConfig loginAggregatedGroupConfig = eventAggregationManagementDao.getAggregatedGroupConfig(LoginPortalEventAggregator.class);
                assertNull(loginAggregatedGroupConfig);
                loginAggregatedGroupConfig = eventAggregationManagementDao.createAggregatedGroupConfig(LoginPortalEventAggregator.class);
                assertNotNull(loginAggregatedGroupConfig);
                assertEquals(0, loginAggregatedGroupConfig.getExcluded().size());
                assertEquals(0, loginAggregatedGroupConfig.getIncluded().size());
               
                final AggregatedGroupMapping group = aggregatedGroupLookupDao.getGroupMapping("local.0");
               
                defaultAggregatedGroupConfig.getIncluded().add(group);
                loginAggregatedGroupConfig.getExcluded().add(group);

                eventAggregationManagementDao.updateAggregatedGroupConfig(defaultAggregatedGroupConfig);
                eventAggregationManagementDao.updateAggregatedGroupConfig(loginAggregatedGroupConfig);
            }
        });
     
      this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupConfig defaultAggregatedGroupConfig = eventAggregationManagementDao.getDefaultAggregatedGroupConfig();
                assertNotNull(defaultAggregatedGroupConfig);
                assertEquals(0, defaultAggregatedGroupConfig.getExcluded().size());
                assertEquals(1, defaultAggregatedGroupConfig.getIncluded().size());
               
                AggregatedGroupConfig loginAggregatedGroupConfig = eventAggregationManagementDao.getAggregatedGroupConfig(LoginPortalEventAggregator.class);
                assertNotNull(loginAggregatedGroupConfig);
                assertEquals(1, loginAggregatedGroupConfig.getExcluded().size());
                assertEquals(0, loginAggregatedGroupConfig.getIncluded().size());
               
                eventAggregationManagementDao.deleteAggregatedGroupConfig(defaultAggregatedGroupConfig);
                eventAggregationManagementDao.deleteAggregatedGroupConfig(loginAggregatedGroupConfig);
            }
        });
     
      this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupConfig defaultAggregatedGroupConfig = eventAggregationManagementDao.getDefaultAggregatedGroupConfig();
                assertNotNull(defaultAggregatedGroupConfig);
                assertEquals(0, defaultAggregatedGroupConfig.getExcluded().size());
                assertEquals(0, defaultAggregatedGroupConfig.getIncluded().size());
               
                AggregatedGroupConfig loginAggregatedGroupConfig = eventAggregationManagementDao.getAggregatedGroupConfig(LoginPortalEventAggregator.class);
                assertNull(loginAggregatedGroupConfig);
            }
        });
  }
View Full Code Here


        this.getEntityManager().persist(eventAggregatorStatus);
    }

    @Override
    public AggregatedGroupConfig getDefaultAggregatedGroupConfig() {
        AggregatedGroupConfig groupConfig = this.getAggregatedGroupConfig(DEFAULT_AGGREGATOR_TYPE);
       
        if (groupConfig == null) {
            groupConfig = this.getTransactionOperations().execute(new TransactionCallback<AggregatedGroupConfig>() {
                @Override
                public AggregatedGroupConfig doInTransaction(TransactionStatus status) {
View Full Code Here

    }

    @Override
    @AggrEventsTransactional
    public AggregatedGroupConfig createAggregatedGroupConfig(Class<? extends IPortalEventAggregator> aggregatorType) {
        final AggregatedGroupConfig aggregatedGroupConfig = new AggregatedGroupConfigImpl(aggregatorType);
        this.getEntityManager().persist(aggregatedGroupConfig);
        return aggregatedGroupConfig;
    }
View Full Code Here

      final Set<AggregatedGroupConfig> oldAggregatedGroupConfigs = new HashSet<AggregatedGroupConfig>(this.aggregationManagementDao.getAggregatedGroupConfigs());
        for (final ExternalAggregatedGroupConfig extAggregatedGroupConfig : data.getAggregatedGroupConfigs()) {
            final String aggregatorTypeName = extAggregatedGroupConfig.getAggregatorType();
           
            final Class<? extends IPortalEventAggregator> aggregatorType = getAggregatorType(aggregatorTypeName);
            AggregatedGroupConfig aggregatedGroupConfig = this.aggregationManagementDao.getAggregatedGroupConfig(aggregatorType);
            if (aggregatedGroupConfig == null) {
                aggregatedGroupConfig = this.aggregationManagementDao.createAggregatedGroupConfig(aggregatorType);
            }
           
            //Remove the config from the old configs set, marking it as updated
            oldAggregatedGroupConfigs.remove(aggregatedGroupConfig);
 
            //Copy over excludes
            final Set<AggregatedGroupMapping> excluded = aggregatedGroupConfig.getExcluded();
            excluded.clear();
            for (final ExternalAggregatedGroupMapping extGroup : extAggregatedGroupConfig.getExcludes()) {
                excluded.add(convert(extGroup));
            }
           
            //Copy over includes
            final Set<AggregatedGroupMapping> included = aggregatedGroupConfig.getIncluded();
            included.clear();
            for (final ExternalAggregatedGroupMapping extGroup : extAggregatedGroupConfig.getIncludes()) {
                included.add(convert(extGroup));
            }
           
View Full Code Here

TOP

Related Classes of org.jasig.portal.events.aggr.AggregatedGroupConfig

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.