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 lucee.runtime;
020
021import lucee.commons.io.res.Resource;
022import lucee.runtime.config.Config;
023import lucee.runtime.dump.Dumpable;
024
025
026/**
027 * interface of the mapping definition
028 */
029public interface Mapping  extends Dumpable{
030
031    /**
032     * @return returns the archiveClassLoader
033     */
034    public abstract ClassLoader getClassLoaderForArchive();
035
036    /**
037     * @return Returns the physical.
038     */
039    public abstract Resource getPhysical();
040
041    /**
042     * @return Returns the virtual lower case.
043     */
044    public abstract String getVirtualLowerCase();
045
046    /**
047     * @return Returns the virtual lower case with slash at the end.
048     */
049    public abstract String getVirtualLowerCaseWithSlash();
050
051    /**
052     * @return return the archive file
053     */
054    public abstract Resource getArchive();
055
056    /**
057     * @return returns if mapping has a archive
058     */
059    public abstract boolean hasArchive();
060
061    /**
062     * @return return if mapping has a physical path
063     */
064    public abstract boolean hasPhysical();
065
066    /**
067     * @return class root directory
068     */
069    public abstract Resource getClassRootDirectory();
070
071    /**
072     * pagesoucre matching given relpath
073     * @param relPath
074     * @return matching pagesource
075     */
076    public abstract PageSource getPageSource(String relPath);
077    
078    
079    /**
080     * @param path
081     * @param isOut
082     * @return matching pagesoucre
083     */
084    public abstract PageSource getPageSource(String path, boolean isOut);
085
086    /**
087     * checks the mapping
088     */
089    public abstract void check();
090
091    /**
092     * @return Returns the hidden.
093     */
094    public abstract boolean isHidden();
095
096    /**
097     * @return Returns the physicalFirst.
098     */
099    public abstract boolean isPhysicalFirst();
100
101    /**
102     * @return Returns the readonly.
103     */
104    public abstract boolean isReadonly();
105
106    /**
107     * @return Returns the strArchive.
108     */
109    public abstract String getStrArchive();
110
111    /**
112     * @return Returns the strPhysical.
113     */
114    public abstract String getStrPhysical();
115
116    /**
117     * @return Returns the trusted.
118     */
119    public abstract boolean isTrusted(); // FUTURE mark as deprecated; use instead <code>public short getInspectTemplate();</code>
120    // FUTURE public short getInspectTemplate();
121
122    public abstract boolean isTopLevel();
123
124    /**
125     * @return Returns the virtual.
126     */
127    public abstract String getVirtual();
128    
129
130    /**
131     * returns config of the mapping
132     * @return config
133     */
134    public Config getConfig();
135}