All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.uiuc.ncsa.myproxy.oa4mp.server.util.ConnectionCacheRetentionPolicy Maven / Gradle / Ivy

The newest version!
package edu.uiuc.ncsa.myproxy.oa4mp.server.util;

import edu.uiuc.ncsa.security.core.Identifier;
import edu.uiuc.ncsa.security.core.cache.Cache;
import edu.uiuc.ncsa.security.core.cache.RetentionPolicy;
import edu.uiuc.ncsa.oa4mp.delegation.common.storage.TransactionStore;

import java.util.Map;

/**
 * 

Created by Jeff Gaynor
* on 6/2/16 at 11:44 AM */ public class ConnectionCacheRetentionPolicy implements RetentionPolicy { public ConnectionCacheRetentionPolicy(Cache myproxyConnectionCache, TransactionStore transactionStore) { this.transactionStore = transactionStore; map = myproxyConnectionCache; } TransactionStore transactionStore; public TransactionStore getTransactionStore() { return transactionStore; } Cache myproxyConnectionCache; @Override public boolean applies() { return true; // always try to use this. } @Override public boolean retain(Object key, Object value) { /* This gets the key for the connection and the connection itself. The most basic fact is that connections should not go away while there are active transactions. */ Identifier identifier = (Identifier)key; boolean rc = getTransactionStore().containsKey(identifier); return rc; } Map map = null; @Override public Map getMap() { return map; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy