1 13 14 package org.ejbca.core.model.hardtoken.profiles; 15 16 import java.rmi.RemoteException ; 17 import java.util.HashMap ; 18 19 import org.ejbca.core.ejb.hardtoken.IHardTokenSessionRemote; 20 import org.ejbca.core.model.log.Admin; 21 22 33 public class HardTokenProfileProxy { 34 35 36 public HardTokenProfileProxy(Admin admin, IHardTokenSessionRemote hardtokensession){ 37 38 this.hardtokensession = hardtokensession; 39 this.profilestore = new HashMap (); 40 this.updatecount = new HashMap (); 41 this.admin = admin; 42 43 } 44 45 46 52 public HardTokenProfile getHardTokenProfile(int profileid) throws RemoteException { 53 HardTokenProfile returnval = null; 54 Integer id = new Integer (profileid); 55 int count = 0; 56 57 if(updatecount.get(id) == null || 58 (count = hardtokensession.getHardTokenProfileUpdateCount(admin, profileid)) > ((Integer ) updatecount.get(id)).intValue()){ 59 returnval = hardtokensession.getHardTokenProfile(admin, profileid); 60 profilestore.put(id, returnval); 61 updatecount.put(id, new Integer (count)); 62 } 63 return returnval; 64 } 65 66 private HashMap profilestore; 68 private HashMap updatecount; 69 private IHardTokenSessionRemote hardtokensession; 70 private Admin admin; 71 72 } 73 | Popular Tags |