01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.wicket.settings;
18:
19: import org.apache.wicket.IPageFactory;
20: import org.apache.wicket.session.pagemap.IPageMapEvictionStrategy;
21:
22: /**
23: * Interface for session related settings
24: * <p>
25: * <i>pageFactory </i>- The factory class that is used for constructing page
26: * instances.
27: * <p>
28: * <i>pageMapEvictionStrategy </i>- The strategy for evicting pages from page
29: * maps when they are too full
30: * <p>
31: * <i>maxPageMaps </i>- The maximum number of page maps allowed in a session (to
32: * prevent denial of service attacks)
33: * <p>
34: *
35: * @author Igor Vaynberg (ivaynberg)
36: */
37: public interface ISessionSettings {
38: /**
39: * Gets maximum number of page maps allowed in this session
40: *
41: * @return Maximum number of page maps
42: */
43: int getMaxPageMaps();
44:
45: /**
46: * Gets the factory to be used when creating pages
47: *
48: * @return The default page factory
49: */
50: IPageFactory getPageFactory();
51:
52: /**
53: * Gets the strategy for evicting pages from the page map.
54: *
55: * @return the strategy for evicting pages from the page map
56: */
57: IPageMapEvictionStrategy getPageMapEvictionStrategy();
58:
59: /**
60: * Sets maximum number of page maps allowed in this session
61: *
62: * @param maxPageMaps
63: * Maximum number of page maps
64: */
65: void setMaxPageMaps(int maxPageMaps);
66:
67: /**
68: * Sets the factory to be used when creating pages.
69: *
70: * @param pageFactory
71: * The default factory
72: */
73: void setPageFactory(final IPageFactory pageFactory);
74:
75: /**
76: * Sets the strategy for evicting pages from the page map.
77: *
78: * @param pageMapEvictionStrategy
79: * the strategy for evicting pages from the page map
80: */
81: void setPageMapEvictionStrategy(
82: IPageMapEvictionStrategy pageMapEvictionStrategy);
83:
84: /**
85: * Sets whether the id of a page should be unique across the entire session.
86: * Default is false, which means that a page id is unique per pagemap.
87: *
88: * @param value
89: */
90: void setPageIdUniquePerSession(boolean value);
91:
92: /**
93: * Returns whether the page id is unique per session. If the page id is not
94: * unique per session, it is only unique per pagemap.
95: *
96: * @return
97: */
98: boolean isPageIdUniquePerSession();
99: }
|