Package com.sun.identity.federation.meta
Class IDFFMetaUtils
- java.lang.Object
-
- com.sun.identity.federation.meta.IDFFMetaUtils
-
public class IDFFMetaUtils extends Object
This class contains utility methods to process the IDFF Meta data.
-
-
Field Summary
Fields Modifier and Type Field Description static DebugdebugIDFF Meta Debugprotected static StringIDFF_BUNDLE_NAMEBundle Namestatic StringIDFF_META_SERVICEIDFF Meta Data Configuration Name
-
Constructor Summary
Constructors Modifier Constructor Description protectedIDFFMetaUtils()Default Constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static MapconvertJAXBToAttrMap(String attrName, Object jaxbObj)Converts a JAXB object to aStringobject and creates aMap.static StringconvertJAXBToString(Object jaxbObj)Converts a JAXB object to aStringobject.static ObjectconvertNodeToJAXB(Node node)Converts aNodeobject to a JAXB object.static ObjectconvertStringToJAXB(String str)Converts aStringobject to a JAXB object.static MapgetAttributes(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config)Gets attribute value pairs fromBaseConfigTypeand put in aMap.static ListgetAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)static booleangetBooleanAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)static com.sun.identity.federation.jaxb.entityconfig.BaseConfigTypegetExtendedConfig(String realm, String providerId, String providerRole, IDFFMetaManager metaManager)Obtains provider's extended meta.static StringgetFirstAttributeValue(Map attrMap, String key)Gets the first value of list by given key searching in the given map.static StringgetFirstAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)static StringgetFirstAttributeValueFromIDPConfig(IDFFMetaManager metaManager, String realm, String idpEntityID, String attrName)static com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorTypegetIDPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)Returns theIDPDescriptorin the Entity Descriptor.static com.sun.identity.federation.jaxb.entityconfig.IDPDescriptorConfigElementgetIDPDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)Returns the Identity Provider Entity Configuration.static StringgetMetaAlias(String realm, String providerID, String providerRole, Object session)Obtains provider's meta alias.static StringgetMetaAliasByUri(String uri)Returns metaAlias embedded in uri.static StringgetRealmByMetaAlias(String metaAlias)Returns the realm by parsing the metaAlias.static com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorTypegetSPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)Returns the SPDescriptor in the Entity Descriptor.static com.sun.identity.federation.jaxb.entityconfig.SPDescriptorConfigElementgetSPDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)Returns the Service Provider Entity Configuration.static booleanisAutoFedEnabled(Map attributes)
-
-
-
Field Detail
-
IDFF_META_SERVICE
public static final String IDFF_META_SERVICE
IDFF Meta Data Configuration Name- See Also:
- Constant Field Values
-
debug
public static Debug debug
IDFF Meta Debug
-
IDFF_BUNDLE_NAME
protected static String IDFF_BUNDLE_NAME
Bundle Name
-
-
Method Detail
-
convertJAXBToString
public static String convertJAXBToString(Object jaxbObj) throws JAXBException
Converts a JAXB object to aStringobject.- Parameters:
jaxbObj- a JAXB object- Returns:
- a
Stringrepresenting the JAXB object. - Throws:
JAXBException- if an error occurs while converting JAXB object
-
convertJAXBToAttrMap
protected static Map convertJAXBToAttrMap(String attrName, Object jaxbObj) throws JAXBException
Converts a JAXB object to aStringobject and creates aMap. The key is 'attrName' and the value is aSetwhich contains theStringobject.- Parameters:
attrName- attribute namejaxbObj- a JAXB object- Returns:
- a
Map. The key is 'attrName' and the value is aSetcontains theStringobject converted from the JAXB object. - Throws:
JAXBException- if an error occurs while converting JAXB object
-
convertNodeToJAXB
public static Object convertNodeToJAXB(Node node) throws JAXBException
Converts aNodeobject to a JAXB object.- Parameters:
node- aNodeobject- Returns:
- a JAXB object converted from the
Nodeobject - Throws:
JAXBException- if an error occurs while convertingNodeobject
-
convertStringToJAXB
public static Object convertStringToJAXB(String str) throws JAXBException
Converts aStringobject to a JAXB object.- Parameters:
str- aStringobject- Returns:
- a JAXB object converted from the
Stringobject. - Throws:
JAXBException- if an error occurs while convertingStringobject
-
getSPDescriptor
public static com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType getSPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)
Returns the SPDescriptor in the Entity Descriptor. If there is more then one SPDescriptor then the first one in the list is returned.- Parameters:
entityDescriptor- the EntityDescriptor element.- Returns:
- the
SPDescriptorTypeobject.
-
getIDPDescriptor
public static com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType getIDPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)
Returns theIDPDescriptorin the Entity Descriptor. If there multiple descriptors then the first retreived descriptor is returned.- Parameters:
entityDescriptor- the EntityDescriptor element.- Returns:
- the
IDPDescriptorTypeobject.
-
getSPDescriptorConfig
public static com.sun.identity.federation.jaxb.entityconfig.SPDescriptorConfigElement getSPDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)
Returns the Service Provider Entity Configuration. If there are multiple Configurations then the first configuration retreived is returned.- Parameters:
entityConfig- theEntityConfigElementobject.- Returns:
- the
SPDescriptorEntityConfigElementobject.
-
getIDPDescriptorConfig
public static com.sun.identity.federation.jaxb.entityconfig.IDPDescriptorConfigElement getIDPDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)
Returns the Identity Provider Entity Configuration. If there are multiple Configuraitons then the first configuration retreived is returned.- Parameters:
entityConfig- theEntityConfigElementobject.- Returns:
- the
IDPDescriptorEntityConfigElementobject.
-
getAttributes
public static Map getAttributes(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config)
Gets attribute value pairs fromBaseConfigTypeand put in aMap. The key is attribute name and the value is aListof attribute values.- Parameters:
config- theBaseConfigTypeobject- Returns:
- an attrbute value
Map
-
getFirstAttributeValue
public static String getFirstAttributeValue(Map attrMap, String key)
Gets the first value of list by given key searching in the given map.- Parameters:
attrMap- Map of which list is to be retrieved.key- Key of the entry to be retrieved.- Returns:
- the first value of a matching list by the given key. Returns
nullifattrMapis null orkeyisnull.
-
isAutoFedEnabled
public static boolean isAutoFedEnabled(Map attributes)
-
getFirstAttributeValueFromIDPConfig
public static String getFirstAttributeValueFromIDPConfig(IDFFMetaManager metaManager, String realm, String idpEntityID, String attrName)
-
getBooleanAttributeValueFromConfig
public static boolean getBooleanAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)
-
getFirstAttributeValueFromConfig
public static String getFirstAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)
-
getAttributeValueFromConfig
public static List getAttributeValueFromConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType config, String attrName)
-
getRealmByMetaAlias
public static String getRealmByMetaAlias(String metaAlias)
Returns the realm by parsing the metaAlias. MetaAlias format is<realm>/<any string without '/'> for non-root realm or /<any string without '/'> for root realm.
- Parameters:
metaAlias- The metaAlias.- Returns:
- the realm associated with the metaAlias.
-
getMetaAliasByUri
public static String getMetaAliasByUri(String uri)
Returns metaAlias embedded in uri.- Parameters:
uri- The uri string.- Returns:
- the metaAlias embedded in uri or null if not found.
-
getMetaAlias
public static String getMetaAlias(String realm, String providerID, String providerRole, Object session)
Obtains provider's meta alias.- Parameters:
realm- the realm in which the provider residesproviderID- provider's entity IDproviderRole- provider's rolesession- user session object- Returns:
- service provider's meta alias; or
nullif an error occurs.
-
getExtendedConfig
public static com.sun.identity.federation.jaxb.entityconfig.BaseConfigType getExtendedConfig(String realm, String providerId, String providerRole, IDFFMetaManager metaManager)
Obtains provider's extended meta.- Parameters:
realm- the realm in which the provider residesproviderId- provider's entity IDproviderRole- provider's rolemetaManager-IDFFMetaManagerinstance.- Returns:
- provider's extended meta; or
nullif an error occurs.
-
-