/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: ConditionsImpl.java,v 1.3 2008/06/25 05:47:43 qcheng Exp $
*
*/
/**
* The <code>Conditions</code> defines the SAML constructs that place
* constraints on the acceptable use if SAML <code>Assertion</code>s.
*/
private boolean isMutable = true;
"AudienceRestriction";
"ProxyRestriction";
/**
* Default constructor
*/
public ConditionsImpl() {
}
/**
* This constructor is used to build <code>Conditions</code> object
* from a XML string.
*
* @param xml A <code>java.lang.String</code> representing
* a <code>Conditions</code> object
* @exception SAML2Exception if it could not process the XML string
*/
} else {
"ConditionsImpl.processElement(): invalid XML input");
"errorObtainingElement"));
}
}
/**
* This constructor is used to build <code>Conditions</code> object from a
* block of existing XML that has already been built into a DOM.
*
* @param element A <code>org.w3c.dom.Element</code> representing
* DOM tree for <code>Conditions</code> object
* @exception SAML2Exception if it could not process the Element
*/
}
"ConditionsImpl.processElement(): invalid root element");
"invalid_element"));
}
"ConditionsImpl.processElement(): local name missing");
"missing_local_name"));
}
"ConditionsImpl.processElement(): invalid local name "
+ elemName);
"invalid_local_name"));
}
// starts processing attributes
try {
} catch (ParseException pe) {
+ " invalid NotBefore attribute");
"invalid_date_format"));
}
}
try {
} catch (ParseException pe) {
+ " invalid NotOnORAfter attribute");
"invalid_date_format"));
}
}
// starts processing subelements
int nextElem = 0;
while (nextElem < numOfNodes) {
} else {
+"processElement(): unexpected subelement "
+ childName);
"unexpected_subelement"));
}
}
}
nextElem++;
}
}
/**
* Returns the time instant at which the subject can no longer
* be confirmed.
*
* @return the time instant at which the subject can no longer
* be confirmed.
*/
return notOnOrAfter;
}
/**
* Sets the time instant at which the subject can no longer
* be confirmed.
*
* @param value the time instant at which the subject can no longer
* be confirmed.
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
}
/**
* Returns a list of <code>Condition</code>
*
* @return a list of <code>Condition</code>
*/
return conditions;
}
/**
* Returns a list of <code>AudienceRestriction</code>
*
* @return a list of <code>AudienceRestriction</code>
*/
return audienceRestrictions;
}
/**
* Returns a list of <code>OneTimeUse</code>
*
* @return a list of <code>OneTimeUse</code>
*/
return oneTimeUses;
}
/**
* Returns a list of <code>ProxyRestriction</code>
*
* @return a list of <code>ProxyRestriction</code>
*/
return proxyRestrictions;
}
/**
* Sets a list of <code>Condition</code>
*
* @param conditions a list of <code>Condition</code>
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
this.conditions = conditions;
}
/**
* Sets a list of <code>AudienceRestriction</code>
*
* @param ars a list of <code>AudienceRestriction</code>
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
}
/**
* Sets a list of <code>OneTimeUse</code>
*
* @param oneTimeUses a list of <code>OneTimeUse</code>
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
this.oneTimeUses = oneTimeUses;
}
/**
* Sets a list of <code>ProxyRestriction</code>
*
* @param prs a list of <code>ProxyRestriction</code>
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
}
/**
* Returns the time instant before which the subject cannot be confirmed.
*
* @return the time instant before which the subject cannot be confirmed.
*/
return notBefore;
}
/**
* Sets the time instant before which the subject cannot
* be confirmed.
*
* @param value the time instant before which the subject cannot
* be confirmed.
* @exception SAML2Exception if the object is immutable
*/
if (!isMutable) {
"objectImmutable"));
}
}
/**
* Return true if a specific Date falls within the validity
* interval of this set of conditions.
*
* @param someTime Any time in milliseconds.
* @return true if <code>someTime</code> is within the valid
* interval of the <code>Conditions</code>.
*/
if (notOnOrAfter == null) {
return true;
} else {
return true;
}
}
} else if (notOnOrAfter == null ) {
return true;
}
{
return true;
}
return false;
}
/**
* Returns a String representation
* @param includeNSPrefix Determines whether or not the namespace
* qualifier is prepended to the Element when converted
* @param declareNS Determines whether or not the namespace is
* declared within the Element.
* @return A String representation
* @exception SAML2Exception if something is wrong during conversion
*/
throws SAML2Exception {
if (declareNS) {
}
if (includeNSPrefix) {
}
}
if (notOnOrAfter != null) {
}
int length = 0;
if (conditions != null) {
for (int i = 0; i < length; i++) {
}
}
if (audienceRestrictions != null) {
for (int i = 0; i < length; i++) {
}
}
if (oneTimeUses != null) {
for (int i = 0; i < length; i++) {
OneTimeUse ar =
}
}
if (proxyRestrictions != null) {
for (int i = 0; i < length; i++) {
}
}
append(">\n");
}
/**
* Returns a String representation
*
* @return A String representation
* @exception SAML2Exception if something is wrong during conversion
*/
return this.toXMLString(true, false);
}
/**
* Makes the object immutable
*/
public void makeImmutable() {
if (isMutable) {
if (conditions != null) {
for (int i = 0; i < length; i++) {
}
}
if (audienceRestrictions != null) {
for (int i = 0; i < length; i++) {
ar.makeImmutable();
}
}
if (oneTimeUses != null) {
for (int i = 0; i < length; i++) {
}
}
if (proxyRestrictions != null) {
for (int i = 0; i < length; i++) {
pr.makeImmutable();
}
}
isMutable = false;
}
}
/**
* Returns true if the object is mutable
*
* @return true if the object is mutable
*/
public boolean isMutable() {
return isMutable;
}
}