+

Add memcache ticketRegistry service

Benjamin Renard [2014-12-29 18:06:35]
Add memcache ticketRegistry service
Filename
config.properties
custom/webpages/WEB-INF/cas.properties
custom/webpages/WEB-INF/lib/cas-server-integration-memcached-3.4.7.jar
custom/webpages/WEB-INF/lib/memcached-2.3.1.jar
custom/webpages/WEB-INF/lib/spy-2.4.jar
custom/webpages/WEB-INF/spring-configuration/ticketRegistry.xml
diff --git a/config.properties b/config.properties
index 99567c6..d08783b 100644
--- a/config.properties
+++ b/config.properties
@@ -30,3 +30,8 @@ views=default
 cas.authHandlers=fileHandler


+# Memcache Server
+memcache.server=127.0.0.1
+memcache.port=11211
+memcache.TGT.timeout=21600
+memcache.ST.timeout=300
diff --git a/custom/webpages/WEB-INF/cas.properties b/custom/webpages/WEB-INF/cas.properties
index 37bbbdf..44bcadd 100644
--- a/custom/webpages/WEB-INF/cas.properties
+++ b/custom/webpages/WEB-INF/cas.properties
@@ -36,3 +36,8 @@ passfile.location=@passfile.location@
 #CAS URI (empty for /)
 cas.uri=@cas.uri@

+# Memcache Configuration
+memcache.server=@memcache.server@
+memcache.port=@memcache.port@
+memcache.TGT.timeout=@memcache.TGT.timeout@
+memcache.ST.timeout=@memcache.ST.timeout@
diff --git a/custom/webpages/WEB-INF/lib/cas-server-integration-memcached-3.4.7.jar b/custom/webpages/WEB-INF/lib/cas-server-integration-memcached-3.4.7.jar
new file mode 100644
index 0000000..2617e6c
Binary files /dev/null and b/custom/webpages/WEB-INF/lib/cas-server-integration-memcached-3.4.7.jar differ
diff --git a/custom/webpages/WEB-INF/lib/memcached-2.3.1.jar b/custom/webpages/WEB-INF/lib/memcached-2.3.1.jar
new file mode 100644
index 0000000..5caa1a7
Binary files /dev/null and b/custom/webpages/WEB-INF/lib/memcached-2.3.1.jar differ
diff --git a/custom/webpages/WEB-INF/lib/spy-2.4.jar b/custom/webpages/WEB-INF/lib/spy-2.4.jar
new file mode 100644
index 0000000..3f037b2
Binary files /dev/null and b/custom/webpages/WEB-INF/lib/spy-2.4.jar differ
diff --git a/custom/webpages/WEB-INF/spring-configuration/ticketRegistry.xml b/custom/webpages/WEB-INF/spring-configuration/ticketRegistry.xml
new file mode 100644
index 0000000..a2b380e
--- /dev/null
+++ b/custom/webpages/WEB-INF/spring-configuration/ticketRegistry.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+    <description>
+    	Configuration for the default TicketRegistry which stores the tickets in-memory and cleans them out as specified intervals.
+    </description>
+
+    <!-- Ticket Registry -->
+	<!--
+	<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry" />
+	-->
+	<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.MemCacheTicketRegistry">
+    	<constructor-arg index="0">
+    		<list>
+    			<value>${memcache.server}:${memcache.port}</value>
+    		</list>
+    	</constructor-arg>
+    	<constructor-arg index="1" type="int" value="${memcache.TGT.timeout}" />
+    	<constructor-arg index="2" type="int" value="${memcache.ST.timeout}" />
+    </bean>
+</beans>
\ No newline at end of file
ViewGit