001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wmps/capabilities/WMPSOperationsMetadata.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.ogcwebservices.wmps.capabilities;
037    
038    import java.util.ArrayList;
039    import java.util.List;
040    
041    import org.deegree.framework.log.ILogger;
042    import org.deegree.framework.log.LoggerFactory;
043    import org.deegree.ogcwebservices.getcapabilities.Operation;
044    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
045    import org.deegree.owscommon.OWSDomainType;
046    
047    /**
048     *
049     * Represents the <code>OperationMetadata</code> part in the capabilities document of a WMPS. The
050     * <code>GetCapabilities</code> operation may define the following operation:
051     * <ul>
052     * <li>PrintMap
053     * </ul>
054     *
055     * @author <a href="mailto:deshmukh@lat-lon.de">Anup Deshmukh</a>
056     * @version 2.0.
057     *
058     */
059    
060    public class WMPSOperationsMetadata extends OperationsMetadata {
061    
062        private static final long serialVersionUID = -3294700326681151524L;
063    
064        private static final ILogger LOG = LoggerFactory.getLogger( WMPSOperationsMetadata.class );
065    
066        private Operation printMap;
067    
068        /**
069         * Constructs a new <code>WMPSOperationsMetadata</code> instance from the given parameters.
070         *
071         * @param getCapabilities
072         * @param printMap
073         * @param parameters
074         * @param constraints
075         */
076        public WMPSOperationsMetadata( Operation getCapabilities, Operation printMap,
077                                       OWSDomainType[] parameters,  OWSDomainType[] constraints ) {
078            super( getCapabilities, parameters, constraints );
079            this.printMap = printMap;
080        }
081    
082        /**
083         * Constructs a new <code>WMPSOperationsMetadata</code> instance from the given parameters.
084         *
085         * @param getCapabilities
086         * @param printMap
087         */
088        public WMPSOperationsMetadata( Operation getCapabilities, Operation printMap ) {
089            super( getCapabilities, null, null );
090            this.printMap = printMap;
091        }
092    
093        /**
094         * Returns all <code>Operations</code> known to the WMPS. Currently only
095         * <ul>
096         * <li>GetCapabilities
097         * <li>PrintMap
098         * </ul>
099         * supported
100         *
101         * @return Operation[]
102         */
103        @Override
104        public Operation[] getOperations() {
105    
106    
107            LOG.logDebug( "Getting the list of operations known to the WMPS as an array." );
108            List<Operation> list = new ArrayList<Operation>( 10 );
109            list.add( this.getCapabilitiesOperation );
110            if ( this.printMap != null ) {
111                list.add( this.printMap );
112            }
113    
114            Operation[] ops = new Operation[list.size()];
115    
116            return list.toArray( ops );
117        }
118    
119        /**
120         * Returns the print map operation.
121         *
122         * @return Operation
123         */
124        public Operation getPrintMap() {
125            return this.printMap;
126        }
127    
128        /**
129         * Sets the print map operation
130         *
131         * @param printMap
132         */
133        public void setPrintMap( Operation printMap ) {
134            this.printMap = printMap;
135        }
136    
137    }