Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
allow passing of currently-resolved people
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Nov 24, 2022
1 parent e02da35 commit 3e069a9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ public interface IPersonAttributeScriptDao {
*/
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes,
Set<IPersonAttributes> resultPeople);

default Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes) {
return getPersonAttributesFromMultivaluedAttributes(attributes, Set.of());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apereo.services.persondir.IPersonAttributeScriptDao;
import org.apereo.services.persondir.IPersonAttributes;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -44,6 +45,10 @@ public Map<String, Object> getAttributesForUser(final String username) {
@Override
public Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(final Map<String, List<Object>> attributes,
final Set<IPersonAttributes> resultPeople) {
throw new UnsupportedOperationException();
return new HashMap<>();
}

public Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(final Map<String, List<Object>> attributes) {
return getPersonAttributesFromMultivaluedAttributes(attributes, Set.of());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/

import org.apereo.services.persondir.IPersonAttributes
import org.apereo.services.persondir.support.BaseGroovyScriptDaoImpl

/**
Expand Down Expand Up @@ -46,7 +48,8 @@ class SampleGroovyPersonAttributeDao extends BaseGroovyScriptDaoImpl {
}

@Override
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes) {
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes,
Set<IPersonAttributes> resultPeople) {
Map<String, List<Object>> newMap = new HashMap<>(attributes)
newMap.put("foo", Arrays.asList(["value1", "value2"]))
return newMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import org.apereo.services.persondir.IPersonAttributeScriptDao
import org.apereo.services.persondir.IPersonAttributes

/**
* Licensed to Jasig under one or more contributor license
Expand Down Expand Up @@ -44,7 +45,8 @@ class SampleGroovyPersonAttributeDaoForTestingUpdates implements IPersonAttribut
}

@Override
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes) {
Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(Map<String, List<Object>> attributes,
Set<IPersonAttributes> resultPeople) {
return null
}

Expand Down

0 comments on commit 3e069a9

Please sign in to comment.