/*
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at 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 copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
*/
/**
* Ex-Sun class, pulled out from Session.java.
*
* todo: attribution
*/
public class SessionURL {
/**
* ClientSDK: Static initialisation required for non-Guice usage.
*
* @return A singleton SessionURL instance.
* @deprecated Do not use this method as can result in state being initialised before system
* properties are set. Use Guice to get the instance instead.
*/
}
return instance;
}
// Private to enforce singleton.
}
/**
* Returns the encoded URL, rewritten to include the session id. cookie will
* be rewritten in the URL as a query string with entity escaping of
* ampersand before appending session ID if other query parameters exists in
* the URL.
* <p>
*
* @param res HTTP Servlet Response.
* @param url the URL to be encoded.
* @return the encoded URL if cookies are not supported and URL if cookies
* are supported
*/
}
/**
* Returns the encoded URL, rewritten to include the session id. cookie will
* be rewritten in the URL as a query string with entity escaping of
* ampersand before appending session id if other query parameters exists in
* the URL.
* <p>
*
* @param res HTTP Servlet Response.
* @param url the URL to be encoded.
* @param cookieName AM cookie name.
* @param session session to use.
* @return the encoded URL if cookies are not supported and URL if cookies
* are supported
*/
}
/**
* Returns the encoded URL, rewritten to include the session id. Cookie
* will be written to the URL in as a query string.
*
* @param url the URL to be encoded.
* @param escape true if ampersand entity escaping needs to done
* else false. This parameter is valid only when encoding scheme
* is <code>SessionUtils.QUERY</code>.
* @param session session to use.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
}
/**
* Returns the encoded URL, rewritten to include the session id. Cookie
* will be written to the URL in as a query string.
*
* @param url the URL to be encoded
* @param escape true if ampersand entity escaping needs to
* done else false.This parameter is valid only when encoding
* scheme is <code>SessionUtils.QUERY</code>.
* @param cookieName cookie name.
* @param session session to use.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
}
/**
* Returns the encoded URL, rewritten to include the session id in the
* query string with entity escaping
*
* @param url the URL to be encoded
* @param session session to use.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
}
/**
* Returns the encoded URL, rewritten to include the session id in the
* query string with entity escaping
*
* @param url the URL to be encoded.
* @param cookieName the cookie name.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
}
/**
* Returns the encoded URL, rewritten to include the session id.
*
* @param url the URL to be encoded.
* @param encodingScheme the scheme to rewrite the cookie value in URL as
* a Query String or Path Info (Slash or Semicolon separated.
* Allowed values are <code>SessionUtils.QUERY</code>,
* <code>SessionUtils.SLASH</code> and
* <code>SessionUtils.SEMICOLON</code>
* @param escape true if ampersand entity escaping needs to done
* else false. This parameter is valid only when encoding scheme
* is <code>SessionUtils.QUERY</code>.
* @param session session to use.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
}
/**
* Returns the encoded URL, rewritten to include the session id.
*
* @param url the URL to be encoded.
* @param encodingScheme the scheme to rewrite the cookie value in URL as
* a Query String or Path Info (Slash or Semicolon separated. Allowed
* values are <code>SessionUtils.QUERY</code>,
* <code>SessionUtils.SLASH</code> and
* <code>SessionUtils.SEMICOLON</code>.
* @param escape true if ampersand entity escaping needs to done
* else false. This parameter is valid only when encoding scheme
* is <code>SessionUtils.QUERY</code>.
* @param cookieName name of the cookie.
* @param session session to use.
* @return the encoded URL if cookies are not supported or the URL if
* cookies are supported.
*/
public String encodeURL(String url, short encodingScheme, boolean escape, String cookieName, Session session) {
} else { // cookie str not set so call encodeURL
session.setCookieStr(SessionEncodeURL.createCookieString(cookieName, session.getSessionID().toString()));
}
}
}
return encodedURL;
}
}