001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/wass/common/CloseSession.java $
002 /*---------------- FILE HEADER ------------------------------------------
003
004 This file is part of deegree.
005 Copyright (C) 2001-2004 by:
006 EXSE, Department of Geography, University of Bonn
007 http://www.giub.uni-bonn.de/exse/
008 lat/lon GmbH
009 http://www.lat-lon.de
010
011 This library is free software; you can redistribute it and/or
012 modify it under the terms of the GNU Lesser General Public
013 License as published by the Free Software Foundation; either
014 version 2.1 of the License, or (at your option) any later version.
015
016 This library is distributed in the hope that it will be useful,
017 but WITHOUT ANY WARRANTY; without even the implied warranty of
018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 Lesser General Public License for more details.
020
021 You should have received a copy of the GNU Lesser General Public
022 License along with this library; if not, write to the Free Software
023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024
025 Contact:
026
027 Andreas Poth
028 lat/lon GmbH
029 Meckenheimer Allee 176
030 53115 Bonn
031 Germany
032 E-Mail: poth@lat-lon.de
033
034 Prof. Dr. Klaus Greve
035 Department of Geography
036 University of Bonn
037 Meckenheimer Allee 166
038 53115 Bonn
039 Germany
040 E-Mail: greve@giub.uni-bonn.de
041
042 ---------------------------------------------------------------------------*/
043
044 package org.deegree.ogcwebservices.wass.common;
045
046 import java.util.Map;
047
048 import org.deegree.framework.log.ILogger;
049 import org.deegree.framework.log.LoggerFactory;
050 import org.deegree.framework.xml.XMLParsingException;
051 import org.deegree.ogcwebservices.OGCWebServiceException;
052 import org.deegree.ogcwebservices.OGCWebServiceRequest;
053 import org.w3c.dom.Element;
054
055 /**
056 * Encapsulated data: CloseSession element
057 *
058 * Namespace: http://www.gdi-nrw.de/session
059 *
060 * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
061 * @author last edited by: $Author: bezema $
062 *
063 * @version 2.0, $Revision: 6259 $, $Date: 2007-03-20 10:15:15 +0100 (Di, 20 Mär 2007) $
064 *
065 * @since 2.0
066 */
067
068 public class CloseSession extends AbstractRequest {
069
070 private static final long serialVersionUID = 1447551772226950443L;
071
072 /**
073 * The logger enhances the quality and simplicity of Debugging within the deegree2 framework
074 */
075 private static final ILogger LOG = LoggerFactory.getLogger( CloseSession.class );
076
077 private String sessionID = null;
078
079 /**
080 * Constructs new one from the given values.
081 *
082 * @param id the request id
083 * @param service
084 * @param version
085 * @param sessionID
086 */
087 public CloseSession( String id, String service, String version, String sessionID ) {
088 super( id, version, service, "CloseSession" );
089 this.sessionID = sessionID;
090 }
091
092 /**
093 * Constructs new one from the given key-value-pairs.
094 * @param id the request id
095 * @param kvp
096 * the map
097 */
098 public CloseSession( String id, Map<String, String> kvp ) {
099 super( id, kvp );
100 sessionID = kvp.get( "SESSIONID" );
101 }
102
103 /**
104 * @return Returns the sessionID.
105 */
106 public String getSessionID() {
107 return sessionID;
108 }
109
110 /**
111 * @param id
112 * @param documentElement
113 * @return a new instance of this class
114 * @throws OGCWebServiceException
115 */
116 public static OGCWebServiceRequest create( String id, Element documentElement ) throws OGCWebServiceException {
117 try {
118 return new SessionOperationsDocument( ).parseCloseSession( id, documentElement );
119 } catch ( XMLParsingException e ) {
120 LOG.logError( e.getMessage(), e );
121 throw new OGCWebServiceException( e.getMessage() );
122 }
123 }
124
125 /**
126 * @param id
127 * @param kvp
128 * @return a new instance of this class
129 */
130 public static OGCWebServiceRequest create( String id, Map<String, String> kvp ) {
131 return new CloseSession( id, kvp );
132 }
133
134 }
135
136 /***************************************************************************************************
137 * Changes to this class. What the people have been up to:
138 * $Log$
139 * Revision 1.8 2006/08/09 14:07:50 poth
140 * footer corrected
141 *
142 * Revision 1.7 2006/06/26 15:02:58 bezema
143 * Finished the wass
144 *
145 * Revision 1.6 2006/06/23 10:23:50 schmitz
146 * Completed the WAS, GetSession and CloseSession work.
147 *
148 * Revision 1.5 2006/06/19 15:34:04 bezema
149 * changed wass to handle things the right way
150 *
151 * Revision 1.4 2006/06/19 12:47:26 schmitz
152 * Updated the documentation, fixed the warnings and implemented logging everywhere.
153 * Changes to
154 * this class. What the people have been up to: Revision 1.3 2006/06/13 15:16:18 bezema Changes to
155 * this class. What the people have been up to: DoService Test seems to work Changes to this class.
156 * What the people have been up to: Revision
157 * 1.2 2006/05/30 11:44:51 schmitz Updated
158 * the documentation, fixed some warnings.
159 * Revision 1.1 2006/05/29 12:00:58 bezema Refactored the security and authentication webservices
160 * into one package WASS (Web Authentication -and- Security Services), also created a common package
161 * and a saml package which could be updated to work in the future.
162 *
163 * Revision 1.4 2006/05/26 14:38:32 schmitz Added some KVP constructors to WAS operations. Added
164 * some comments, updated the plan. Restructured WAS operations by adding an AbstractRequest base
165 * class.
166 *
167 * Revision 1.3 2006/05/22 15:48:12 schmitz Added some rudimentary Handler classes.
168 *
169 * Revision 1.2 2006/05/19 15:35:35 schmitz Updated the documentation, added the GetCapabilities
170 * operation and implemented a rough WAService outline. Fixed some warnings.
171 *
172 * Revision 1.1 2006/05/16 14:45:07 bezema getsession and close session can now be parses
173 *
174 *
175 **************************************************************************************************/