001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/wmps/capabilities/WMPSOperationsMetadata.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004     This file is part of deegree.
005     Copyright (C) 2001-2008 by:
006     EXSE, Department of Geography, University of Bonn
007     http://www.giub.uni-bonn.de/deegree/
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     Aennchenstr. 19
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.wmps.capabilities;
045    
046    import java.util.ArrayList;
047    import java.util.List;
048    
049    import org.deegree.framework.log.ILogger;
050    import org.deegree.framework.log.LoggerFactory;
051    import org.deegree.ogcwebservices.getcapabilities.Operation;
052    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
053    import org.deegree.owscommon.OWSDomainType;
054    
055    /**
056     * 
057     * Represents the <code>OperationMetadata</code> part in the capabilities document of a WMPS. The
058     * <code>GetCapabilities</code> operation may define the following operation:
059     * <ul>
060     * <li>PrintMap
061     * </ul>
062     * 
063     * @author <a href="mailto:deshmukh@lat-lon.de">Anup Deshmukh</a>
064     * @version 2.0.
065     * 
066     */
067    
068    public class WMPSOperationsMetadata extends OperationsMetadata {
069    
070        private static final long serialVersionUID = -3294700326681151524L;
071    
072        private static final ILogger LOG = LoggerFactory.getLogger( WMPSOperationsMetadata.class );
073    
074        private Operation printMap;
075    
076        /**
077         * Constructs a new <code>WMPSOperationsMetadata</code> instance from the given parameters.
078         * 
079         * @param getCapabilities
080         * @param printMap
081         * @param parameters
082         * @param constraints
083         */
084        public WMPSOperationsMetadata( Operation getCapabilities, Operation printMap,                                  
085                                       OWSDomainType[] parameters,  OWSDomainType[] constraints ) {
086            super( getCapabilities, parameters, constraints );
087            this.printMap = printMap;
088        }
089    
090        /**
091         * Constructs a new <code>WMPSOperationsMetadata</code> instance from the given parameters.
092         * 
093         * @param getCapabilities
094         * @param printMap
095         */
096        public WMPSOperationsMetadata( Operation getCapabilities, Operation printMap ) {
097            super( getCapabilities, null, null );
098            this.printMap = printMap;
099        }
100    
101        /**
102         * Returns all <code>Operations</code> known to the WMPS. Currently only
103         * <ul>
104         * <li>GetCapabilities
105         * <li>PrintMap
106         * </ul>
107         * supported
108         * 
109         * @return Operation[]
110         */
111        @Override
112        public Operation[] getOperations() {
113            
114    
115            LOG.logDebug( "Getting the list of operations known to the WMPS as an array." );
116            List<Operation> list = new ArrayList<Operation>( 10 );
117            list.add( this.getCapabilitiesOperation );
118            if ( this.printMap != null ) {
119                list.add( this.printMap );
120            }
121           
122            Operation[] ops = new Operation[list.size()];
123            
124            return list.toArray( ops );
125        }
126    
127        /**
128         * Returns the print map operation.
129         * 
130         * @return Operation
131         */
132        public Operation getPrintMap() {
133            return this.printMap;
134        }
135    
136        /**
137         * Sets the print map operation
138         * 
139         * @param printMap
140         */
141        public void setPrintMap( Operation printMap ) {
142            this.printMap = printMap;
143        }
144    
145    }