Search in sources :

Example 1 with GroupServiceConfiguration

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

the class GroupService method initializeCompositeService.

/** @exception GroupsException */
private void initializeCompositeService() throws GroupsException {
    String eMsg = null;
    try {
        GroupServiceConfiguration cfg = getServiceConfiguration();
        String factoryName = (String) cfg.getAttributes().get("compositeFactory");
        if (factoryName == null) {
            eMsg = "GroupService.initialize(): No entry for CompositeServiceFactory in configuration";
            LOGGER.error(eMsg);
            throw new GroupsException(eMsg);
        }
        ICompositeGroupServiceFactory serviceFactory = (ICompositeGroupServiceFactory) Class.forName(factoryName).newInstance();
        compositeGroupService = serviceFactory.newGroupService();
    } catch (Exception e) {
        eMsg = "GroupService.initialize(): Problem creating groups service... " + e.getMessage();
        LOGGER.error(eMsg, e);
        throw new GroupsException(eMsg, e);
    }
}
Also used : GroupServiceConfiguration(org.apereo.portal.groups.GroupServiceConfiguration) GroupsException(org.apereo.portal.groups.GroupsException) ICompositeGroupServiceFactory(org.apereo.portal.groups.ICompositeGroupServiceFactory) CachingException(org.apereo.portal.concurrency.CachingException) InvalidNameException(javax.naming.InvalidNameException) GroupsException(org.apereo.portal.groups.GroupsException)

Example 2 with GroupServiceConfiguration

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

the class FileSystemGroupStore method initialize.

protected void initialize(GroupServiceConfiguration cfg) {
    cache = Collections.synchronizedMap(new HashMap());
    goodSeparator = File.separatorChar;
    badSeparator = (goodSeparator == FORWARD_SLASH) ? BACK_SLASH : FORWARD_SLASH;
    defaultEntityType = IPerson.class;
    GroupServiceConfiguration config = cfg;
    if (config == null) {
        try {
            config = GroupServiceConfiguration.getConfiguration();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
    String sep = config.getNodeSeparator();
    if (sep != null) {
        String period = String.valueOf(PERIOD);
        useSubstitutePeriod = sep.equals(period);
    }
}
Also used : HashMap(java.util.HashMap) GroupServiceConfiguration(org.apereo.portal.groups.GroupServiceConfiguration) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) GroupsException(org.apereo.portal.groups.GroupsException)

Aggregations

GroupServiceConfiguration (org.apereo.portal.groups.GroupServiceConfiguration)2 GroupsException (org.apereo.portal.groups.GroupsException)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 InvalidNameException (javax.naming.InvalidNameException)1 CachingException (org.apereo.portal.concurrency.CachingException)1 ICompositeGroupServiceFactory (org.apereo.portal.groups.ICompositeGroupServiceFactory)1