KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > main > CmsHttpAuthenticationSettings


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/main/CmsHttpAuthenticationSettings.java,v $
3  * Date : $Date: 2006/03/27 14:52:27 $
4  * Version: $Revision: 1.7 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.main;
33
34 import org.opencms.workplace.CmsWorkplace;
35
36 /**
37  * Contains the settings to handle HTTP basic authentication.<p>
38  *
39  * These settings control wheter a browser-based popup dialog should be used for
40  * authentication, or of the user should be redirected to an OpenCms URI for a
41  * form-based authentication.<p>
42  *
43  * Since the URI for the form-based authentication is a system wide setting, users
44  * are able to specify different authentication forms in a property "login-form" on
45  * resources that require authentication.<p>
46  *
47  * @author Thomas Weckert
48  *
49  * @version $Revision: 1.7 $
50  *
51  * @since 6.0.0
52  */

53 public class CmsHttpAuthenticationSettings {
54
55     /** The URI of the default authentication form. */
56     public static final String JavaDoc DEFAULT_AUTHENTICATION_URI = CmsWorkplace.VFS_PATH_WORKPLACE
57         + "action/authenticate.html";
58
59     /** The URI of the system wide login form if browser-based HTTP basic authentication is disabled. */
60     private String JavaDoc m_formBasedHttpAuthenticationUri;
61
62     /** Boolean flag to enable or disable browser-based HTTP basic authentication. */
63     private boolean m_useBrowserBasedHttpAuthentication;
64
65     /**
66      * Default constructor.<p>
67      */

68     public CmsHttpAuthenticationSettings() {
69
70         super();
71         m_useBrowserBasedHttpAuthentication = true;
72         m_formBasedHttpAuthenticationUri = null;
73     }
74
75     /**
76      * Returns the URI of the system wide login form if browser-based HTTP basic authentication is disabled.<p>
77      *
78      * @return the URI of the system wide login form if browser-based HTTP basic authentication is disabled
79      */

80     public String JavaDoc getFormBasedHttpAuthenticationUri() {
81
82         return m_formBasedHttpAuthenticationUri;
83     }
84
85     /**
86      * Sets the URI of the system wide login form if browser-based HTTP basic authentication is disabled.<p>
87      *
88      * @param uri the URI of the system wide login form if browser-based HTTP basic authentication is disabled to set
89      */

90     public void setFormBasedHttpAuthenticationUri(String JavaDoc uri) {
91
92         m_formBasedHttpAuthenticationUri = uri;
93     }
94
95     /**
96      * Sets if browser-based HTTP basic authentication is enabled or disabled.<p>
97      *
98      * @param value a boolean value to specifiy if browser-based HTTP basic authentication should be enabled
99      */

100     public void setUseBrowserBasedHttpAuthentication(boolean value) {
101
102         m_useBrowserBasedHttpAuthentication = value;
103     }
104
105     /**
106      * Sets if browser-based HTTP basic authentication is enabled or disabled.<p>
107      *
108      * @param value a string {<code>"true"</code>|<code>"false"</code>} to specify if browser-based HTTP basic authentication should be enabled
109      */

110     public void setUseBrowserBasedHttpAuthentication(String JavaDoc value) {
111
112         m_useBrowserBasedHttpAuthentication = Boolean.valueOf(value).booleanValue();
113     }
114
115     /**
116      * Tests if browser-based HTTP basic authentication is enabled or disabled.<p>
117      *
118      * @return true if browser-based HTTP basic authentication is enabled
119      */

120     public boolean useBrowserBasedHttpAuthentication() {
121
122         return m_useBrowserBasedHttpAuthentication;
123     }
124
125 }
126
Popular Tags