SessionRequest.java revision 24ea8b0bf00ce7b51c10c2ba4108ad9b02c49e3f
4134N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4134N/A * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved 4134N/A * The contents of this file are subject to the terms 4134N/A * of the Common Development and Distribution License 4134N/A * (the License). You may not use this file except in 4134N/A * compliance with the License. 4134N/A * You can obtain a copy of the License at 4134N/A * See the License for the specific language governing 4134N/A * permission and limitations under the License. 4134N/A * When distributing Covered Code, include this CDDL 4134N/A * Header Notice in each file and include the License file 4134N/A * If applicable, add the following below the CDDL Header, 4134N/A * with the fields enclosed by brackets [] replaced by 4134N/A * your own identifying information: 4134N/A * "Portions Copyrighted [year] [name of copyright owner]" 4134N/A * Portions Copyrighted [2011] [ForgeRock AS] 4138N/A * This <code>SessionRequest</code> class represents a 4134N/A * <code>SessionRequest</code> XML document. The <code>SessionRequest</code> 4138N/A * DTD is defined as the following: 4134N/A * <?xml version="1.0"> 4134N/A * < !DOCTYPE SessionRequest [ 4134N/A * < !ELEMENT SessionRequest (GetSession | 4134N/A * AddSessionListenerOnAllSessions | 4134N/A * < !ATTLIST SessionRequest 4134N/A * reqid CDATA #REQUIRED> 4134N/A * < !-- This attribute carries the requester identity info --> 4134N/A * requester CDATA #IMPLIED> 4134N/A * < !ELEMENT GetSession (SessionID)> 4134N/A * < !-- This attribute indicates whether resets * the latest access time --> * reset CDATA #REQUIRED> * < !ELEMENT GetValidSessions (SessionID Pattern?)> * < !ELEMENT DestroySession (SessionID, DestroySessionID)> * < !ELEMENT Logout (SessionID)> * < !ELEMENT AddSessionListener (SessionID, URL)> * < !ELEMENT AddSessionListenerOnAllSessions (SessionID, URL)> * < !ELEMENT SetProperty (SessionID, Property)> * value CDATA #REQUIRED> * < !ELEMENT SessionID (#PCDATA)> * < !ELEMENT DestroySessionID (#PCDATA)> * < !ELEMENT URL (#PCDATA)> * < !ELEMENT GetSessionCount (SessionID, UUID)> * < !ELEMENT UUID (#PCDATA)> * < !ELEMENT Pattern (#PCDATA)> public static final int Logout =
3;
static final char QUOTE =
'\"';
static final char NL =
'\n';
* This constructor shall only be used at the client side to construct a * <code>SessionRequest</code> object. * @param method The method ID of the <code>SessionRequest</code>. * @param sid The session ID required by the <code>SessionRequest</code>. * @param reset The flag to indicate whether this request needs to update * the latest session access time. * This constructor is used by <code>SessionRequestParser</code> * to reconstruct a <code>SessionRequest</code> object. * This method is used primarily at the server side to reconstruct a * <code>SessionRequest</code> object based on the XML document received * from client. The DTD of this XML document is described above. * @param xml The <code>SessionRequest</code> XML document String. * @return <code>SessionRequest</code> object. * Sets the request version. * @param version Request version. * Returns the request version. * @return The request version. * Returns the request ID. * @return The request ID. * Returns the session ID. * @param requester Session requester. * @return id Session requester. * @param reset <code>true</code> to update the latest session access time. * Returns the reset flag. * @return The reset flag. * Sets the ID of the session to be destroyed. * @param id The ID of the session to be destroyed. * Returns the ID of the session to be destroyed. * @return The ID of the session to be destroyed. * Sets the notification URL. * @param url The notification URL. * Returns the notification URL. * @return The notification URL. * Sets the property name. * @param name The property name. * Returns the property name. * @return The property name. * Sets the property value. * @param value The property value. * Returns the property value. * @return The property value. * Sets the pattern value. Process escape chars in pattern with * @param value The pattern value. * Returns the pattern value. * @return The pattern value. * Sets the universal unique identifier. * @param id The universal unique identifier. * Returns the universal unique identifier * @return The universal unique identifier * Replacing illegal XML char with entity ref * Replacing entity ref with original char * This method translates the request to an XML document String based on the * <code>SessionRequest</code> DTD described above. The ID of the session * to be destroyed has to be set for method <code>DestroySession</code>. * The notification URL has to be set for both methods * <code>AddSessionListener</code> and * <code>AddSessionListenerOnAllSessions</code>. otherwise, the returns * @return An XML String representing the request.