Class ClaimSourceConfigurationUtil
- java.lang.Object
-
- org.oa4mp.delegation.server.claims.server.ClaimSourceConfigurationUtil
-
- Direct Known Subclasses:
LDAPConfigurationUtil
public class ClaimSourceConfigurationUtil extends Object
This is a utility that will take a claim source and make a configuration for it.Created by Jeff Gaynor
on 7/23/18 at 3:49 PM
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENABLED_TAG
static String
FAIL_ON_ERROR_TAG
static String
ID_TAG
static String
NAME_TAG
static String
NOTIFY_ON_FAIL_TAG
static String
OMIT_CLAIMS_LIST_TAG
-
Constructor Summary
Constructors Constructor Description ClaimSourceConfigurationUtil()
-
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.ClaimSourceConfiguration
fromJSON(ClaimSourceConfiguration config, net.sf.json.JSONObject json)
Populate and existing configuration.String
getComponentName()
ClaimSourceConfiguration
getConfiguration(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, org.apache.commons.configuration.tree.ConfigurationNode node)
Populate aClaimSourceConfiguration
NOTE the node is assumed to be for the form {"componentName":{}} where the key is the component name is the claim source, e.g.protected JSONUtil
getJSONUtil()
boolean
isInstanceOf(net.sf.json.JSONObject jsonObject)
Returns if the JSON is the type for for this utility.net.sf.json.JSONObject
toJSON(ClaimSourceConfiguration config)
Note that is is assumed that the json object is the correct
-
-
-
Field Detail
-
ID_TAG
public static final String ID_TAG
- See Also:
- Constant Field Values
-
NAME_TAG
public static final String NAME_TAG
- See Also:
- Constant Field Values
-
ENABLED_TAG
public static final String ENABLED_TAG
- See Also:
- Constant Field Values
-
FAIL_ON_ERROR_TAG
public static final String FAIL_ON_ERROR_TAG
- See Also:
- Constant Field Values
-
NOTIFY_ON_FAIL_TAG
public static final String NOTIFY_ON_FAIL_TAG
- See Also:
- Constant Field Values
-
OMIT_CLAIMS_LIST_TAG
public static final String OMIT_CLAIMS_LIST_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getComponentName
public String getComponentName()
-
isInstanceOf
public boolean isInstanceOf(net.sf.json.JSONObject jsonObject)
Returns if the JSON is the type for for this utility. The basic form of a JSON object for this is{"type":{config}}
and all this does is check that the type matches thegetComponentName()
.- Parameters:
jsonObject
-- Returns:
-
createConfiguration
public ClaimSourceConfiguration createConfiguration()
Override as needed to create a new configuration of the right type.- Returns:
-
getConfiguration
public ClaimSourceConfiguration getConfiguration(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, org.apache.commons.configuration.tree.ConfigurationNode node)
Populate aClaimSourceConfiguration
NOTE the node is assumed to be for the form {"componentName":{}} where the key is the component name is the claim source, e.g. ldap that is used. The default is "default". The vlaue is the actual configuration. This lets you stick these all over the place and they stay encapsulated nicely in JSON configuration files.The value will be of the form {"enabled":"true",...} (so all the tags are top-level in it).
- Parameters:
logger
-node
-- Returns:
-
toJSON
public net.sf.json.JSONObject toJSON(ClaimSourceConfiguration config)
Note that is is assumed that the json object is the correct- Parameters:
config
-- Returns:
-
fromJSON
public ClaimSourceConfiguration fromJSON(ClaimSourceConfiguration config, net.sf.json.JSONObject json)
Populate and existing configuration.- Parameters:
config
-json
-- Returns:
-
getJSONUtil
protected JSONUtil getJSONUtil()
-
-