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 org.opencfml.cfx;
020
021/**
022 * Alternative Implementation of Jeremy Allaire's Request Interface
023 */
024public interface Request {
025
026        /**
027         * checks if attribute with this key exists
028         * @param key key to check
029         * @return has key or not
030         */
031        public boolean attributeExists(String key);
032        
033        /**
034         * @return if tags has set [debug] attribute
035         */
036        public boolean debug();
037        
038        /**
039         * returns attribute matching key
040         * @param key key to get
041         * @return value to key
042         */
043        public String getAttribute(String key);
044        
045        /**
046         * returns attribute matching key
047         * @param key key to get
048         * @param defaultValue return this value if key not exist
049         * @return value to key
050         */
051        public String getAttribute(String key, String defaultValue);
052        
053        /**
054         * return all sattribute keys
055         * @return all keys
056         */
057        public String[] getAttributeList();
058        
059        /**
060         * returns attribute as int matching key
061         * @param key key to get
062         * @return value to key
063         * @throws NumberFormatException
064         */
065        public int getIntAttribute(String key) throws NumberFormatException;
066        
067        /**
068         * returns attribute as int matching key
069         * @param key key to get
070         * @param defaultValue return this value if key not exist
071         * @return value to key
072         */
073        public int getIntAttribute(String key, int defaultValue);
074        
075        /**
076         * return given query
077         * @return return given query
078         */
079        public Query getQuery();
080
081        /**
082         * returns all the settings
083         * @param key
084         * @return settings
085         */
086        public String getSetting(String key);
087
088}