1 17 package org.alfresco.filesys.smb.dcerpc; 18 19 import java.util.Enumeration ; 20 import java.util.Hashtable ; 21 22 25 public class PolicyHandleCache 26 { 27 28 30 private Hashtable <String , PolicyHandle> m_cache; 31 32 35 public PolicyHandleCache() 36 { 37 m_cache = new Hashtable <String , PolicyHandle>(); 38 } 39 40 45 public final int numberOfHandles() 46 { 47 return m_cache.size(); 48 } 49 50 56 public final void addHandle(String name, PolicyHandle handle) 57 { 58 m_cache.put(name, handle); 59 } 60 61 67 public final PolicyHandle findHandle(String index) 68 { 69 return m_cache.get(index); 70 } 71 72 78 public final PolicyHandle removeHandle(String index) 79 { 80 return m_cache.remove(index); 81 } 82 83 88 public final Enumeration <PolicyHandle> enumerateHandles() 89 { 90 return m_cache.elements(); 91 } 92 93 96 public final void removeAllHandles() 97 { 98 m_cache.clear(); 99 } 100 } 101 | Popular Tags |