edu.internet2.middleware.shibboleth.common.util
Class EventingMapBasedStorageService<KeyType,ValueType>

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.util.EventingMapBasedStorageService<KeyType,ValueType>
Type Parameters:
KeyType - object type of the keys
ValueType - object type of the values
All Implemented Interfaces:
org.opensaml.util.storage.StorageService<KeyType,ValueType>, ApplicationContextAware

public class EventingMapBasedStorageService<KeyType,ValueType>
extends Object
implements org.opensaml.util.storage.StorageService<KeyType,ValueType>, ApplicationContextAware

A thread-safe implementation of StorageService that publishes event when items are added or removed from the service. An EventingMapBasedStorageService.AddEntryEvent is published after an item has been added to the storage service. A EventingMapBasedStorageService.RemoveEntryEvent is published after an item has been removed from the storage service. These events are published in the root application context, that is the highest ancestor, of the application context presented to this class.


Nested Class Summary
static class EventingMapBasedStorageService.AddEntryEvent<KeyType,ValueType>
          An event indicating an item has been added to an storage service.
 class EventingMapBasedStorageService.PartitionEntryIterator
          An iterator over the entries of a partition of the storage service.
 class EventingMapBasedStorageService.PartitionIterator
          An iterator over the partitions of the storage service.
static class EventingMapBasedStorageService.RemoveEntryEvent<KeyType,ValueType>
          An event indicating an item has been removed from an storage service.
 
Constructor Summary
EventingMapBasedStorageService()
          Constructor.
 
Method Summary
 boolean contains(String partition, Object key)
          
 ValueType get(String partition, Object key)
          
 Iterator<KeyType> getKeys(String partition)
          
 Iterator<String> getPartitions()
          
 ValueType put(String partition, KeyType key, ValueType value)
          
 ValueType remove(String partition, KeyType key)
          
 void setApplicationContext(ApplicationContext ctx)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventingMapBasedStorageService

public EventingMapBasedStorageService()
Constructor.

Method Detail

contains

public boolean contains(String partition,
                        Object key)

Specified by:
contains in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

get

public ValueType get(String partition,
                     Object key)

Specified by:
get in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

getKeys

public Iterator<KeyType> getKeys(String partition)

Specified by:
getKeys in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

getPartitions

public Iterator<String> getPartitions()

Specified by:
getPartitions in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

put

public ValueType put(String partition,
                     KeyType key,
                     ValueType value)

Specified by:
put in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

remove

public ValueType remove(String partition,
                        KeyType key)

Specified by:
remove in interface org.opensaml.util.storage.StorageService<KeyType,ValueType>

setApplicationContext

public void setApplicationContext(ApplicationContext ctx)

Specified by:
setApplicationContext in interface ApplicationContextAware


Copyright © 2006-2011 Internet2. All Rights Reserved.