public final class WSFederationMetaUtils extends Object
WSFederationMetaUtils
provides metadata related utility
methods.Modifier and Type | Field and Description |
---|---|
static ResourceBundle |
bundle
Resource bundle for the WS-Federation implementation.
|
static Debug |
debug |
Modifier and Type | Method and Description |
---|---|
static Object |
convertInputStreamToJAXB(InputStream is)
Reads from the
InputStream and converts to a JAXB object. |
protected static Map |
convertJAXBToAttrMap(String attrName,
Object jaxbObj)
Converts a JAXB object to a
String object and creates a
Map . |
static void |
convertJAXBToOutputStream(Object jaxbObj,
OutputStream os)
Converts a JAXB object and writes to an
OutputStream object. |
static String |
convertJAXBToString(Object jaxbObj)
Converts a JAXB object to a
String object. |
static Object |
convertNodeToJAXB(Node node)
Converts a
Node object to a JAXB object. |
static Object |
convertStringToJAXB(String str)
Converts a
String object to a JAXB object. |
static void |
fillEntriesInSet(Map attrMap,
String key,
String value)
Adds a set of a given value to a map.
|
static String |
getAttribute(BaseConfigType config,
String key)
Gets a single attribute value from
BaseConfigType |
static String |
getAttribute(BaseConfigType config,
String key,
String defaultValue)
Gets a single attribute value from
BaseConfigType . |
static Map<String,List<String>> |
getAttributes(BaseConfigType config)
Gets attribute value pairs from
BaseConfigType and
put in a Map . |
static List<String> |
getAttributes(BaseConfigType config,
String key)
Returns all attribute values associated with they key provided.
|
static String |
getEndpointBaseUrl(IDPSSOConfigElement idpConfig,
javax.servlet.http.HttpServletRequest request)
Returns the endpoint baseURL as stored in the configuration, or if absent, generates the base URL based on the
incoming HTTP request.
|
static String |
getFirstEntry(Map attrMap,
String key)
Get the first value of set by given key searching in the given map.
|
static int |
getIntAttribute(BaseConfigType config,
String key,
int defaultValue)
Gets the int value stored in the configuration under the provided key, or the default value if it was not defined
or if it was malformed.
|
static String |
getMetaAliasByUri(String uri)
Returns metaAlias embedded in uri.
|
static JAXBContext |
getMetaJAXBContext()
Returns
JAXB context for the metadata service. |
static String |
getRealmByMetaAlias(String metaAlias)
Returns the realm by parsing the metaAlias.
|
static void |
setAttributes(BaseConfigType config,
Map<String,List<String>> map)
Sets attribute value pairs in
BaseConfigType . |
public static Debug debug
public static ResourceBundle bundle
public static JAXBContext getMetaJAXBContext()
JAXB
context for the metadata service.JAXB
context object.public static Object convertStringToJAXB(String str) throws JAXBException
String
object to a JAXB object.str
- a String
objectString
object.JAXBException
- if an error occurs while converting
String
objectpublic static Object convertInputStreamToJAXB(InputStream is) throws JAXBException
InputStream
and converts to a JAXB object.is
- a InputStream
objectInputStream
object.JAXBException
- if an error occurs while converting
InputStream
objectpublic static Object convertNodeToJAXB(Node node) throws JAXBException
Node
object to a JAXB object.node
- a Node
objectNode
object.JAXBException
- if an error occurs while converting
Node
objectpublic static String convertJAXBToString(Object jaxbObj) throws JAXBException
String
object.jaxbObj
- a JAXB objectString
representing the JAXB object.JAXBException
- if an error occurs while converting JAXB objectpublic static void convertJAXBToOutputStream(Object jaxbObj, OutputStream os) throws JAXBException
OutputStream
object.jaxbObj
- a JAXB objectos
- an OutputStream
objectJAXBException
- if an error occurs while converting JAXB objectprotected static Map convertJAXBToAttrMap(String attrName, Object jaxbObj) throws JAXBException
String
object and creates a
Map
. The key is 'attrName' and the value is a
Set
contains the String
object.attrName
- attribute namejaxbObj
- a JAXB objectMap
. The key is 'attrName' and the value is a
Set
contains the String
object
converted from the JAXB object.JAXBException
- if an error occurs while converting JAXB objectpublic static Map<String,List<String>> getAttributes(BaseConfigType config)
BaseConfigType
and
put in a Map
. The key is attribute name and the value is
a List
of attribute values;config
- the BaseConfigType
objectMap
public static List<String> getAttributes(BaseConfigType config, String key)
config
- The configuration object.key
- The attribute key.public static void setAttributes(BaseConfigType config, Map<String,List<String>> map) throws JAXBException
BaseConfigType
. NOTE -
existing AVPs are discarded! The key isconfig
- the BaseConfigType
objectmap
- mapping from attribute names to List
s of
attribute values;JAXBException
public static String getAttribute(BaseConfigType config, String key)
BaseConfigType
config
- the BaseConfigType
objectkey
- attribute key.public static String getAttribute(BaseConfigType config, String key, String defaultValue)
BaseConfigType
.config
- The BaseConfigType
object.key
- Attribute key.defaultValue
- The defaultValue to return if the attribute was not set.public static int getIntAttribute(BaseConfigType config, String key, int defaultValue)
config
- The configuration object to investigate.key
- The configuration key.defaultValue
- The default value to return if the config is missing or malformed.public static String getRealmByMetaAlias(String metaAlias)
<realm>/<any string without '/'> for non-root realm or /<any string without '/'> for root realm.
metaAlias
- The metaAlias.public static String getMetaAliasByUri(String uri)
uri
- The uri string.public static String getFirstEntry(Map attrMap, String key)
attrMap
is null or key
is null.attrMap
- Map of which set is to be added.key
- Key of the entry to be added.public static void fillEntriesInSet(Map attrMap, String key, String value)
attrMap
is null or value
is null or
key
is null.attrMap
- Map of which set is to be added.key
- Key of the entry to be added.value
- Value to be added to the Set.public static String getEndpointBaseUrl(IDPSSOConfigElement idpConfig, javax.servlet.http.HttpServletRequest request)
idpConfig
- The configuration object.request
- The HTTP request corresponding to the current WS-Fed action.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.