001    // $HeadURL:
002    // /cvsroot/deegree/src/org/deegree/ogcwebservices/wms/protocol/WMPSProtocolFactory.java,v
003    // 1.7 2004/07/12 06:12:11 ap Exp $
004    /*----------------------------------------------------------------------------
005     This file is part of deegree, http://deegree.org/
006     Copyright (C) 2001-2009 by:
007       Department of Geography, University of Bonn
008     and
009       lat/lon GmbH
010    
011     This library is free software; you can redistribute it and/or modify it under
012     the terms of the GNU Lesser General Public License as published by the Free
013     Software Foundation; either version 2.1 of the License, or (at your option)
014     any later version.
015     This library is distributed in the hope that it will be useful, but WITHOUT
016     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
017     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
018     details.
019     You should have received a copy of the GNU Lesser General Public License
020     along with this library; if not, write to the Free Software Foundation, Inc.,
021     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
022    
023     Contact information:
024    
025     lat/lon GmbH
026     Aennchenstr. 19, 53177 Bonn
027     Germany
028     http://lat-lon.de/
029    
030     Department of Geography, University of Bonn
031     Prof. Dr. Klaus Greve
032     Postfach 1147, 53001 Bonn
033     Germany
034     http://www.geographie.uni-bonn.de/deegree/
035    
036     e-mail: info@deegree.org
037    ----------------------------------------------------------------------------*/
038    package org.deegree.ogcwebservices.wmps.operation;
039    
040    import org.deegree.ogcwebservices.OGCWebServiceException;
041    import org.deegree.ogcwebservices.OGCWebServiceRequest;
042    import org.deegree.ogcwebservices.wmps.capabilities.WMPSCapabilities;
043    
044    /**
045     * Factory that builds the different types of WMPS-Requests & Responses.
046     *
047     * @author <a href="mailto:deshmukh@lat-lon.de">Anup Deshmukh </a>
048     *
049     * @version 2.0
050     */
051    public class WMPSProtocolFactory {
052    
053        /**
054         * creates an instance of a <tt>WMPSGetCapabilitiesResult</tt> object
055         *
056         * @param request
057         *            request that lead to the response
058         * @param exception
059         *            exception if one occuered
060         * @param capabilities
061         *            WMS capabilities
062         *
063         * @return <tt>WMPSGetCapabilitiesResult</tt>
064         */
065        public static WMPSGetCapabilitiesResult createGetCapabilitiesResult( OGCWebServiceRequest request,
066                                                                             OGCWebServiceException exception,
067                                                                             WMPSCapabilities capabilities ) {
068    
069            WMPSGetCapabilitiesResult res = null;
070            if ( exception == null ) {
071                res = new WMPSGetCapabilitiesResult( request, capabilities );
072            } else {
073                res = new WMPSGetCapabilitiesResult( request, exception );
074            }
075    
076            return res;
077        }
078    
079    }