Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
Mappings |
|
| 1.0;1 |
1 | /* |
|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 | * contributor license agreements. See the NOTICE file distributed with |
|
4 | * this work for additional information regarding copyright ownership. |
|
5 | * The ASF licenses this file to you under the Apache License, Version 2.0 |
|
6 | * (the "License"); you may not use this file except in compliance with |
|
7 | * the License. You may obtain a copy of the License at |
|
8 | * |
|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
10 | * |
|
11 | * Unless required by applicable law or agreed to in writing, software |
|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 | * See the License for the specific language governing permissions and |
|
15 | * limitations under the License. |
|
16 | */ |
|
17 | ||
18 | package org.apache.shale.remoting; |
|
19 | ||
20 | import java.util.List; |
|
21 | ||
22 | /** |
|
23 | * <p>Configuration object used to manage the {@link Mapping} instances for |
|
24 | * a particular web application.</p> |
|
25 | */ |
|
26 | public interface Mappings { |
|
27 | ||
28 | ||
29 | /** |
|
30 | * <p>Add the specified {@link Mapping} to the set of mappings for which |
|
31 | * remoting services are supplied.</p> |
|
32 | * |
|
33 | * @param mapping The new {@link Mapping} to be added |
|
34 | * |
|
35 | * @exception IllegalStateException if there is an existing {@link Mapping} |
|
36 | * already defined for the specified <code>pattern</code> |
|
37 | * @exception NullPointerException if <code>mapping</code> is <code>null</code> |
|
38 | */ |
|
39 | public void addMapping(Mapping mapping); |
|
40 | ||
41 | ||
42 | /** |
|
43 | * <p>Return the extension that will replace the <code>FacesServlet</code> |
|
44 | * extension pattern, if <code>FacesServlet</code> is extension mapped.</p> |
|
45 | */ |
|
46 | public String getExtension(); |
|
47 | ||
48 | ||
49 | /** |
|
50 | * <p>Return the {@link Mapping}, if any, for the specified matching |
|
51 | * <code>pattern</code>. If there is no such {@link Mapping}, return |
|
52 | * <code>null</code> instead.</p> |
|
53 | * |
|
54 | * @param pattern Matching pattern for which to return a {@link Mapping} |
|
55 | */ |
|
56 | public Mapping getMapping(String pattern); |
|
57 | ||
58 | ||
59 | /** |
|
60 | * <p>Return a <code>List</code> of all the currently defined {@link Mapping}s |
|
61 | * for this application. If there are no currently defined {@link Mapping}s, |
|
62 | * an empty <code>List</code> is returned.</p> |
|
63 | */ |
|
64 | public List getMappings(); |
|
65 | ||
66 | ||
67 | /** |
|
68 | * <p>Return a list of URL patterns that this application has mapped to |
|
69 | * <code>FacesServlet</code>. This information is useful to renderers that |
|
70 | * wish to dynamically calculate URLs that will be guaranteed to trigger |
|
71 | * the JSF request processing lifecycle.</p> |
|
72 | */ |
|
73 | public String[] getPatterns(); |
|
74 | ||
75 | ||
76 | /** |
|
77 | * <p>Remove the specified {@link Mapping} from the set of mappings for which |
|
78 | * remoting services are supplied, if it is currently included.</p> |
|
79 | * |
|
80 | * @param mapping The {@link Mapping} to be removed |
|
81 | * |
|
82 | * @exception NullPointerException if <code>mapping</code> is <code>null</code> |
|
83 | */ |
|
84 | public void removeMapping(Mapping mapping); |
|
85 | ||
86 | ||
87 | /** |
|
88 | * <p>Set the extension that will replace the <code>FacesServlet</code> |
|
89 | * extension pattern, if <code>FacesServlet</code> is extension mapped.</p> |
|
90 | * |
|
91 | * @param extension The new extension |
|
92 | */ |
|
93 | public void setExtension(String extension); |
|
94 | ||
95 | ||
96 | /** |
|
97 | * <p>Set a list of URL patterns that this application has mapped to |
|
98 | * <code>FacesServlet</code>. If no patterns are known, this SHOULD |
|
99 | * be set to a zero-length array, rather than <code>null</code>.</p> |
|
100 | * |
|
101 | * @param patterns The new list of patterns |
|
102 | */ |
|
103 | public void setPatterns(String[] patterns); |
|
104 | ||
105 | ||
106 | } |