1 20 21 22 23 24 25 package org.snmp4j.security; 26 27 import java.util.*; 28 import org.snmp4j.smi.Integer32; 29 30 37 public class SecurityModels { 38 39 private Hashtable securityModels = new Hashtable(3); 40 41 private static SecurityModels instance = null; 42 43 protected SecurityModels() { 44 } 45 46 51 public synchronized static SecurityModels getInstance() { 52 if (instance == null) { 53 instance = new SecurityModels(); 54 } 55 return instance; 56 } 57 58 64 public void addSecurityModel(SecurityModel model) { 65 securityModels.put(new Integer32(model.getID()), model); 66 } 67 68 76 public SecurityModel removeSecurityModel(Integer32 id) { 77 return (SecurityModel)securityModels.remove(id); 78 } 79 80 88 public SecurityModel getSecurityModel(Integer32 id) { 89 return (SecurityModel)securityModels.get(id); 90 } 91 } 92 93 | Popular Tags |