/**
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at the following location:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apereo.services.persondir;
import java.util.List;
import java.util.Map;
/**
* Simplified DAO interface for use by Groovy scripts that provide user attributes.
*
* @author James Wennmacher, jwennmacher@unicon.net
*/
public interface IPersonAttributeScriptDao {
/**
* Given a username, provide additional attributes.
* @param username username to query for
* @return Map of attributes for the specified username, null if no person could be found for the username.
*/
Map<String, Object> getAttributesForUser(String username);
/**
* Given a set of attributes, return additional attributes to add to the user's attributes.
* @param attributes Map of attributes to query on
* @return A {@link Map} of attributes that match the query {@link Map}. If no matches are found an empty {@link Map} is returned. If the query could not be run null is returned.
*/
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes);
}