Package org.geoserver.security.web.usergroup

Source Code of org.geoserver.security.web.usergroup.UserGroupServiceConfigListModel

/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.security.web.usergroup;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.model.LoadableDetachableModel;
import org.geoserver.security.GeoServerSecurityManager;
import org.geoserver.security.config.SecurityUserGroupServiceConfig;
import org.geoserver.web.GeoServerApplication;

/**
* Model for list of user group service configurations.
*
* @author Justin Deoliveira, OpenGeo
*/
public class UserGroupServiceConfigListModel
    extends LoadableDetachableModel<List<SecurityUserGroupServiceConfig>> {

    @Override
    protected List<SecurityUserGroupServiceConfig> load() {
        GeoServerSecurityManager secMgr = GeoServerApplication.get().getSecurityManager();
        List<SecurityUserGroupServiceConfig> configs = new ArrayList();
        try {
            for (String ugServiceName : secMgr.listUserGroupServices()) {
                SecurityUserGroupServiceConfig config =
                        secMgr.loadUserGroupServiceConfig(ugServiceName);
                configs.add(config);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return configs;
    }
}
TOP

Related Classes of org.geoserver.security.web.usergroup.UserGroupServiceConfigListModel

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.