View Javadoc

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  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 PortalAuthenticationConfiguration
28  {
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(boolean createNewSessionOnLogin, int maxSessionHardLimit, String timeoutRedirectLocation)
42      {
43          this.createNewSessionOnLogin = createNewSessionOnLogin;
44          this.maxSessionHardLimit = maxSessionHardLimit;
45          this.timeoutRedirectLocation = timeoutRedirectLocation;
46          this.msMaxSessionHardLimit = this.maxSessionHardLimit * 1000;
47      }
48  
49      public boolean isMaxSessionHardLimitEnabled()
50      {
51          return this.maxSessionHardLimit > 0;
52      }
53      
54      public int getMaxSessionHardLimit()
55      {
56          return maxSessionHardLimit;
57      }
58  
59      
60      public void setMaxSessionHardLimit(int maxSessionHardLimit)
61      {
62          this.maxSessionHardLimit = maxSessionHardLimit;
63      }
64  
65      
66      public long getMsMaxSessionHardLimit()
67      {
68          return msMaxSessionHardLimit;
69      }
70  
71      
72      public void setMsMaxSessionHardLimit(long msMaxSessionHardLimit)
73      {
74          this.msMaxSessionHardLimit = msMaxSessionHardLimit;
75      }
76  
77      
78      public String getTimeoutRedirectLocation()
79      {
80          return timeoutRedirectLocation;
81      }
82  
83      
84      public void setTimeoutRedirectLocation(String timeoutRedirectLocation)
85      {
86          this.timeoutRedirectLocation = timeoutRedirectLocation;
87      }
88  
89  
90      
91      public boolean isCreateNewSessionOnLogin()
92      {
93          return createNewSessionOnLogin;
94      }
95  
96  
97      
98      public void setCreateNewSessionOnLogin(boolean createNewSessionOnLogin)
99      {
100         this.createNewSessionOnLogin = createNewSessionOnLogin;
101     }
102 
103 }