int caid = ILogSessionLocal.INTERNALCAID;
int caid = LogConstants.INTERNALCAID;
    public void removeHardToken(Admin admin, String tokensn) throws HardTokenDoesntExistsException{      debug(">removeHardToken(tokensn : " + tokensn + ")");      int caid = ILogSessionLocal.INTERNALCAID;      try{        HardTokenDataLocal htd = hardtokendatahome.findByPrimaryKey(tokensn);        caid = htd.getSignificantIssuerDN().hashCode();        htd.remove();        // Remove all certificate mappings.        removeHardTokenCertificateMappings(admin, tokensn);        // Remove all copyof references id property database.       try{        	hardtokenpropertyhome.findByProperty(tokensn, HardTokenPropertyEntityBean.PROPERTY_COPYOF).remove();        }catch(FinderException fe){}        try{          Collection copieslocal = hardtokenpropertyhome.findIdsByPropertyAndValue(HardTokenPropertyEntityBean.PROPERTY_COPYOF , tokensn);          Iterator iter = copieslocal.iterator();          while(iter.hasNext()){        	 ((HardTokenPropertyLocal) iter.next()).remove();           }        }catch(FinderException fe){}        getLogSession().log(admin, caid, LogEntry.MODULE_HARDTOKEN, new java.util.Date(),null, null, LogEntry.EVENT_INFO_HARDTOKENDATA,"Hard token with sn " + tokensn + " removed.");      }catch(Exception e){         getLogSession().log(admin, caid, LogEntry.MODULE_HARDTOKEN, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_HARDTOKENDATA,"Error removing hard token with sn " + tokensn + ".");         throw new HardTokenDoesntExistsException("Tokensn : " + tokensn);      }      debug("<removeHardToken()");    } // removeHardToken