Class LDAPConfigurationUtil
- java.lang.Object
-
- org.oa4mp.delegation.server.server.claims.ClaimSourceConfigurationUtil
-
- org.oa4mp.delegation.server.server.config.LDAPConfigurationUtil
-
public class LDAPConfigurationUtil extends ClaimSourceConfigurationUtil
A utility that loads the configuration from a node and has the tags, etc. for it.Created by Jeff Gaynor
on 5/4/16 at 8:50 AM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LDAPConfigurationUtil.AttributeEntry
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
static String
IS_GROUP
static String
LDAP_ADDRESS_TAG
static String
LDAP_AUTH_NONE
static int
LDAP_AUTH_NONE_KEY
static String
LDAP_AUTH_SIMPLE
static int
LDAP_AUTH_SIMPLE_KEY
static String
LDAP_AUTH_STRONG
static int
LDAP_AUTH_STRONG_KEY
static String
LDAP_AUTH_TYPE
static int
LDAP_AUTH_UNSPECIFIED_KEY
static String
LDAP_CONTEXT_NAME_TAG
static String
LDAP_PASSWORD_TAG
static String
LDAP_PORT_TAG
static String
LDAP_SEARCH_ATTRIBUTE_TAG
static String
LDAP_SEARCH_ATTRIBUTES_TAG
static String
LDAP_SEARCH_BASE_TAG
static String
LDAP_SECURITY_PRINCIPAL_TAG
static String
LDAP_TAG
static String
RETURN_AS_LIST
static String
RETURN_NAME
static String
SEARCH_FILTER_ATTRIBUTE_DEFAULT
static String
SEARCH_FILTER_ATTRIBUTE_KEY
static String
SEARCH_NAME_KEY
static String
SEARCH_NAME_USERNAME
static String
SEARCH_SCOPE
static String
SEARCH_SCOPE_OBJECT
static String
SEARCH_SCOPE_ONE_LEVEL
static String
SEARCH_SCOPE_SUBTREE
-
Fields inherited from class org.oa4mp.delegation.server.server.claims.ClaimSourceConfigurationUtil
ENABLED_TAG, FAIL_ON_ERROR_TAG, ID_TAG, NAME_TAG, NOTIFY_ON_FAIL_TAG, OMIT_CLAIMS_LIST_TAG
-
-
Constructor Summary
Constructors Constructor Description LDAPConfigurationUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClaimSourceConfiguration
createConfiguration()
Override as needed to create a new configuration of the right type.Collection<LDAPConfiguration>
fromJSON(net.sf.json.JSON json)
Takes a genericJSON
object and disambiguates it, returning a collection of LDAP configurations.Collection<LDAPConfiguration>
fromJSON(net.sf.json.JSONArray json)
LDAPConfiguration
fromJSON(net.sf.json.JSONObject json)
LDAPConfiguration
fromJSON(ClaimSourceConfiguration claimSourceConfiguration, net.sf.json.JSONObject json)
Populate an existing LDAPConfiguration from the JSON.String
getAuthName(int authType)
int
getAuthType(String x)
String
getComponentName()
LDAPConfiguration
getLdapConfiguration(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, org.apache.commons.configuration.tree.ConfigurationNode node)
Converts an XML configuration into an configuration.boolean
isLDAPCOnfig(net.sf.json.JSONObject json)
Check if a configuration is for ldap.net.sf.json.JSONArray
toJSON(Collection<LDAPConfiguration> configurations)
Converts a collection of configuration to aJSONArray
of objects.net.sf.json.JSONObject
toJSON(LDAPConfiguration configuration)
Convert a single configuration to aJSONObject
.-
Methods inherited from class org.oa4mp.delegation.server.server.claims.ClaimSourceConfigurationUtil
getConfiguration, getJSONUtil, isInstanceOf, toJSON
-
-
-
-
Field Detail
-
LDAP_TAG
public static final String LDAP_TAG
- See Also:
- Constant Field Values
-
LDAP_PASSWORD_TAG
public static final String LDAP_PASSWORD_TAG
- See Also:
- Constant Field Values
-
LDAP_ADDRESS_TAG
public static final String LDAP_ADDRESS_TAG
- See Also:
- Constant Field Values
-
LDAP_SEARCH_BASE_TAG
public static final String LDAP_SEARCH_BASE_TAG
- See Also:
- Constant Field Values
-
SEARCH_NAME_USERNAME
public static final String SEARCH_NAME_USERNAME
- See Also:
- Constant Field Values
-
SEARCH_NAME_KEY
public static final String SEARCH_NAME_KEY
- See Also:
- Constant Field Values
-
SEARCH_FILTER_ATTRIBUTE_KEY
public static final String SEARCH_FILTER_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
-
SEARCH_FILTER_ATTRIBUTE_DEFAULT
public static final String SEARCH_FILTER_ATTRIBUTE_DEFAULT
- See Also:
- Constant Field Values
-
SEARCH_SCOPE
public static final String SEARCH_SCOPE
- See Also:
- Constant Field Values
-
SEARCH_SCOPE_SUBTREE
public static final String SEARCH_SCOPE_SUBTREE
- See Also:
- Constant Field Values
-
SEARCH_SCOPE_OBJECT
public static final String SEARCH_SCOPE_OBJECT
- See Also:
- Constant Field Values
-
SEARCH_SCOPE_ONE_LEVEL
public static final String SEARCH_SCOPE_ONE_LEVEL
- See Also:
- Constant Field Values
-
LDAP_SEARCH_ATTRIBUTES_TAG
public static final String LDAP_SEARCH_ATTRIBUTES_TAG
- See Also:
- Constant Field Values
-
LDAP_SEARCH_ATTRIBUTE_TAG
public static final String LDAP_SEARCH_ATTRIBUTE_TAG
- See Also:
- Constant Field Values
-
LDAP_SECURITY_PRINCIPAL_TAG
public static final String LDAP_SECURITY_PRINCIPAL_TAG
- See Also:
- Constant Field Values
-
LDAP_PORT_TAG
public static final String LDAP_PORT_TAG
- See Also:
- Constant Field Values
-
LDAP_CONTEXT_NAME_TAG
public static final String LDAP_CONTEXT_NAME_TAG
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
LDAP_AUTH_TYPE
public static final String LDAP_AUTH_TYPE
- See Also:
- Constant Field Values
-
LDAP_AUTH_NONE
public static final String LDAP_AUTH_NONE
- See Also:
- Constant Field Values
-
LDAP_AUTH_UNSPECIFIED_KEY
public static final int LDAP_AUTH_UNSPECIFIED_KEY
- See Also:
- Constant Field Values
-
LDAP_AUTH_NONE_KEY
public static final int LDAP_AUTH_NONE_KEY
- See Also:
- Constant Field Values
-
LDAP_AUTH_SIMPLE
public static final String LDAP_AUTH_SIMPLE
- See Also:
- Constant Field Values
-
LDAP_AUTH_SIMPLE_KEY
public static final int LDAP_AUTH_SIMPLE_KEY
- See Also:
- Constant Field Values
-
LDAP_AUTH_STRONG
public static final String LDAP_AUTH_STRONG
- See Also:
- Constant Field Values
-
LDAP_AUTH_STRONG_KEY
public static final int LDAP_AUTH_STRONG_KEY
- See Also:
- Constant Field Values
-
RETURN_NAME
public static final String RETURN_NAME
- See Also:
- Constant Field Values
-
RETURN_AS_LIST
public static final String RETURN_AS_LIST
- See Also:
- Constant Field Values
-
IS_GROUP
public static final String IS_GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createConfiguration
public ClaimSourceConfiguration createConfiguration()
Description copied from class:ClaimSourceConfigurationUtil
Override as needed to create a new configuration of the right type.- Overrides:
createConfiguration
in classClaimSourceConfigurationUtil
- Returns:
-
getComponentName
public String getComponentName()
- Overrides:
getComponentName
in classClaimSourceConfigurationUtil
-
getLdapConfiguration
public LDAPConfiguration getLdapConfiguration(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, org.apache.commons.configuration.tree.ConfigurationNode node)
Converts an XML configuration into an configuration. This is used at bootstrap time if there is a default configuration for the server.- Parameters:
logger
-node
-- Returns:
-
getAuthName
public String getAuthName(int authType)
-
getAuthType
public int getAuthType(String x)
-
toJSON
public net.sf.json.JSONArray toJSON(Collection<LDAPConfiguration> configurations)
Converts a collection of configuration to aJSONArray
of objects.- Parameters:
configurations
-- Returns:
-
toJSON
public net.sf.json.JSONObject toJSON(LDAPConfiguration configuration)
Convert a single configuration to aJSONObject
.- Parameters:
configuration
-- Returns:
-
fromJSON
public Collection<LDAPConfiguration> fromJSON(net.sf.json.JSON json)
Takes a genericJSON
object and disambiguates it, returning a collection of LDAP configurations.- Parameters:
json
-- Returns:
-
fromJSON
public Collection<LDAPConfiguration> fromJSON(net.sf.json.JSONArray json)
-
isLDAPCOnfig
public boolean isLDAPCOnfig(net.sf.json.JSONObject json)
Check if a configuration is for ldap.- Parameters:
json
-- Returns:
-
fromJSON
public LDAPConfiguration fromJSON(ClaimSourceConfiguration claimSourceConfiguration, net.sf.json.JSONObject json)
Populate an existing LDAPConfiguration from the JSON.- Overrides:
fromJSON
in classClaimSourceConfigurationUtil
- Parameters:
claimSourceConfiguration
-json
-- Returns:
-
fromJSON
public LDAPConfiguration fromJSON(net.sf.json.JSONObject json)
-
-