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.jetspeed.administration;
18:
19: import org.apache.jetspeed.administration.PortalAuthenticationConfiguration;
20:
21: /**
22: * PasswordCredentialValve
23: *
24: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
25: * @version $Id: $
26: */
27: public class PortalAuthenticationConfigurationImpl implements
28: PortalAuthenticationConfiguration {
29: protected boolean createNewSessionOnLogin = false;
30: protected int maxSessionHardLimit = 0;
31: protected long msMaxSessionHardLimit = 1;
32: protected String timeoutRedirectLocation = "";
33:
34: /**
35: * Portal Authentication Configuration stored and accessed from this bean
36: *
37: * @param createNewSessionOnLogin Should a new session be created upon logging on to the system
38: * @param maxSessionHardLimit The maximum session hard limit, ignores user activity, set to zero to turn off this feature
39: * @param timeoutRedirectLocation Path to redirection upon logging out user on session limit experiation, only used with maxSessionHardLimit
40: */
41: public PortalAuthenticationConfigurationImpl(
42: boolean createNewSessionOnLogin, int maxSessionHardLimit,
43: String timeoutRedirectLocation) {
44: this .createNewSessionOnLogin = createNewSessionOnLogin;
45: this .maxSessionHardLimit = maxSessionHardLimit;
46: this .timeoutRedirectLocation = timeoutRedirectLocation;
47: this .msMaxSessionHardLimit = this .maxSessionHardLimit * 1000;
48: }
49:
50: public boolean isMaxSessionHardLimitEnabled() {
51: return this .maxSessionHardLimit > 0;
52: }
53:
54: public int getMaxSessionHardLimit() {
55: return maxSessionHardLimit;
56: }
57:
58: public void setMaxSessionHardLimit(int maxSessionHardLimit) {
59: this .maxSessionHardLimit = maxSessionHardLimit;
60: }
61:
62: public long getMsMaxSessionHardLimit() {
63: return msMaxSessionHardLimit;
64: }
65:
66: public void setMsMaxSessionHardLimit(long msMaxSessionHardLimit) {
67: this .msMaxSessionHardLimit = msMaxSessionHardLimit;
68: }
69:
70: public String getTimeoutRedirectLocation() {
71: return timeoutRedirectLocation;
72: }
73:
74: public void setTimeoutRedirectLocation(
75: String timeoutRedirectLocation) {
76: this .timeoutRedirectLocation = timeoutRedirectLocation;
77: }
78:
79: public boolean isCreateNewSessionOnLogin() {
80: return createNewSessionOnLogin;
81: }
82:
83: public void setCreateNewSessionOnLogin(
84: boolean createNewSessionOnLogin) {
85: this.createNewSessionOnLogin = createNewSessionOnLogin;
86: }
87:
88: }
|