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.
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();
27 private int cacheExpiration;
28 private String cacheDomain;
29 private String cacheType = "COOKIES";
35 public String getSearchResultEmptyText() {
36 return searchResultEmptyText;
39 public void setSearchResultEmptyText(String searchResultEmptyText) {
40 this.searchResultEmptyText = searchResultEmptyText;
43 public String getHelpText() {
47 public void setHelpText(String helpText) {
48 this.helpText = helpText;
51 public String getSupportContact() {
52 return supportContact;
55 public void setSupportContact(String supportContact) {
56 this.supportContact = supportContact;
59 public String getLogoLocation() {
63 public void setLogoLocation(String logoLocation) {
64 this.logoLocation = logoLocation;
68 * Determines if a particular string token should be used for matching when a user searches for origins.
69 * @param str The string to lookup
71 public boolean isIgnoredForMatch(String str) {
73 if (ignoredForMatch.contains(str.toLowerCase())) {
81 * Sets the tokens that should be ignored when a user searches for an origin site.
82 * @param s The ignored tokens are passed as a single string, each separated by whitespace
84 public void addIgnoredForMatch(String s) {
86 ignoredForMatch.add(s.toLowerCase());
89 public String getCacheType() {
93 public void setCacheType(String cache) {
94 if (cache.toUpperCase().equals("NONE")
95 || cache.toUpperCase().equals("SESSION")
96 || cache.toUpperCase().equals("COOKIES")) {
97 this.cacheType = cache.toUpperCase();
99 log.warn("Cache type :" + cache + ": not recognized, using default.");
104 * Returns the cacheDomain.
107 public String getCacheDomain() {
113 * Returns the cacheExpiration.
116 public int getCacheExpiration() {
117 return cacheExpiration;
122 * Sets the cacheDomain.
123 * @param cacheDomain The cacheDomain to set
125 public void setCacheDomain(String cacheDomain) {
126 this.cacheDomain = cacheDomain;
131 * Sets the cacheExpiration.
132 * @param cacheExpiration The cacheExpiration to set
134 public void setCacheExpiration(int cacheExpiration) {
135 this.cacheExpiration = cacheExpiration;