Class AuthorizationTemplates
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,AuthorizationTemplate>
-
- org.oa4mp.server.loader.oauth2.tokens.AuthorizationTemplates
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,AuthorizationTemplate>
public class AuthorizationTemplates extends HashMap<String,AuthorizationTemplate>
This keys off the audience. TheAuthorizationTemplatecontains multiple paths. At this point we have a single one of these per audience, i.e. the audience is the unique key.Created by Jeff Gaynor
on 8/2/18 at 2:42 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTENSIBLE_KEYstatic StringOPERATION_KEYstatic StringPATH_KEY
-
Constructor Summary
Constructors Constructor Description AuthorizationTemplates()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)voidfromJSON(String rawJSON)Create this from aJSONobject.voidfromJSON(net.sf.json.JSON json)the actual argument is assumed to be a JSON array of templates.voidfromJSON(net.sf.json.JSONArray array)This actually does the work.Collection<String>getCapabilities(String audience)Get All the capabilities for the given audience.Collection<String>getCapabilities(String audience, Collection<String> requested)Get the capabilities requested for the audience.static voidmain(String[] args)AuthorizationTemplateput(AuthorizationTemplate value)net.sf.json.JSONArraytoJSON()Turn the contents of this object into a JSON object-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
hashCode, toString
-
-
-
-
Field Detail
-
OPERATION_KEY
public static final String OPERATION_KEY
- See Also:
- Constant Field Values
-
PATH_KEY
public static final String PATH_KEY
- See Also:
- Constant Field Values
-
EXTENSIBLE_KEY
public static final String EXTENSIBLE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
put
public AuthorizationTemplate put(AuthorizationTemplate value)
-
fromJSON
public void fromJSON(net.sf.json.JSON json)
the actual argument is assumed to be a JSON array of templates. If there si a single template, it is wrapped in a JSONArray and passed tofromJSON(JSONArray).- Parameters:
json-
-
fromJSON
public void fromJSON(net.sf.json.JSONArray array)
This actually does the work. The array is assumed to be an array of serializedAuthorizationTemplateobjects.- Parameters:
array-
-
fromJSON
public void fromJSON(String rawJSON)
Create this from aJSONobject. If this is a singleJSONObject, then it is assumed to be aAuthorizationTemplate. If it isJSONArraythen it is assumed to be a collection of them.- Parameters:
rawJSON-
-
toJSON
public net.sf.json.JSONArray toJSON()
Turn the contents of this object into a JSON object- Returns:
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceMap<String,AuthorizationTemplate>- Overrides:
equalsin classAbstractMap<String,AuthorizationTemplate>
-
getCapabilities
public Collection<String> getCapabilities(String audience)
Get All the capabilities for the given audience.- Parameters:
audience-- Returns:
-
getCapabilities
public Collection<String> getCapabilities(String audience, Collection<String> requested)
Get the capabilities requested for the audience.- Parameters:
audience-requested-- Returns:
-
main
public static void main(String[] args)
-
-