Created
January 3, 2013 16:08
-
-
Save anonymous/4444548 to your computer and use it in GitHub Desktop.
Sketch of an attribute DAO that computes a new attribute value from the input. One would wrap this up in a parent DAO that merges with an echo of the input, or something, to ensure the resulting user attribute map returned from the whole attributes subsystem retains the username mapped as an attribute as well, as well as any other attributes col…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.unicon.cas.addons.persondir; | |
import java.util.List; | |
import java.util.Map; | |
... | |
/** | |
* Sketch of an attribute DAO that computes a new attribute value from the input. | |
*/ | |
public class AttributeGeneratingDAO extends AbstractDefaultPersonAttributeDao { | |
String inputUserName = "username"; | |
String outputUserName = "mail"; | |
String suffix = "@oakland.edu"; | |
public JsonBackedComplexStubPersonAttributeDao(final String inputUserName, final String outputUserName, final String suffix) { | |
// capture the constructor configuration, or use setter methods instead | |
} | |
public Map<String, List<Object>> getMultivaluedUserAttributes(String uid) { | |
Map attributesMap = new Map<String, List<Object>>(); | |
List<Object> newAttributeValue = new List<Object>(); | |
newAttributeValue.add( uid.append(suffix)); | |
attributesMap.put(outputUserName, newAttributeValue); | |
return attributesMap; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment