    001    //$HeadURL$
    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
    037    package org.deegree.portal.owswatch.configs;
    038
    039    import java.io.Serializable;
    040
    041    /**
    042     * A class that holds the information of the configurations file of owsWatch
    043     *
    044     * @author <a href="mailto:elmasry@lat-lon.de">Moataz Elmasry</a>
    045     * @author last edited by: $Author: elmasry $
    046     *
    047     * @version $Revision: 1.1 $, $Date: 2008-03-07 14:49:52 $
    048     */
    049    public class OwsWatchConfig implements Serializable {
    050
    051        /**
    052         *
    053         */
    054        private static final long serialVersionUID = 381765455357247965L;
    055
    056        private GeneralConfig general = null;
    057
    058        private ServiceDescription serviceConfig = null;
    059
    060        /**
    061         * @param general
    062         * @param serviceConfig
    063         */
    064        public OwsWatchConfig( GeneralConfig general, ServiceDescription serviceConfig ) {
    065            this.general = general;
    066            this.serviceConfig = serviceConfig;
    067        }
    068
    069        /**
    070         * @return GeneralConfig
    071         */
    072        public GeneralConfig getGeneral() {
    073            return general;
    074        }
    075
    076        /**
    077         * @param general
    078         */
    079        public void setGeneral( GeneralConfig general ) {
    080            this.general = general;
    081        }
    082
    083        /**
    084         * @return ServiceDescription
    085         */
    086        public ServiceDescription getServiceConfig() {
    087            return serviceConfig;
    088        }
    089
    090        /**
    091         * @param serviceConfig
    092         */
    093        public void setServiceConfig( ServiceDescription serviceConfig ) {
    094            this.serviceConfig = serviceConfig;
    095        }
    096
    097        /**
    098         * checks the userName and password of the administrator
    099         *
    100         * @param username
    101         * @param pwd
    102         * @return boolean whether this user is logged in or not
    103         */
    104        public boolean isAuthenticatedUser( String username, String pwd ) {
    105
    106            User user = getGeneral().getUsers().get( username );
    107            return user != null && user.getPassword().equals( pwd );
    108        }
    109    }