/**
* 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: FSNameRegistrationRequest.java,v 1.4 2008/06/25 05:46:44 qcheng Exp $
* Portions Copyrighted 2014 ForgeRock AS
*/
/**
* This class contains methods to create <code>NameRegistrationRequest</code>
* object.
*
* @supported.all.api
* @deprecated since 12.0.0
*/
/**
* Default Constructor.
*/
public FSNameRegistrationRequest() {
setIssueInstant(new Date());
}
/**
* 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()
*/
}
/**
* Returns the value of <code>RelayState</code> attribute.
*
* @return the value of <code>RelayState</code> attribute.
* @see #setRelayState(String)
*/
return relayState;
}
/**
* Set the value of <code>RelayState</code> attribute.
*
* @param relayState the value of <code>RelayState</code> attribute.
* @see #getRelayState()
*/
this.relayState = relayState;
}
/**
* Returns the signed <code>XML</code> string.
*
* @return the signed <code>XML</code> string.
*/
return signatureString;
}
/**
* Constructor creates the <code>FSNameRegistrationRequest</code>
* object.
*
* @param requestId the value of <code>RequestID</code> attribute.
* @param respondWiths the value of <code>RespondWiths</code> attribute.
* @param providerId the value of <code>ProviderID</code> attribute.
* @param spProvidedNameIdentifier the Service Provider
* <code>NameIdentifier</code>.
* @param idpProvidedNameIdentifier the Identity Provider
* <code>NameIdentifier</code>.
* @param oldProvidedNameIdentifier the Original Provider
* <code>NameIdentifier</code>.
* @param relayState the value of <code>RelayState</code> attribute.
* @throws FSMsgException if there is an error creating this object.
*/
public FSNameRegistrationRequest(
int length = 0;
setIssueInstant(new Date());
if ((respondWiths != null) &&
for (int i = 0; i < length; i++) {
+ "wrong input for RespondWith");
}
}
}
this.respondWiths = respondWiths;
}
} else {
// random generate one
+ "couldn't generate RequestID.");
}
}
this.providerId=providerId;
this.relayState = relayState;
}
/**
* Constructor creates <code>FSNameRegistrationRequest</code>> object
* from a Document Element.
*
* @param root the Document Element.
* @throws FSMsgException if there is an error creating
* this object.
*/
"FSNameRegistrationRequest(Element): null input.");
}
"FSNameRegistrationRequest(Element): wrong input");
}
// Attribute IssueInstant
"missing IssueInstant");
} else {
try {
} catch (ParseException e) {
"FSNameRegistrationRequest(Element): " +
"could not parse IssueInstant" , e);
}
}
int length = 0;
for (int i = 0; i < length; i++) {
respondWiths = new ArrayList();
}
if (providerId != null) {
"FSNameRegistrationRequest(Element): "
+ "should contain only one ProviderID.");
}
}
}else {
"FSNameRegistrationRequest(Element): "
+ "invalid node" + nodeName);
}
}
}
}
if (signsSize == 1) {
signed = true;
} else if (signsSize != 0) {
"included more than one Signature element.");
}
//end check for signature
}
/**
* 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()
*/
}
throws FSMsgException {
"while parsing input xml string");
}
return new FSNameRegistrationRequest(root);
}
/**
* Returns a String representation of the Logout Response.
*
* @return a string containing the valid XML for this element
* @throws FSMsgException if there is an error converting
* this object ot a string.
*/
return toXMLString(true, true);
}
/**
* Returns a String representation of the Logout Response.
*
* @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 XML for this element
* @throws FSMsgException if there is an error converting
* this object ot a string.
*/
throws FSMsgException {
}
/**
* Returns a String representation of the Logout Response.
*
* @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 {
+ "providerId is null in the request with requestId:"
+ requestID);
}
+ "couldn't generate RequestID.");
}
}
if (includeHeader) {
}
if (includeNS) {
}
if (declareNS) {
} else {
}
}
append("RegisterNameIdentifierRequest").
}
append(">");
if((respondWiths != null) &&
while (i.hasNext()) {
append("RespondWith>");
}
}
if (signed) {
if (signatureString != null) {
}
}
if(idpProvidedNameIdentifier != null &&
}
if(spProvidedNameIdentifier != null &&
}
if(oldProvidedNameIdentifier != null &&
}
if(relayState != null) {
}
append("RegisterNameIdentifierRequest>");
} else {
"requestID is null ");
}
}
/**
* Returns the Identity Provider's <code>NameIdentifier</code>.
*
* @return the Identity Provider's <code>NameIdentifier</code>.
*/
return idpProvidedNameIdentifier;
}
/**
* Returns the original <code>NameIdentifier</code>.
*
* @return the original <code>NameIdentifier</code>.
*/
return oldProvidedNameIdentifier;
}
/**
* Returns the value of <code>ProviderID</code> attribute.
*
* @return the value of <code>ProviderID</code> attribute.
* @see #setProviderId(String).
*/
return this.providerId;
}
/**
* Sets the Identity Provider's <code>NameIdentifier</code>.
*
* @param nameIdentifier the Identity Provider's
* <code>NameIdentifier</code>.
* @see #getIDPProvidedNameIdentifier
*/
public void setIDPProvidedNameIdentifier(
}
/**
* Sets the original <code>NameIdentifier</code>.
*
* @param nameIdentifier the original provider's
* <code>NameIdentifier</code>.
* @see #getOldProvidedNameIdentifier
*/
public void setOldProvidedNameIdentifier(
}
/**
* Sets the Service Provider's <code>NameIdentifier</code>.
*
* @param nameIdentifier the Identity Provider's
* <code>NameIdentifier</code>.
* @see #getSPProvidedNameIdentifier
*/
public void setSPProvidedNameIdentifier(
}
/**
* Sets the value of <code>ProviderID</code> attribute.
*
* @param providerId the value of <code>ProviderID</code> attribute.
*/
this.providerId = providerId;
}
/**
* Returns the <code>NameIdentifier</code> provided by
* the Service Provider.
*
* @return the <code>NameIdentifier</code> provided by
* the Service Provider.
* @see #setSPProvidedNameIdentifier(SPProvidedNameIdentifier)
*/
return spProvidedNameIdentifier;
}
/**
* Returns a Base64 Encoded String.
*
* @return a Base64 Encoded String.
* @throws FSMsgException if there is an error encoding the string.
*/
"FSNameRegistrationRequest.toBASE64EncodedString: "
+ "providerId is null in the request with requestId:"
+ requestID);
}
"FSNameRegistrationRequest.toBASE64EncodedString: "
+ "couldn't generate RequestID.");
}
}
}
/**
* Sets the <code>MajorVersion</code> by parsing the version string.
*
* @param majorVer a String representing the <code>MajorVersion</code> to
* be set.
* @throws FSMsgException on error.
*/
try {
} catch (NumberFormatException e) {
+ "invalid MajorVersion", e);
}
}
+ "MajorVersion of the RegisterNameIdentifierRequest"
+ "is too high.");
}
} else {
+ "MajorVersion of the RegisterNameIdentifierRequest"
+ "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) {
"FSNameRegis(Element): "
+ "invalid MinorVersion", e);
}
}
+ " the Response is too high.");
+ " the Response is too low.");
}
}
public void signXML() {
}
/**
* Signs the <code>FSNameRegistrationRequest</code> object.
*
* @param certAlias the Certificate Alias.
* @throws SAMLException if this object cannot be signed.
*/
if (signed) {
+ "the assertion is already signed.");
}
"alreadySigned",null);
}
"cannotFindCertAlias",null);
}
try{
this.toXMLString(true, true),
this.id, false);
} else if (minorVersion ==
this.toXMLString(true, true),
this.getRequestID(), false);
} else {
}
}
signed = true;
xmlString = this.toXMLString(true, true);
} catch(Exception e){
throw new SAMLResponderException(
}
}
/**
* Sets the Signature.
*
* @param elem the Document Element.
* @return true if success otherwise false.
*/
return super.setSignature(elem);
}
/**
* Returns an URL Encoded String.
*
* @return a url 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(spProvidedNameIdentifier != null) {
}
}
}
}
if (oldProvidedNameIdentifier != null) {
}
}
}
}
if (idpProvidedNameIdentifier != null) {
}
}
}
}
return urlEncodedAuthnReq.toString();
}
/**
* Returns <code>FSNameRegistrationRequest</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 this object.
* @throws SAMLException if there is an error.
*/
new FSNameRegistrationRequest();
try {
} catch(NumberFormatException ex){
"Request: Invalid versions", ex);
}
} else {
"Request: RequestID not found");
}
if(instantString == null ||
"Request: IssueInstant not found");
}
try{
"calling : DateUtils.stringToDate.issueInstant");
} catch (ParseException e){
"Request: Can not parse IssueInstant", e);
}
} else {
"Request: Can not find ProviderID");
}
}
}
}
spNameFormat));
}
}
}
}
}
}
}
}
}
}
return retNameRegistrationRequest;
}
}