001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package com.allaire.cfx;
020
021
022
023/**
024 * Alternative Implementation of Jeremy Allaire's Request Interface
025 */
026public interface Request {
027
028        /**
029         * checks if attribute with this key exists
030         * @param key key to check
031         * @return has key or not
032         */
033        public boolean attributeExists(String key);
034        
035        /**
036         * @return if tags has set [debug] attribute
037         */
038        public boolean debug();
039        
040        /**
041         * returns attribute matching key
042         * @param key key to get
043         * @return value to key
044         */
045        public String getAttribute(String key);
046        
047        /**
048         * returns attribute matching key
049         * @param key key to get
050         * @param defaultValue return this value if key not exist
051         * @return value to key
052         */
053        public String getAttribute(String key, String defaultValue);
054        
055        /**
056         * return all sattribute keys
057         * @return all keys
058         */
059        public String[] getAttributeList();
060        
061        /**
062         * returns attribute as int matching key
063         * @param key key to get
064         * @return value to key
065         * @throws NumberFormatException
066         */
067        public int getIntAttribute(String key) throws NumberFormatException;
068        
069        /**
070         * returns attribute as int matching key
071         * @param key key to get
072         * @param defaultValue return this value if key not exist
073         * @return value to key
074         */
075        public int getIntAttribute(String key, int defaultValue);
076        
077        /**
078         * return given query
079         * @return return given query
080         */
081        public Query getQuery();
082
083        /**
084         * returns all the settings
085         * @param key
086         * @return settings
087         */
088        public String getSetting(String key);
089
090}