/**
* 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: FSRequest.java,v 1.3 2008/06/25 05:46:45 qcheng Exp $
* Portions Copyrighted 2014 ForgeRock AS
*/
/**
* Portions Copyrighted 2012 ForgeRock AS
*/
/**
* This class represents a Liberty <code>Request</code>.
* It extends from the abstract base class <code>AbstractRequest</code>.
*
* @supported.all.api
* @deprecated since 12.0.0
*/
/*
* data members
*/
/**
* Returns the value of <code>id</code> attribute.
*
* @return the value of <code>id</code> attribute.
* @see #setID(String)
*/
return id;
}
/**
* Sets the value of <code>id</code> attribute.
*
* @param id the value of <code>id</code> attribute.
* @see #getID()
*/
}
/*
* Default Constructor.
*/
protected FSRequest() {
}
/**
* Constructor creates <code>Request</code> object. This
* shall only be used at the client side to construct a
* <code>Request</code> object.
* NOTE: The content here is just the body for the Request. The
* constructor will add <code>MajorVersion</code>,
* <code>MinorVersion</code>, etc. to form a complete Request.
*
* @param requestId the request identifier, if this
* value is null then one will be generated.
* @param query <code>AuthenticationQuery</code> to be included in
* the Request.
* @throws <code>SAMLException</code> on error.
*/
}
/**
* Constructor creates <code>Request</code> object. This
* shall only be used at the client side to construct a
* <code>Request</code> object.
* NOTE: The content here is just the body for the Request. The
* constructor will add <code>MajorVersion</code>,
* <code>MinorVersion</code>, etc. to form a complete Request.
*
* @param requestId the request identifier, if this
* value is null then one will be generated.
* @param contents a <code>List</code> of objects that are the contents
* of Request that the client wants to send to the server.
* It could be an :
* <code>AuthenticationQuery</code>,
* <code>AuthorizationDecisionQuery</code>,
* <code>AttributeQuery</code>, 1 or more
* <code>AssertionIDReference</code>, or 1 or more of
* <code>AssertionArtifact</code>.
* @throws <code>SAMLException</code> throws errors on exception.
*/
}
/**
* Returns the <code>MinorVersion</code>.
*
* @return the <code>MinorVersion</code>.
* @see #setMinorVersion(int)
*/
public int getMinorVersion() {
return minorVersion;
}
/**
* Sets the <code>MinorVersion</code>.
*
* @param version the <code>MinorVersion</code>.
* @see #getMinorVersion()
*/
}
/**
* Parses the <code>XML</code> Document String to construct a
* <code>Request</code> object. This method shall only be used at the server
* side to reconstruct a Request object based on the XML document
* received from client.
*
* @param xml the <code>XML</code> Document string.
* @return the <code>Request</code> object.
* @throws <code>SAMLException</code> on error.
*/
// parse the xml string
}
/**
* Constructor creates a <code>FSRequest</code> object from
* a <code>XML</code> Document Element.
*
* @param root the <code>XML</code> Document Element.
* @throws <code>SAMLException</code> on error.
*/
// Make sure this is a Request
"nullInput",null);
}
"wrongInput",null);
}
if (signsSize == 1) {
} else {
}
if (!valid) {
+ " Request's signature.");
}
}
signed = true;
} else if (signsSize != 0) {
+ " one Signature element.");
}
"moreElement",null);
}
// Attribute RequestID
+ "have a RequestID.");
}
"missingAttribute",args);
}
// Attribute MajorVersion
// Attribute MinorVersion
// Attribute IssueInstant
"missingAttribute",args);
} else {
try {
} catch (Exception e) {
"Request(Element): could not parse IssueInstant", e);
"wrongInput",null);
}
}
// get the contents of the request
+ "RespondWith value.");
}
"wrongInput",null);
}
respondWiths = new ArrayList();
}
// make sure the content is not assigned already
if (contentType != NOT_SUPPORTED) {
+ "contain only one AuthenticationQuery.");
}
"wrongInput",null);
}
// make sure content is not assigned already
if (contentType != NOT_SUPPORTED) {
+ "contain only one "
+ "AuthorizationDecisionQuery.");
}
"wrongInput",null);
}
// make sure content is not assigned already
if (contentType != NOT_SUPPORTED) {
+ "contain only one AttributeQuery.");
}
"wrongInput",null);
}
// make sure the content has no other elements assigned
if ((contentType != NOT_SUPPORTED) &&
(contentType != ASSERTION_ID_REFERENCE)) {
+ "contained mixed contents.");
}
"wrongInput",null);
}
assertionIDRefs = new ArrayList();
}
// make sure the content has no other elements assigned
if ((contentType != NOT_SUPPORTED) &&
(contentType != ASSERTION_ARTIFACT)) {
+ "contained mixed contents.");
}
"wrongInput",null);
}
}
} else {
+ " node" + nodeName);
}
"wrongInput",null);
} // check nodeName
} // if nodeName != null
} // done for the nodelist loop
if (contentType == NOT_SUPPORTED) {
"wrongInput",null);
}
}
/* Returns the value of <code>RespondWith</code> attribute.
*
* @return value of the <code>RespondWith</code> attribute.
* @throws <code>SAMLException</code> on error.
*/
throws SAMLException {
"wrongInput",null);
}
} else {
"wrongInput",null);
}
"wrongInput",null);
}
}
}
/**
* Sets the <code>MajorVersion</code> by parsing the version string.
*
* @param majorVer a String representing the <code>MajorVersion</code> to
* be set.
* @throws <code>FSMsgException</code> on error.
*/
try {
} catch (NumberFormatException e) {
+ "MajorVersion", e);
}
"wrongInput",null);
}
+ "the Request is too high.");
}
throw new SAMLRequestVersionTooHighException(
} else {
+ "the Request is too low.");
}
"requestVersionTooLow",null);
}
}
}
/**
* Sets the <code>MinorVersion</code> by parsing the version string.
*
* @param minorVer a String representing the <code>MinorVersion</code> to
* be set.
* @throws <code>SAMLException</code> when the version mismatchs.
*/
try {
} catch (NumberFormatException e) {
+ "MinorVersion", e);
}
"wrongInput",null);
}
+ " of the Request is too high.");
"requestVersionTooHigh",null);
} else if (minorVersion <
+ " of the Request is too low.");
"requestVersionTooLow",null);
}
}
/**
* Parses the Query or <code>SubjectQuery</code> represented by
* a DOM tree Node. It then checks and sets data members if it is a
* supported query, such as <code>AuthenticationQuery</code>,
* <code>AttributeQeury</code>, or <code>AuthorizationDecisionQuery</code>.
*
* @param child a <code>DOM</code> Node.
* @throws <code>SAMLException</code> if the <code>Query</code> is invalid.
*/
boolean found = false;
for (int j = 0; j < len; j++) {
if (contentType != NOT_SUPPORTED) {
+ " contain only one AuthenticationQuery.");
}
"wrongInput",null);
}
"AuthorizationDecisionQueryType")) {
if (contentType != NOT_SUPPORTED) {
+ "contain one "
+ "AuthorizationDecisionQuery.");
}
"wrongInput",null);
}
if (contentType != NOT_SUPPORTED) {
+ "contain one AttributeQuery.");
}
"wrongInput",null);
}
} else {
}
"queryNotSupported",null);
} // check typevalue
found = true;
break;
} // if found type attribute
} // end attribute for loop
// if not found type
if (!found) {
}
"wrongInput",null);
}
}
/**
* Creates a String representation of the <code><samlp:Request></code>
* element.
*
* @return a <code>XML</code> String representing the request.
*/
return toXMLString(true, true);
}
/**
* Creates a String representation of the <code><samlp:Request></code>
* element.
*
* @param includeNS Determines whether or not the names pace qualifier
* is prepended to the Element when converted
* @param declareNS Determines whether or not the name space is declared
* within the Element.
* @return a string containing the valid XML for this object.
*/
}
/**
* Creates a String representation of the <code><samlp:Request></code>
* element.
*
* @param includeNS Determines whether or not the name space qualifier
* is prepended to the Element when converted
* @param declareNS Determines whether or not the name space is declared
* within the Element.
* @param includeHeader Determines whether the output include the XML
* declaration header.
* @return a string containing the valid XML for this object.
*/
boolean includeHeader) {
return xmlString;
}
if (includeHeader) {
}
if (includeNS) {
}
if (declareNS) {
} else {
}
}
//append(" xmlns=\"http://www.w3.org/2000/xmlns/\"").append(uri).
}
}
}
while (i.hasNext()) {
} else {
try {
} catch (SAMLException e) {
}
}
}
}
if (signed) {
if (signatureString != null) {
}
}
Iterator j;
switch (contentType) {
case AUTHENTICATION_QUERY:
break;
break;
case ATTRIBUTE_QUERY:
break;
case ASSERTION_ID_REFERENCE:
j = assertionIDRefs.iterator();
while (j.hasNext()) {
toString(true, true));
}
break;
case ASSERTION_ARTIFACT:
while (j.hasNext()) {
}
break;
default:
break;
}
}
}