com.sun.xml.wss.saml.assertion.saml11.jaxb20.DoNotCacheCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xws-security Show documentation
Show all versions of xws-security Show documentation
sun xml wss xws-security library
The newest version!
/*
* 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
* https://jwsdp.dev.java.net/CDDLv1.0.html
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* HEADER in each file and include the License file at
* https://jwsdp.dev.java.net/CDDLv1.0.html If applicable,
* add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your
* own identifying information: Portions Copyright [yyyy]
* [name of copyright owner]
*/
/*
* $Id: DoNotCacheCondition.java,v 1.5 2007/01/08 16:06:07 shyam_rao Exp $
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.xml.wss.saml.assertion.saml11.jaxb20;
import com.sun.xml.wss.saml.SAMLException;
import com.sun.xml.wss.logging.LogDomainConstants;
import com.sun.xml.wss.saml.internal.saml11.jaxb20.DoNotCacheConditionType;
import com.sun.xml.wss.saml.util.SAMLJAXBUtil;
import java.util.logging.Logger;
import javax.xml.bind.JAXBContext;
/**
*This is an implementation of the abstract Condition
class, which
* specifes that the assertion this DoNotCacheCondition
is part of,
* is the new element in SAML 1.1, that allows an assertion party to express that
* an assertion should not be cached by the relying party for future use. In another
* word, such an assertion is meant only for "one-time" use by the relying party.
*/
public class DoNotCacheCondition extends DoNotCacheConditionType
implements com.sun.xml.wss.saml.DoNotCacheCondition {
protected static final Logger log = Logger.getLogger(
LogDomainConstants.WSS_API_DOMAIN,
LogDomainConstants.WSS_API_DOMAIN_BUNDLE);
/**
* Constructs a DoNotCacheCondition
element from
* an existing XML block.
*
* @param doNotCacheConditionElement A
* org.w3c.dom.Element
representing DOM tree
* for DoNotCacheCondition
object.
* @exception SAMLException if it could not process the
* org.w3c.dom.Element
properly, implying that
* there is an error in the sender or in the element definition.
*/
public static DoNotCacheConditionType fromElement(org.w3c.dom.Element element)
throws SAMLException {
try {
JAXBContext jc = SAMLJAXBUtil.getJAXBContext();
javax.xml.bind.Unmarshaller u = jc.createUnmarshaller();
return (DoNotCacheConditionType)u.unmarshal(element);
} catch ( Exception ex) {
throw new SAMLException(ex.getMessage());
}
}
}