1 package edu.internet2.middleware.shibboleth.wayf;
3 import java.util.HashSet;
5 import org.apache.log4j.Logger;
8 * Class used by the WAYF service to determine runtime options
9 * Most of the fields of this class should have reasonable defaults set
10 * @author Walter Hoehn wassa@columbia.edu
13 public class WayfConfig {
15 private static Logger log = Logger.getLogger(WayfConfig.class.getName());
17 private String logoLocation = "images/internet2.gif";
18 private String supportContact = "mailto:shib-support@internet2.org";
19 private String helpText =
20 "In order to fulfill the request for the web resource you "
21 + "have just chosen, information must first be obtained from "
22 + "your home institution. Please select the institution with "
23 + "which you are affiliated.";
24 private String searchResultEmptyText =
25 "No institution found that matches your search " + "criteria, please try again.";
26 private HashSet ignoredForMatch = new HashSet();
28 private String cacheType = "COOKIES";
34 public String getSearchResultEmptyText() {
35 return searchResultEmptyText;
38 public void setSearchResultEmptyText(String searchResultEmptyText) {
39 this.searchResultEmptyText = searchResultEmptyText;
42 public String getHelpText() {
46 public void setHelpText(String helpText) {
47 this.helpText = helpText;
50 public String getSupportContact() {
51 return supportContact;
54 public void setSupportContact(String supportContact) {
55 this.supportContact = supportContact;
58 public String getLogoLocation() {
62 public void setLogoLocation(String logoLocation) {
63 this.logoLocation = logoLocation;
67 * Determines if a particular string token should be used for matching when a user searches for origins.
68 * @param str The string to lookup
70 public boolean isIgnoredForMatch(String str) {
72 if (ignoredForMatch.contains(str.toLowerCase())) {
80 * Sets the tokens that should be ignored when a user searches for an origin site.
81 * @param s The ignored tokens are passed as a single string, each separated by whitespace
83 public void addIgnoredForMatch(String s) {
85 ignoredForMatch.add(s.toLowerCase());
88 public String getCacheType() {
92 public void setCacheType(String cache) {
93 if (cache.toUpperCase().equals("NONE")
94 || cache.toUpperCase().equals("SESSION")
95 || cache.toUpperCase().equals("COOKIES")) {
96 this.cacheType = cache.toUpperCase();
98 log.warn("Cache type :" + cache + ": not recognized, using default.");