import javax.inject.Inject;
import javax.inject.Named;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
private Logger log = LoggerFactory.getLogger( getClass() );
+ private Map<String, List<String>> ldapMappings = new HashMap<String, List<String>>();
+
@Inject
@Named( value = "userConfiguration#default" )
private UserConfiguration userConf;
public void addLdapMapping( String ldapGroup, List<String> roles )
throws MappingException
{
- log.warn( "addLdapMapping not implemented" );
+ ldapMappings.put( ldapGroup, roles );
+ log.warn( "addLdapMapping implemented but only in memory save" );
}
public void removeLdapMapping( String group )
{
- log.warn( "removeLdapMapping not implemented" );
+ ldapMappings.remove( group );
}
public void updateLdapMapping( String ldapGroup, List<String> roles )
throws MappingException
{
- log.warn( "removeLdapMapping not implemented" );
+ ldapMappings.put( ldapGroup, roles );
+ log.warn( "updateLdapMapping implemented but only in memory save" );
}
- public void setLdapGroupMappings( Map<String, Collection<String>> mappings )
+ public void setLdapGroupMappings( Map<String, List<String>> mappings )
throws MappingException
{
- log.warn( "setLdapGroupMappings not implemented" );
+ log.warn( "setLdapGroupMappings implemented but only in memory save" );
+ this.ldapMappings = mappings;
}
public Map<String, Collection<String>> getLdapGroupMappings()
}
}
- return map.asMap();
+ for ( Map.Entry<String, List<String>> entry : this.ldapMappings.entrySet() )
+ {
+ map.putAll( entry.getKey(), entry.getValue() );
+ }
+
+ Map<String, Collection<String>> mappings = map.asMap();
+ return mappings;
}
}