View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.orchestra.urlParamNav;
20  
21  import javax.faces.context.ExternalContext;
22  import java.io.IOException;
23  import java.io.InputStream;
24  import java.util.Map;
25  import java.util.Locale;
26  import java.util.Iterator;
27  import java.util.Set;
28  import java.net.URL;
29  import java.net.MalformedURLException;
30  import java.security.Principal;
31  
32  public class ExternalContextWrapper extends ExternalContext
33  {
34  	private final ExternalContext externalContext;
35  
36  	public ExternalContextWrapper(ExternalContext externalContext)
37  	{
38  		this.externalContext = externalContext;
39  	}
40  
41  	public void dispatch(String path)
42  		throws IOException
43  	{
44  		externalContext.dispatch(path);
45  	}
46  
47  	public String encodeActionURL(String url)
48  	{
49  		return externalContext.encodeActionURL(url);
50  	}
51  
52  	public String encodeNamespace(String name)
53  	{
54  		return externalContext.encodeNamespace(name);
55  	}
56  
57  	public String encodeResourceURL(String url)
58  	{
59  		return externalContext.encodeResourceURL(url);
60  	}
61  
62  	public Map getApplicationMap()
63  	{
64  		return externalContext.getApplicationMap();
65  	}
66  
67  	public String getAuthType()
68  	{
69  		return externalContext.getAuthType();
70  	}
71  
72  	public Object getContext()
73  	{
74  		return externalContext.getContext();
75  	}
76  
77  	public String getInitParameter(String name)
78  	{
79  		return externalContext.getInitParameter(name);
80  	}
81  
82  	public Map getInitParameterMap()
83  	{
84  		return externalContext.getInitParameterMap();
85  	}
86  
87  	public String getRemoteUser()
88  	{
89  		return externalContext.getRemoteUser();
90  	}
91  
92  	public Object getRequest()
93  	{
94  		return externalContext.getRequest();
95  	}
96  
97  	public String getRequestContextPath()
98  	{
99  		return externalContext.getRequestContextPath();
100 	}
101 
102 	public Map getRequestCookieMap()
103 	{
104 		return externalContext.getRequestCookieMap();
105 	}
106 
107 	public Map getRequestHeaderMap()
108 	{
109 		return externalContext.getRequestHeaderMap();
110 	}
111 
112 	public Map getRequestHeaderValuesMap()
113 	{
114 		return externalContext.getRequestHeaderValuesMap();
115 	}
116 
117 	public Locale getRequestLocale()
118 	{
119 		return externalContext.getRequestLocale();
120 	}
121 
122 	public Iterator getRequestLocales()
123 	{
124 		return externalContext.getRequestLocales();
125 	}
126 
127 	public Map getRequestMap()
128 	{
129 		return externalContext.getRequestMap();
130 	}
131 
132 	public Map getRequestParameterMap()
133 	{
134 		return externalContext.getRequestParameterMap();
135 	}
136 
137 	public Iterator getRequestParameterNames()
138 	{
139 		return externalContext.getRequestParameterNames();
140 	}
141 
142 	public Map getRequestParameterValuesMap()
143 	{
144 		return externalContext.getRequestParameterValuesMap();
145 	}
146 
147 	public String getRequestPathInfo()
148 	{
149 		return externalContext.getRequestPathInfo();
150 	}
151 
152 	public String getRequestServletPath()
153 	{
154 		return externalContext.getRequestServletPath();
155 	}
156 
157 	public URL getResource(String path)
158 		throws MalformedURLException
159 	{
160 		return externalContext.getResource(path);
161 	}
162 
163 	public InputStream getResourceAsStream(String path)
164 	{
165 		return externalContext.getResourceAsStream(path);
166 	}
167 
168 	public Set getResourcePaths(String path)
169 	{
170 		return externalContext.getResourcePaths(path);
171 	}
172 
173 	public Object getResponse()
174 	{
175 		return externalContext.getResponse();
176 	}
177 
178 	public Object getSession(boolean create)
179 	{
180 		return externalContext.getSession(create);
181 	}
182 
183 	public Map getSessionMap()
184 	{
185 		return externalContext.getSessionMap();
186 	}
187 
188 	public Principal getUserPrincipal()
189 	{
190 		return externalContext.getUserPrincipal();
191 	}
192 
193 	public boolean isUserInRole(String role)
194 	{
195 		return externalContext.isUserInRole(role);
196 	}
197 
198 	public void log(String message)
199 	{
200 		externalContext.log(message);
201 	}
202 
203 	public void log(String message, Throwable exception)
204 	{
205 		externalContext.log(message, exception);
206 	}
207 
208 	public void redirect(String url)
209 		throws IOException
210 	{
211 		externalContext.redirect(url);
212 	}
213 }