Package org.geoserver.security

Source Code of org.geoserver.security.FakeMapper

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

import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.geoserver.security.impl.GeoServerUser;

/**
* Mock mapper used for testing purposes.
*
* @author Mauro Bartolomeoli
*
*/
public class FakeMapper extends AbstractAuthenticationKeyMapper {

    @Override
    public GeoServerUser getUser(String key) throws IOException {
        return new GeoServerUser("fakeuser");
    }
   
    @Override
    public int synchronize() throws IOException {
        return 0;
    }
   
    @Override
    public boolean supportsReadOnlyUserGroupService() {
        return false;
    }
   
    public String getMapperParameter(String parameter) {
        return super.getMapperConfiguration().get(parameter);
    }
   
    @Override
    public Set<String> getAvailableParameters() {
        return new HashSet(Arrays.asList("param1", "param2"));
    }

}
TOP

Related Classes of org.geoserver.security.FakeMapper

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.