/*
* 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: FSFederationTerminationNotification.java,v 1.3 2008/06/25 05:46:44 qcheng Exp $
*
* Portions Copyrighted 2014-2016 ForgeRock AS.
*/
/**
* This class has methods for creating object and message for
* Federation Termination.
*
* @supported.all.api
* @deprecated since 12.0.0
*/
/**
* Default Constructor.
*/
public FSFederationTerminationNotification() {
try {
providerId = new String();
} catch(SAMLException e){
"FSFederationTerminationNotification.constructor:", e);
}
}
}
/**
* Creates <code>FSFederationTerminationNotification<object> from
* a Document Element.
*
* @param root the Document Element.
* @throws FSMsgException if there is an error creating
* this object.
*/
throws FSMsgException {
"FSFederationTerminationNotification(Element):null input.");
}
"FSFederationTerminationNotification(Element):wrong input");
}
// Attribute IssueInstant
+ "missing IssueInstant");
} else {
try {
} catch (ParseException e) {
+ " (Element): could not parse IssueInstant", e);
}
}
}
int length = 0;
for (int i = 0; i < length; i++) {
respondWiths = new ArrayList();
}
if (providerId != null) {
"FSFederationTerminationNotification(" +
"Element : should contain only one " +
"ProviderID.");
}
}
try{
this.nameIdentifier =
} catch(SAMLException ex){
"FSFederationTerminationNotification "
+ "(Element): SAMLException "
+ "while constructing nameidentifier");
}
throw new FSMsgException("nameIdentifierCreateError",
null);
}
if (relayState != null) {
"FSFederationTerminationNotification "
+ "(Element) :should contain only one "
+ "relayState.");
}
}
} else {
"FSFederationTerminationNotification(Element): "
+ " invalid node" + nodeName);
}
}
}
}
//check for signature
if (signsSize == 1) {
signed = true;
} else if (signsSize != 0) {
"FSFederationTerminationNotification(Element):"
+ "included more than one Signature element.");
}
}
}
/**
* Creates <code>FSFederationTerminationNotification</code> object.
*
* @param requestId the request identifier.
* @param providerID the provider identifier.
* @param nameId the <code>NameIdentifier</code> object.
* @throws FSMsgException if there is an error creating
* this object.
*/
int length = 0;
int i = 0;
if ((respondWiths != null) &&
for (i = 0; i < length; i++) {
"FSFederationTerminationNotification:"
+ "wrong input for RespondWith");
}
}
}
this.respondWiths = respondWiths;
}
} else {
// random generate one
+ "couldn't generate RequestID.");
}
}
this.providerId = providerID;
this.nameIdentifier = nameId;
}
/**
* Returns the string representation of this object.
* This method translates the response to an XML document string based on
* the Response schema described above.
*
* @return An XML String representing the response. NOTE: this is a
* complete SAML response xml string with ResponseID,
* MajorVersion, etc.
* @throws FSMsgException if there is an error converting
* this object ot a string.
*/
throws FSMsgException {
}
/**
* Returns a String representation of the <samlp:Response> element.
*
* @param includeNS 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.
* @param includeHeader Determines whether the output include the xml
* declaration header.
* @return a string containing the valid XML for this element
* @throws FSMsgException if there is an error converting
* this object ot a string.
*/
boolean includeHeader) throws FSMsgException {
"FSFederationTerminationNotification.toXMLString"
+ ": providerId is null in the request with requestId:"
+ requestID);
}
+ "toXMLString: couldn't generate RequestID.");
}
}
if (includeHeader) {
}
if (includeNS) {
}
if (declareNS) {
}
}
.append("id")
}
if ((respondWiths != null) &&
while (i.hasNext()) {
}
}
if (signed) {
if (signatureString != null) {
}
}
if (nameIdentifier != null) {
}
if (relayState != null) {
}
} else {
+ "toString: requestID is null ");
}
}
}
/**
* Returns the string representation of this object.
* This method translates the response to an XML document string.
*
* @return An XML String representing the response. NOTE: this is a
* complete SAML response xml string with ResponseID,
* MajorVersion, etc.
*/
return toXMLString(true, true);
}
/**
* Returns the <code>FSAuthnRequest</code> object.
*
* @param xml the XML string to be parsed.
* @return <code>FSAuthnRequest</code> object created from the XML string.
* @throws FSMsgException if there is
* error creating the object.
*/
throws FSMsgException {
"FSFederationTerminationNotification.parseXML:Error "
+ "while parsing input xml string");
}
}
return new FSFederationTerminationNotification(root);
}
/**
* 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()
*/
}
/**
* Set the value of <code>RelayState</code> attribute.
*
* @param relayState the value of <code>RelayState</code> attribute.
* @see #getRelayState()
*/
this.relayState = relayState;
}
/**
* Returns the value of <code>RelayState</code> attribute.
*
* @return the value of <code>RelayState</code> attribute.
* @see #setRelayState(String)
*/
return relayState;
}
/**
* Returns the value of <code>MinorVersion</code> attribute.
*
* @return the value of <code>MinorVersion</code> attribute.
* @see #setMinorVersion(int)
*/
public int getMinorVersion() {
return minorVersion;
}
/**
* Sets the value of <code>MinorVersion</code> attribute.
*
* @param version the value of <code>MinorVersion</code> attribute.
* @see #getMinorVersion()
*/
}
/**
* Returns the value of <code>ProviderID</code> attribute.
*
* @return the value of <code>ProviderID</code> attribute.
* @see #setProviderId(String).
*/
return providerId;
}
/**
* Sets the value of <code>ProviderID</code> attribute.
*
* @param providerID the value of <code>ProviderID</code> attribute.
* @see #getProviderId()
*/
this.providerId = providerID;
}
/**
* Returns the <code>NameIdentifier</code> object.
*
* @return the <code>NameIdentifier</code> object.
*/
return nameIdentifier;
}
/**
* Sets the <code>NameIdentifier</code> object.
*
* @param nameId the <code>NameIdentifier</code> object.
*/
this.nameIdentifier = nameId;
}
/**
* Returns an <code>URL</code> encoded query string.
*
* @return a <code>URL</code> encoded query string.
* @throws FSMsgException if there is an error.
*/
+ "toURLEncodedQueryString: providerId is null in the "
+ "request with requestId: " + requestID);
}
+ "toURLEncodedQueryString: couldn't generate "
+ "RequestID.");
}
}
if(issueInstant != null){
} else {
+ "toURLEncodedQueryString: issueInstant missing");
}
}
if (nameIdentifier != null) {
}
}
}
}
if (relayState != null) {
}
return urlEncodedAuthnReq.toString();
}
/**
* Returns a <code>Base64</code> encoded string representing this
* object.
*
* @return a <code>Base64</code> encoded string representing this
* object.
* @throws FSMsgException if there is an error creating
* a <code>Base64</code> encoded string.
*/
+ "toURLEncodedQueryString: providerId is null in the "
+ "request with requestId:" + requestID);
}
+ "toURLEncodedQueryString: couldn't generate "
+ "RequestID.");
}
}
}
/**
* Returns <code>FSFederationTerminationNotification</code> object. The
* object is creating by parsing the <code>HttpServletRequest</code>
* object.
*
* @param request the <code>HttpServletRequest</code> object.
* @throws FSMsgException if there is an error
* creating <code>FSFederationTerminationNotification</code> object.
*/
) throws FSMsgException, SAMLException {
try{
} catch(NumberFormatException ex){
}
} else {
}
if (instantString == null ||
}
try{
} catch (ParseException e){
}
if (providerID != null){
} else {
}
}
if (relayState != null) {
}
}
/**
* Sets the <code>MajorVersion</code> by parsing the version string.
*
* @param majorVer a String representing the <code>MajorVersion</code> to
* be set.
* @throws FSMsgException when the version mismatches.
*/
try {
} catch (NumberFormatException e) {
"FSFederationTerminationNotification(Element): "
+ "invalid MajorVersion", e);
}
}
"FSFederationTerminationNotification(Element): "
+ "MajorVersion of the "
+ "FederationTerminationNotification is too high.");
}
} else {
"FSFederationTerminationNotification(Element): "
+ "MajorVersion of the "
+ "FederationTerminationNotification is too low.");
}
}
}
}
/**
* Sets the <code>MinorVersion</code> by parsing the version string.
*
* @param minorVer a String representing the <code>MinorVersion</code> to
* be set.
* @throws SAMLException when the version mismatchs.
*/
try {
} catch (NumberFormatException e) {
"FSFederationTerminationNotification(Element): "
+ "invalid MinorVersion", e);
}
}
+ " MinorVersion of the Response is too high.");
} else {
+ " MinorVersion of the Response is too low:"
+ minorVersion);
}
}
}
/**
* Unsupported operation.
*/
"unsupportedOperation",null);
}
/**
* Signs the <code>FSFederationTerminationNotification</code>.
* object
*
* @param certAlias the Certificate Alias
* @throws SAMLException if
* <code>FSFederationTerminationNotification</code>
* cannot be signed.
*/
"FSFederationTerminationNotification.signXML: Called");
if (signed) {
"FSFederationTerminationNotification.signXML: "
+ "the assertion is already signed.");
}
"alreadySigned",null);
}
throw new SAMLResponderException(
}
try{
this.id, false);
} else
this.getRequestID(), false);
} else {
}
}
signed = true;
xmlString = this.toXMLString(true, true);
} catch(Exception e){
"signFailed",null);
}
}
/**
* Sets the <code>Element</code> signature.
*
* @param elem the <code>Element</code> object
* @return true if signature is set otherwise false
*/
return super.setSignature(elem);
}
}