public class LDAPClaimsSource extends BasicClaimsSourceImpl implements Logable
Created by Jeff Gaynor
on 4/26/16 at 3:32 PM
Modifier and Type | Field and Description |
---|---|
LdapContext |
context |
protected boolean |
loggingEnabled |
groupHandler
Constructor and Description |
---|
LDAPClaimsSource() |
LDAPClaimsSource(LDAPConfiguration ldapConfiguration,
MyLoggingFacade myLogger) |
LDAPClaimsSource(OA2SE oa2SE) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeConnection() |
protected static GroupElement |
convertToEntry(Attributes a) |
LdapContext |
createConnection() |
Hashtable<String,String> |
createEnv(String host,
LDAPConfiguration cfg) |
void |
debug(String x)
Write a debug message to the log.
|
void |
error(String x)
Write an error message to the log.
|
void |
error(String x,
Throwable e) |
static Groups |
get_NEW_Gid(LDAPConfiguration cfg2,
String username) |
Collection<String> |
getClaims()
returns a (unique) collection of claims.
|
LDAPConfiguration |
getLDAPCfg()
Convenience to cast the configuration to the right class.
|
protected MyLoggingFacade |
getMyLogger() |
protected String |
getSearchFilterAttribute() |
String |
getSearchName(net.sf.json.JSONObject claims,
javax.servlet.http.HttpServletRequest request,
ServiceTransaction transaction)
Returns the name of the user for whom the search is to be run.
|
void |
handleException(Throwable throwable) |
void |
info(String x)
Write an informational message to the log
|
boolean |
isDebugOn()
Query if debugging is enabled for this logger.
|
boolean |
isEnabled() |
protected boolean |
isLoggedOn() |
protected boolean |
isNCSA() |
boolean |
logon() |
protected Groups |
processNCSAGroups() |
protected net.sf.json.JSONObject |
realProcessing(net.sf.json.JSONObject claims,
javax.servlet.http.HttpServletRequest request,
ServiceTransaction transaction)
This is the actual place to put your code that only processes the claim source.
|
protected void |
sayit(String x) |
void |
setDebugOn(boolean setOn)
Enable/disable debugging for this logger
|
net.sf.json.JSONObject |
simpleSearch(LdapContext ctx,
String userID,
Map<String,LDAPConfigurationUtil.AttributeEntry> attributes) |
protected net.sf.json.JSONObject |
toJSON(Map<String,LDAPConfigurationUtil.AttributeEntry> attributes,
NamingEnumeration e,
String userName)
This takes the result of the search as a
NamingEnumeration and set of attributes (from the
configuration file) and returns a JSON object. |
String |
toString() |
void |
warn(String x)
Write a warning to the log.
|
getConfiguration, getGroupHandler, getOa2SE, getOmitList, getPostProcessor, getPreProcessor, getScopes, hasConfiguration, hasJSONPostProcessoor, hasJSONPreProcessoor, isRunAtAuthorization, process, process, setConfiguration, setGroupHandler, setOa2SE, setOmitList, setScopes
protected boolean loggingEnabled
public LdapContext context
public LDAPClaimsSource()
public LDAPClaimsSource(LDAPConfiguration ldapConfiguration, MyLoggingFacade myLogger)
public LDAPClaimsSource(OA2SE oa2SE)
public String getSearchName(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction)
claims
- request
- transaction
- protected boolean isNCSA()
protected MyLoggingFacade getMyLogger()
public void handleException(Throwable throwable)
protected Groups processNCSAGroups()
public boolean isEnabled()
isEnabled
in interface ClaimSource
isEnabled
in class BasicClaimsSourceImpl
protected net.sf.json.JSONObject realProcessing(net.sf.json.JSONObject claims, javax.servlet.http.HttpServletRequest request, ServiceTransaction transaction) throws UnsupportedScopeException
BasicClaimsSourceImpl
BasicClaimsSourceImpl.process(JSONObject, HttpServletRequest, ServiceTransaction)
calls wrap this and invoke the pre/post processor for you. Your code should take whatever metadata is for the user
and add it to the claims object.realProcessing
in class BasicClaimsSourceImpl
UnsupportedScopeException
protected boolean isLoggedOn()
public LDAPConfiguration getLDAPCfg()
public boolean logon()
public Hashtable<String,String> createEnv(String host, LDAPConfiguration cfg)
public LdapContext createConnection()
public Collection<String> getClaims()
BasicClaimsSourceImpl
getClaims
in interface ClaimSource
getClaims
in class BasicClaimsSourceImpl
protected String getSearchFilterAttribute()
public net.sf.json.JSONObject simpleSearch(LdapContext ctx, String userID, Map<String,LDAPConfigurationUtil.AttributeEntry> attributes) throws NamingException
NamingException
protected net.sf.json.JSONObject toJSON(Map<String,LDAPConfigurationUtil.AttributeEntry> attributes, NamingEnumeration e, String userName) throws NamingException
NamingEnumeration
and set of attributes (from the
configuration file) and returns a JSON object. The default is that singletons are returned as simple
values while lists are recorded as arrays.attributes
- e
- NamingException
protected void closeConnection()
protected void sayit(String x)
public void debug(String x)
Logable
public boolean isDebugOn()
Logable
public void setDebugOn(boolean setOn)
Logable
setDebugOn
in interface Logable
public void info(String x)
Logable
public void warn(String x)
Logable
public void error(String x)
Logable
public static Groups get_NEW_Gid(LDAPConfiguration cfg2, String username) throws Throwable
Throwable
protected static GroupElement convertToEntry(Attributes a) throws NamingException
NamingException
Copyright © 2019. All Rights Reserved.