/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: WSFederationMetaUtils.java,v 1.5 2009/10/28 23:58:59 exu Exp $
*
*/
/**
* Portions Copyrighted 2012 ForgeRock Inc
*/
/**
* The <code>WSFederationMetaUtils</code> provides metadata related utility
* methods.
*/
public final class WSFederationMetaUtils {
/**
* Resource bundle for the WS-Federation implementation.
*/
// Need to explicitly list xmldsig, otherwise JAXB doesn't see it, since
// dsig elements are buried in 'any' elements. Grrr...
"com.sun.identity.wsfederation.jaxb.wsu:" +
"com.sun.identity.wsfederation.jaxb.wsse:" +
"com.sun.identity.wsfederation.jaxb.wsaddr:" +
"com.sun.identity.wsfederation.jaxb.wspolicy:" +
"com.sun.identity.wsfederation.jaxb.wsspolicy:" +
"com.sun.identity.wsfederation.jaxb.entityconfig:" +
"com.sun.identity.wsfederation.jaxb.wsfederation";
"jaxb.formatted.output";
"com.sun.xml.bind.namespacePrefixMapper";
new NamespacePrefixMapperImpl();
static {
try {
} catch (JAXBException jaxbe) {
throw new ExceptionInInitializerError(jaxbe);
}
}
/*
* Private constructor ensure that no instance is ever created
*/
private WSFederationMetaUtils() {
}
/**
* Returns <code>JAXB</code> context for the metadata service.
* @return <code>JAXB</code> context object.
*/
return jaxbContext;
}
/**
* Converts a <code>String</code> object to a JAXB object.
* @param str a <code>String</code> object
* @return a JAXB object converted from the <code>String</code> object.
* @exception JAXBException if an error occurs while converting
* <code>String</code> object
*/
throws JAXBException {
}
/**
* Reads from the <code>InputStream</code> and converts to a JAXB object.
* @param is a <code>InputStream</code> object
* @return a JAXB object converted from the <code>InputStream</code> object.
* @exception JAXBException if an error occurs while converting
* <code>InputStream</code> object
*/
throws JAXBException {
}
/**
* Converts a <code>Node</code> object to a JAXB object.
* @param node a <code>Node</code> object
* @return a JAXB object converted from the <code>Node</code> object.
* @exception JAXBException if an error occurs while converting
* <code>Node</code> object
*/
throws JAXBException {
//no need to get SAXSource, since the node is already created by using
//a secure XML parser
}
/**
* Converts a JAXB object to a <code>String</code> object.
* @param jaxbObj a JAXB object
* @return a <code>String</code> representing the JAXB object.
* @exception JAXBException if an error occurs while converting JAXB object
*/
throws JAXBException {
}
/**
* Converts a JAXB object and writes to an <code>OutputStream</code> object.
* @param jaxbObj a JAXB object
* @param os an <code>OutputStream</code> object
* @exception JAXBException if an error occurs while converting JAXB object
*/
throws JAXBException {
}
/**
* Converts a JAXB object to a <code>String</code> object and creates a
* <code>Map</code>. The key is 'attrName' and the value is a
* <code>Set</code> contains the <code>String</code> object.
* @param attrName attribute name
* @param jaxbObj a JAXB object
* @return a <code>Map</code>. The key is 'attrName' and the value is a
* <code>Set</code> contains the <code>String</code> object
* converted from the JAXB object.
* @exception JAXBException if an error occurs while converting JAXB object
*/
throws JAXBException {
return attrs;
}
/**
* Gets attribute value pairs from <code>BaseConfigType</code> and
* put in a <code>Map</code>. The key is attribute name and the value is
* a <code>List</code> of attribute values;
* @param config the <code>BaseConfigType</code> object
* @return a attrbute value <code>Map</code>
*/
{
}
return attrMap;
}
/**
* Sets attribute value pairs in <code>BaseConfigType</code>. NOTE -
* existing AVPs are discarded! The key is
* @param config the <code>BaseConfigType</code> object
* @param map mapping from attribute names to <code>List</code>s of
* attribute values;
*/
throws JAXBException
{
// add the new content
{
}
}
/**
* Gets a single attribute value from <code>BaseConfigType</code>
* @param config the <code>BaseConfigType</code> object
* @param key attribute key.
* @return the attribute value
*/
{
}
}
return null;
}
/**
* Returns the realm by parsing the metaAlias. MetaAlias format is
* <pre>
* <realm>/<any string without '/'> for non-root realm or
* /<any string without '/'> for root realm.
* </pre>
* @param metaAlias The metaAlias.
* @return the realm associated with the metaAlias.
*/
return null;
}
return "/";
}
}
/**
* Returns metaAlias embedded in uri.
* @param uri The uri string.
* @return the metaAlias embedded in uri or null if not found.
*/
return null;
}
return null;
}
}
/**
* Get the first value of set by given key searching in the given map.
* return null if <code>attrMap</code> is null or <code>key</code>
* is null.
*
* @param attrMap Map of which set is to be added.
* @param key Key of the entry to be added.
* @return the first value of a matching set by the given key.
*/
}
}
return retValue;
}
/**
* Adds a set of a given value to a map. Set will not be added if
* <code>attrMap</code> is null or <code>value</code> is null or
* <code>key</code> is null.
*
* @param attrMap Map of which set is to be added.
* @param key Key of the entry to be added.
* @param value Value to be added to the Set.
*/
}
}
}