getLogSession().log(admin, significantissuerdn.hashCode(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_HARDTOKENDATA,"Trying to add hard tokensn that already exists.");
getLogSession().log(admin, bcdn.hashCode(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_HARDTOKENDATA,"Trying to add hard tokensn that already exists.");
    public void addHardToken(Admin admin, String tokensn, String username, String significantissuerdn, int tokentype,  HardToken hardtokendata, Collection certificates) throws HardTokenExistsException{        debug(">addHardToken(tokensn : " + tokensn + ")");        try {            hardtokendatahome.create(tokensn, username,new java.util.Date(), new java.util.Date(), tokentype, significantissuerdn, hardtokendata);            if(certificates != null){              Iterator i = certificates.iterator();              while(i.hasNext()){                addHardTokenCertificateMapping(admin, tokensn, (X509Certificate) i.next());              }            }            getLogSession().log(admin, significantissuerdn.hashCode(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),username, null, LogEntry.EVENT_INFO_HARDTOKENDATA,"Hard token with serial number : " + tokensn + " added.");        }        catch (Exception e) {          getLogSession().log(admin, significantissuerdn.hashCode(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_HARDTOKENDATA,"Trying to add hard tokensn that already exists.");          throw new HardTokenExistsException("Tokensn : " + tokensn);        }        debug("<addHardToken()");    } // addHardToken