public class EntryAttributeToUserTypeMapper extends Object implements UserTypeMapper
| Constructor and Description |
|---|
EntryAttributeToUserTypeMapper() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAttributeValueToSakaiUserTypeMap()
Retrieve the current attribute value-to-Sakai user type map.
|
String |
getDefaultSakaiUserType()
Retrieve the default Sakai user type, which will be returned from
mapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper)
if no mapping was found and
isReturnLiteralAttributeValueIfNoMapping() is false |
String |
getLogicalAttributeName()
Access the key to a physical attribute name which will be used
to resolve Sakai user types.
|
protected com.novell.ldap.LDAPAttribute |
getUserTypeAttribute(com.novell.ldap.LDAPEntry ldapEntry,
LdapAttributeMapper mapper)
Extracts the
LDAPAttribute which represents the
LDAPEntry's group membership. |
boolean |
isReturnLiteralAttributeValueIfNoMapping()
Check the behavior when attribute values cannot be mapped
to a Sakai user type.
|
String |
mapLdapEntryToSakaiUserType(com.novell.ldap.LDAPEntry ldapEntry,
LdapAttributeMapper mapper)
Maps the attribute values associated with the specified
LDAPEntry to a Sakai user type. |
protected String |
mapUserTypeAttributeValue(String attrValue)
Effectively the same as
getAttributeValueToSakaiUserTypeMap().get(attrValue). |
protected String |
mapUserTypeAttributeValues(String[] attrValues)
Maps the given list of attribute values to a single Sakai
user type by passing each received String value, in order, to
mapUserTypeAttributeValue(String). |
void |
setAttributeValueToSakaiUserTypeMap(Map<String,String> attributeValueToSakaiUserTypeMap)
Assign the attribute value-to-Sakai user type map.
|
void |
setDefaultSakaiUserType(String defaultSakaiUserType)
Assign the default Sakai user type.
|
void |
setLogicalAttributeName(String logicalAttributeName)
Assign the key to a physical attribute name which will be used
to resolve Sakai user types.
|
void |
setReturnLiteralAttributeValueIfNoMapping(boolean returnLiteralAttributeValueIfNoMapping)
Assign the behavior for calculating Sakai user types when
attribute values fail to map.
|
public String mapLdapEntryToSakaiUserType(com.novell.ldap.LDAPEntry ldapEntry, LdapAttributeMapper mapper)
LDAPEntry to a Sakai user type.
setLogicalAttributeName(String) defines the
attribute name to consult.
setAttributeValueToSakaiUserTypeMap(Map) controls
the attribute value mappings.
setReturnLiteralAttributeValueIfNoMapping(boolean)
controls behavior when attribute value mapping fails.
setDefaultSakaiUserType(String) assigns the String
to return if attribute value mapping fails and literal value
returns have been disabled.mapLdapEntryToSakaiUserType in interface UserTypeMapperldapEntry - the LDAPEntry to mapmapper - a container for attribute mapping configgetUserTypeAttribute(LDAPEntry, LdapAttributeMapper)protected com.novell.ldap.LDAPAttribute getUserTypeAttribute(com.novell.ldap.LDAPEntry ldapEntry,
LdapAttributeMapper mapper)
LDAPAttribute which represents the
LDAPEntry's group membership. This is accomplished
by querying the given LdapAttributeMapper for an
attribute name corresponding to getLogicalAttributeName().ldapEntry - the LDAPEntry from which to extract a
LDAPAttributemapper - a container for attribute mapping configLDAPAttribute or null
if none could be found on the given LDAPEntryprotected String mapUserTypeAttributeValues(String[] attrValues)
mapUserTypeAttributeValue(String). Exits with the first
non-null return from that method or a value
dependent on current value of
isReturnLiteralAttributeValueIfNoMapping()attrValues - String values to testprotected String mapUserTypeAttributeValue(String attrValue)
getAttributeValueToSakaiUserTypeMap().get(attrValue).
Returns null if no mapping has been assigned.attrValue - the attribute value to mapnull if no map or mappingpublic Map<String,String> getAttributeValueToSakaiUserTypeMap()
public void setAttributeValueToSakaiUserTypeMap(Map<String,String> attributeValueToSakaiUserTypeMap)
attributeValueToSakaiUserTypeMap - a map of attribute
values to Sakai user typespublic String getDefaultSakaiUserType()
mapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper)
if no mapping was found and
isReturnLiteralAttributeValueIfNoMapping() is falsemapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper)public void setDefaultSakaiUserType(String defaultSakaiUserType)
defaultSakaiUserType - the default Sakai user type to return from
mapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper)getDefaultSakaiUserType()public String getLogicalAttributeName()
LdapAttributeMapper passed
to mapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper).public void setLogicalAttributeName(String logicalAttributeName)
logicalAttributeName - getLogicalAttributeName()public boolean isReturnLiteralAttributeValueIfNoMapping()
true,
mapLdapEntryToSakaiUserType(LDAPEntry, LdapAttributeMapper)
will return the first attribute value encountered, otherwise will
return the current value of getDefaultSakaiUserType().
Defaults to false.true if failed mappings should return
literal attribute values.public void setReturnLiteralAttributeValueIfNoMapping(boolean returnLiteralAttributeValueIfNoMapping)
returnLiteralAttributeValueIfNoMapping - isReturnLiteralAttributeValueIfNoMapping()Copyright © 2003–2022 Sakai Project. All rights reserved.