1/*2 * Copyright 2000-2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.webpage;
1819/***20 * Holds the relevant state about a secured site.21 *22 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>23 * @version $Id: SecuredSite.java,v 1.2 2004/02/23 03:46:26 jford Exp $ 24 */25publicclassSecuredSite implements Site26 {
27//28// Site state29//30privatelong id;
31private String url;
32private String name;
33privateint status;
34private String username;
35private String password;
3637/***38 * Construct site object given a url 39 *40 * @param name the name of the site.41 * @param url the url address of the site.42 *43 */44publicSecuredSite(String name, String url)
45 {
46this.id = WebPageHelper.generateId();
47this.name = name;
48this.url = url;
49 }
5051/***52 * get the URL for this site53 *54 * return the string value of the URL55 */56public String getURL()
57 {
58returnthis.url;
59 }
6061/***62 * get the Site ID for this site63 *64 * return the string value of the Site ID65 */66publiclong getID()
67 {
68returnthis.id;
69 }
7071/*** 72 * sets the URL address for this site.73 *74 * @param the URL address of the site.75 */76publicvoid setURL(String url)
77 {
78this.url = url;
79 }
8081/*** 82 * get the common name for this site.83 *84 * return the string value of the site name.85 */86public String getName()
87 {
88return name;
89 }
9091/***92 * sets the common name for this site.93 *94 * @param the name of the site.95 */96publicvoid setName(String name)
97 {
98this.name = name;
99 }
100101/***102 * get the user name used to logon to this site.103 *104 * return the string value of the site user name.105 */106public String getUserName()
107 {
108return username;
109 }
110111/***112 * sets the user name used to logon to this site.113 *114 * @param the string value of the site user name.115 */116publicvoid setUserName(String username)
117 {
118this.username = username;
119 }
120121/***122 * get the password used to logon to this site.123 *124 * return the string value of the site password.125 */126public String getPassword()
127 {
128return password;
129 }
130131/*** 132 * sets the password used to logon to this site.133 *134 * @param the string value of the site password.135 */136publicvoid setPassword(String password)
137 {
138this.password = password;
139 }
140141/***142 * get the availability status of this site.143 *144 * return the int value of the site availability status.145 */146publicint getStatus()
147 {
148return status;
149 }
150151/***152 * sets the availability status of this site.153 *154 * @param the int value of the site availability status.155 */156publicvoid setStatus(int status)
157 {
158this.status = status;
159 }
160161/*162 * Is this site secured.163 *164 * return True if the target is secured.165 */166publicboolean isSecured()
167 {
168returntrue;
169 }
170171 }