2 * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
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 at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * 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 and
14 * limitations under the License.
17 package edu.internet2.middleware.shibboleth.wayf;
19 import java.util.HashSet;
21 import org.apache.log4j.Logger;
24 * Class used by the WAYF service to determine runtime options Most of the fields of this class should have reasonable
27 * @author Walter Hoehn wassa@columbia.edu
30 public class WayfConfig {
32 private static Logger log = Logger.getLogger(WayfConfig.class.getName());
34 private String logoLocation = "images/internet2.gif";
35 private String supportContact = "mailto:shib-support@internet2.org";
36 private String helpText = "In order to fulfill the request for the web resource you "
37 + "have just chosen, information must first be obtained from "
38 + "your home institution. Please select the institution with " + "which you are affiliated.";
39 private String searchResultEmptyText = "No institution found that matches your search "
40 + "criteria, please try again.";
41 private HashSet ignoredForMatch = new HashSet();
42 private int cacheExpiration;
43 private String cacheDomain;
44 private String cacheType = "COOKIES";
51 public String getSearchResultEmptyText() {
53 return searchResultEmptyText;
56 public void setSearchResultEmptyText(String searchResultEmptyText) {
58 this.searchResultEmptyText = searchResultEmptyText;
61 public String getHelpText() {
66 public void setHelpText(String helpText) {
68 this.helpText = helpText;
71 public String getSupportContact() {
73 return supportContact;
76 public void setSupportContact(String supportContact) {
78 this.supportContact = supportContact;
81 public String getLogoLocation() {
86 public void setLogoLocation(String logoLocation) {
88 this.logoLocation = logoLocation;
92 * Determines if a particular string token should be used for matching when a user searches for origins.
95 * The string to lookup
97 public boolean isIgnoredForMatch(String str) {
99 if (ignoredForMatch.contains(str.toLowerCase())) {
107 * Sets the tokens that should be ignored when a user searches for an origin site.
110 * The ignored tokens are passed as a single string, each separated by whitespace
112 public void addIgnoredForMatch(String s) {
114 ignoredForMatch.add(s.toLowerCase());
117 public String getCacheType() {
122 public void setCacheType(String cache) {
124 if (cache.toUpperCase().equals("NONE") || cache.toUpperCase().equals("SESSION")
125 || cache.toUpperCase().equals("COOKIES")) {
126 this.cacheType = cache.toUpperCase();
128 log.warn("Cache type :" + cache + ": not recognized, using default.");
133 * Returns the cacheDomain.
137 public String getCacheDomain() {
143 * Returns the cacheExpiration.
147 public int getCacheExpiration() {
149 return cacheExpiration;
153 * Sets the cacheDomain.
156 * The cacheDomain to set
158 public void setCacheDomain(String cacheDomain) {
160 this.cacheDomain = cacheDomain;
164 * Sets the cacheExpiration.
166 * @param cacheExpiration
167 * The cacheExpiration to set
169 public void setCacheExpiration(int cacheExpiration) {
171 this.cacheExpiration = cacheExpiration;