Origins listed in alphabetical order. Corrected noCache check.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 6 Mar 2003 20:22:51 +0000 (20:22 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 6 Mar 2003 20:22:51 +0000 (20:22 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@545 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/wayf/Origin.java
src/edu/internet2/middleware/shibboleth/wayf/OriginSet.java
src/edu/internet2/middleware/shibboleth/wayf/WayfService.java

index 588d684..af4bb91 100755 (executable)
@@ -64,7 +64,7 @@ import org.apache.log4j.Logger;
  * @author Walter Hoehn wassa&#064;columbia.edu
  */
 
-public class Origin {
+public class Origin implements Comparable {
 
        private static Logger log = Logger.getLogger(Origin.class.getName());
     private String name = "";
@@ -161,4 +161,11 @@ public class Origin {
         return false;
     }
 
+       /**
+        * @see java.lang.Comparable#compareTo(java.lang.Object)
+        */
+       public int compareTo(Object o) {
+                       return name.compareTo(((Origin)o).getDisplayName().toLowerCase());
+       }
+
 }
\ No newline at end of file
index 10052ba..2c973fe 100755 (executable)
@@ -49,6 +49,7 @@
 
 package edu.internet2.middleware.shibboleth.wayf;
 
+import java.util.Arrays;
 import java.util.HashSet;
 
 import org.apache.log4j.Logger;
@@ -77,7 +78,10 @@ public class OriginSet {
        }
 
        public Origin[] getOrigins() {
-               return (Origin[]) origins.toArray(new Origin[0]);
+
+               Origin[] result = (Origin[]) origins.toArray(new Origin[0]);
+               Arrays.sort(result);
+               return result;
        }
 
        public void addOrigin(Origin origin) {
index ef2c4c7..08ec7d2 100755 (executable)
@@ -252,7 +252,8 @@ public class WayfService extends HttpServlet {
                if (handleService == null) {
                        handleLookup(req, res);
                } else {
-                       if (req.getParameter("noCache") != null && !(req.getParameter("noCache").equalsIgnoreCase("TRUE"))) {
+                       if ((req.getParameter("noCache") == null)
+                               || !(req.getParameter("noCache").equalsIgnoreCase("TRUE"))) {
                                WayfCacheFactory.getInstance(config.getCacheType(), wOptions).addHsToCache(handleService, req, res);
                        }
                        forwardToHS(req, res, handleService);