parent
ccdd0596c7
commit
bdb354531e
|
|
@ -58,6 +58,17 @@ public class Cas20ProxyReceivingTicketValidationFilter extends AbstractTicketVal
|
|||
super.initInternal(filterConfig);
|
||||
setProxyReceptorUrl(getPropertyFromInitParams(filterConfig, "proxyReceptorUrl", null));
|
||||
|
||||
final String proxyGrantingTicketStorageClass = getPropertyFromInitParams(filterConfig, "proxyGrantingTicketStorageClass", null);
|
||||
|
||||
if (proxyGrantingTicketStorageClass != null) {
|
||||
try {
|
||||
final Class storageClass = Class.forName(proxyGrantingTicketStorageClass);
|
||||
this.proxyGrantingTicketStorage = (ProxyGrantingTicketStorage) storageClass.newInstance();
|
||||
} catch (final Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
log.trace("Setting proxyReceptorUrl parameter: " + this.proxyReceptorUrl);
|
||||
this.millisBetweenCleanUps = Integer.parseInt(getPropertyFromInitParams(filterConfig, "millisBetweenCleanUps", Integer.toString(DEFAULT_MILLIS_BETWEEN_CLEANUPS)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>cas-client</artifactId>
|
||||
<groupId>org.jasig.cas</groupId>
|
||||
<version>3.1.9-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.jasig.cas</groupId>
|
||||
<artifactId>cas-client-support-distributed</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jasig.cas</groupId>
|
||||
<artifactId>cas-client-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
<version>${ehcache.version}</version>
|
||||
<scope>compile</scope>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package org.jasig.cas.client.proxy;
|
||||
|
||||
import net.sf.ehcache.Cache;
|
||||
import net.sf.ehcache.Element;
|
||||
import net.sf.ehcache.CacheManager;
|
||||
|
||||
/**
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.1.9
|
||||
*/
|
||||
public final class EhcacheBackedProxyGrantingTicketStorageImpl implements ProxyGrantingTicketStorage {
|
||||
|
||||
public static final String EHCACHE_CACHE_NAME = "org.jasig.cas.client.proxy.EhcacheBackedProxyGrantingTicketStorageImpl.cache";
|
||||
|
||||
final Cache cache;
|
||||
|
||||
public EhcacheBackedProxyGrantingTicketStorageImpl() {
|
||||
this(CacheManager.create().getCache(EHCACHE_CACHE_NAME));
|
||||
|
||||
}
|
||||
|
||||
public EhcacheBackedProxyGrantingTicketStorageImpl(final Cache cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
public void save(final String proxyGrantingTicketIou, final String proxyGrantingTicket) {
|
||||
final Element element = new Element(proxyGrantingTicketIou, proxyGrantingTicket);
|
||||
this.cache.put(element);
|
||||
}
|
||||
|
||||
public String retrieve(final String proxyGrantingTicketIou) {
|
||||
final Element element = this.cache.get(proxyGrantingTicketIou);
|
||||
|
||||
if (element == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (String) element.getValue();
|
||||
}
|
||||
|
||||
public void cleanUp() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue