FSLogoutNotification.java revision f948ca04a28ccfeed9633bf4b0fb0d2c59c37478
/**
* 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: FSLogoutNotification.java,v 1.4 2008/06/25 05:46:44 qcheng Exp $
* Portions Copyrighted 2014 ForgeRock AS
*/
/**
* This class contains methods to construct a <code>LogoutRequest</code>
* object.
*
* @supported.all.api
* @deprecated since 12.0.0
*/
public class FSLogoutNotification extends AbstractRequest {
private String providerId;
private NameIdentifier nameIdentifier;
protected String sessionIndex;
/**
* Default Constructor.
*/
public FSLogoutNotification() {
setIssueInstant(new Date());
}
/**
* Constructor creates <code>FSLogoutNotification</code> object
* from Document Element.
*
* @param root the Document Element object.
* @throws FSMsgException if there is an error creating this
* object.
*/
}
}
// get the IssueInstant Attribute
"LogoutRequest(Element): missing IssueInstant");
} else {
try {
} catch (Exception e) {
+ "parse IssueInstant:" + e.getMessage());
}
}
}
// get the NotOnOrAfter Attribute
try {
"parse not on or after", ex);
}
}
}
int length = 0;
for (int i = 0; i < length; i++) {
respondWiths = new ArrayList();
}
if (providerId != null) {
+ "(Element): should contain only "
+ "one ProviderID.");
}
}
if (relayState != null) {
+ "(Element): should contain only one "
+ "relayState.");
}
}
try {
this.nameIdentifier =
} catch(SAMLException ex){
+ "(Element): SAMLException while "
+ "nconstructing ameidentifier");
}
throw new FSMsgException("nameIdentifierCreateError",
}
if (sessionIndex != null) {
"FSLogoutNotification(Element): "
+ "should contain only one SessionIndex.");
}
}
} else {
+ "invalid node" + nodeName);
}
}
}
}
if (signsSize == 1) {
signed = true;
} else if (signsSize != 0) {
"FSLogoutNotification(Element): included more than"
+ " one Signature element.");
}
}
//end check for signature
}
/**
* Consturctor creates <code>FSLogoutNotification</code> object.
*
* @param requestId the <code>RequestId</code> attribute.
* @param providerID the <code>ProviderID</code> attribute.
* @param nameId the <code>NameIdentifier</code> object.
* @param relayState the <code>RelayState</code> attribute.
* @throws FSMsgException if there is an error creating
* this object.
*/
throws FSMsgException {
setIssueInstant(new Date());
} else {
"FSLogoutNotification: couldn't generate RequestID.");
}
}
this.relayState = relayState;
this.providerId = providerID;
this.nameIdentifier = nameId;
}
/**
* 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()
*/
}
/**
* Sets the value of <code>RelayState</code> attribute.
*
* @param relayState the value of <code>RelayState</code> attribute.
*/
this.relayState = relayState;
}
/**
* Returns the value of <code>RelayState</code> attribute.
*
* @return the value of <code>RelayState</code> attribute.
*/
public String getRelayState() {
return this.relayState;
}
/**
* Returns a signed <code>XML</code> string.
*
* @return a signed <code>XML</code> string.
*/
public String getSignatureString(){
return signatureString;
}
/**
* 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()
*/
public void setMinorVersion(int version) {
}
/**
* Returns the string representation of this object.
*
* @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.
* @return a string containing the valid <code>XML</code> for this element
* @throws FSMsgException if there is an error creating
* <code>XML</code> string from this object.
*/
throws FSMsgException {
}
/**
* Returns the string representation of this object.
*
* @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 <code>XML</code> for this element
* @throws FSMsgException if there is an error creating
* <code>XML</code> string from this object.
*/
boolean includeHeader) throws FSMsgException {
+ "providerId is null in the request with requestId:"
+ requestID);
}
+ "couldn't generate RequestID.");
}
}
if (includeHeader) {
}
if (includeNS) {
}
if (declareNS) {
} else {
}
}
if (notOnOrAfter == null) {
}
}
}
if((respondWiths != null) &&
while (i.hasNext()) {
}
}
if (signed) {
if (signatureString != null) {
}
}
if (nameIdentifier != null) {
}
}
}
} else {
+ "requestID is null ");
}
}
}
/**
* Returns the string representation of this object.
*
* @return a string containing the valid <code>XML</code> for this element
* @throws FSMsgException if there is an error creating
* <code>XML</code> string from this object.
*/
return toXMLString(true, true);
}
/**
* Constructor create <code>FSLogoutNotification</code> from a
* <code>XML</code> string.
*
* @param xml the <code>XML</code> string.
* @throws FSMsgException if there is an error creating
* this object.
*/
throws FSMsgException {
+ "while parsing input xml string");
}
}
return new FSLogoutNotification(root);
}
/**
* Returns value of <code>ProviderID</code> attribute.
*
* @return value of <code>ProviderID</code> attribute.
* @see #setProviderId(String)
*/
public String getProviderId() {
return providerId;
}
/**
* Sets value of <code>ProviderID</code> attribute.
*
* @param providerID value of <code>ProviderID</code> attribute.
* @see #getProviderId()
*/
this.providerId = providerID;
}
/**
* Returns value of <code>SessionIndex</code> attribute.
*
* @return value of <code>SessionIndex</code> attribute.
* @see #setSessionIndex(String)
*/
public String getSessionIndex() {
return sessionIndex;
}
/**
* Sets value of <code>SessionIndex</code> attribute.
*
* @param sessionIndex value of <code>SessionIndex</code> attribute.
* @see #getSessionIndex
*/
this.sessionIndex = sessionIndex;
}
/**
* Returns the <code>NameIdentifier</code> object.
*
* @return the <code>NameIdentifier</code> object.
* @see #setNameIdentifier(NameIdentifier)
*/
public NameIdentifier getNameIdentifier() {
return nameIdentifier;
}
/**
* Sets the <code>NameIdentifier</code> object.
*
* @param nameId the <code>NameIdentifier</code> object.
* @see #getNameIdentifier
*/
this.nameIdentifier = nameId;
}
/**
* Returns an URL Encoded String.
*
* @return a url encoded query string.
* @throws FSMsgException if there is an error.
*/
+ "providerId is null in the request with requestId:"
+ requestID);
}
"FSLogoutNotification.toURLEncodedQueryString: "
+ "couldn't generate RequestID.");
}
}
if(issueInstant != null){
}
} else {
+ "toURLEncodedQueryString: issueInstant missing");
}
}
}
}
if (nameIdentifier != null) {
}
}
}
}
return urlEncodedAuthnReq.toString();
}
/**
* Returns a Base64 Encoded String.
*
* @return a Base64 Encoded String.
* @throws FSMsgException if there is an error encoding
* the string.
*/
+ "providerId is null in the request with requestId:"
+ requestID);
}
"FSLogoutNotification.toURLEncodedQueryString: "
+ "couldn't generate RequestID.");
}
}
}
/**
* Returns <code>FSLogoutNotification</code> object. The
* object is created by parsing the <code>HttpServletRequest</code>
* object.
*
* @param request the <code>HttpServletRequest</code> object.
* @return <code>FSLogoutNotification</code> object.
* @throws FSMsgException if there is an error
* creating <code>FSAuthnRequest</code> object.
*/
public static FSLogoutNotification parseURLEncodedRequest(
try {
new FSLogoutNotification();
} else {
}
try{
} catch (NumberFormatException ex) {
}
}
try{
} catch (ParseException e){
}
try {
} catch (ParseException pe) {
+ "Request: parsing exception", pe);
}
}
if (providerId != null) {
} else {
}
if (sessionIndex != null) {
}
if (relayState != null) {
}
}
}
return retLogoutNotification;
} catch(Exception e) {
}
}
/**
* 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 mismatchs.
*/
try {
} catch (NumberFormatException e) {
+ "MajorVersion", e);
}
}
+ "MajorVersion of the LogoutRequest is too high.");
}
} else {
+ "MajorVersion of the LogoutRequest 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 FSMsgException when the version mismatchs.
*/
try {
} catch (NumberFormatException e) {
+ "MinorVersion", e);
}
}
+ "MinorVersion of the LogoutRequest is too high.");
+ "MinorVersion of the LogoutRequest is too low.");
}
}
/**
* Unsupported operation.
*/
public void signXML() throws SAMLException {
"unsupportedOperation",null);
}
/**
* Signs the <code>FSLogoutNotification</code> object.
*
* @param certAlias the Certificate Alias
* @throws SAMLException if
* <code>FSFederationTerminationNotification</code>
* cannot be signed.
*/
if (signed) {
+ "the assertion is already signed.");
}
"alreadySigned",null);
}
"cannotFindCertAlias",null);
}
try{
this.id, false);
} else if (minorVersion ==
this.toXMLString(true, true),
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);
}
}