winstone
Class SizeRestrictedHashtable<K,V>

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<K,V>
          extended by winstone.SizeRestrictedHashtable<K,V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>

public class SizeRestrictedHashtable<K,V>
extends java.util.Hashtable<K,V>

Hashtable that sets the upper bound in the total number of keys. This is to protect against the DoS attack based on the hash key collision. See http://www.ocert.org/advisories/ocert-2011-003.html

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Constructor Summary
SizeRestrictedHashtable(int cap)
           
SizeRestrictedHashtable(int initialCapacity, float loadFactor, int cap)
           
SizeRestrictedHashtable(int initialCapacity, int cap)
           
SizeRestrictedHashtable(java.util.Map<? extends K,? extends V> t, int cap)
           
 
Method Summary
 V put(K key, V value)
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SizeRestrictedHashtable

public SizeRestrictedHashtable(int initialCapacity,
                               float loadFactor,
                               int cap)

SizeRestrictedHashtable

public SizeRestrictedHashtable(int initialCapacity,
                               int cap)

SizeRestrictedHashtable

public SizeRestrictedHashtable(int cap)

SizeRestrictedHashtable

public SizeRestrictedHashtable(java.util.Map<? extends K,? extends V> t,
                               int cap)
Method Detail

put

public V put(K key,
             V value)
Specified by:
put in interface java.util.Map<K,V>
Overrides:
put in class java.util.Hashtable<K,V>


Copyright © 2013. All Rights Reserved.