public class ScriptEnginePersonAttributeDao extends BasePersonAttributeDao
The script must also return an attribute named username.
A sample script implementation in Groovy follows:
import java.util.*
def Map<String, List<Object>> run(final Object... args) {
def uid = args[0]
def logger = args[1]
return[username:[uid], likes:["cheese", "food"], id:[1234,2,3,4,5], another:"attribute"]
}
For the script engine to do its job, relevant libraries must be available on the classpath. Options include groovy, python and javascript libraries. The script type is determined by script file extension.
loggerWILDCARD, WILDCARD_PATTERN| Constructor and Description |
|---|
ScriptEnginePersonAttributeDao() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAvailableQueryAttributes() |
Set<IPersonAttributes> |
getPeople(Map<String,Object> query) |
Set<IPersonAttributes> |
getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query) |
IPersonAttributes |
getPerson(String uid) |
Set<String> |
getPossibleUserAttributeNames() |
String |
getScriptFile() |
boolean |
isCaseInsensitiveUsername() |
void |
setCaseInsensitiveUsername(boolean caseInsensitiveUsername) |
void |
setScriptFile(String scriptFile) |
compareTo, flattenResults, getMultivaluedUserAttributes, getMultivaluedUserAttributes, getOrder, getUserAttributes, getUserAttributes, setOrderpublic String getScriptFile()
public void setScriptFile(String scriptFile)
public boolean isCaseInsensitiveUsername()
public void setCaseInsensitiveUsername(boolean caseInsensitiveUsername)
public IPersonAttributes getPerson(String uid)
public Set<IPersonAttributes> getPeople(Map<String,Object> query)
public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
Copyright © 2005-2017. All Rights Reserved.