getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_HARDTOKEN_USERDATASENT,"Error when retrieving next token for issuer with dn: " + CertTools.getSubjectDN(issuercert));
getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_HARDTOKEN_USERDATASENT,"Error when retrieving next token for issuer with alias: " + alias);
    public UserAdminData getNextHardTokenToGenerateInQueue(Admin admin, X509Certificate issuercert, int index) throws UnavailableTokenException{      debug(">getNextHardTokenToGenerateInQueue()");      UserAdminData returnval=null;      int issuerid = getHardTokenSession().getHardTokenIssuerId(admin, issuercert);      if(issuerid != IHardTokenSessionLocal.NO_ISSUER){        Connection con = null;        ResultSet rs = null;        try{           // Construct SQL query.            con = getConnection();            rs = getHardTokensFromHardTokenIssuer(con,issuerid);            // Assemble result.           if(rs.relative(index)){              returnval = new UserAdminData(rs.getString(1), rs.getString(2), rs.getInt(14), rs.getString(3), rs.getString(4), rs.getInt(5), rs.getInt(6)                                               , rs.getInt(10), rs.getInt(11)                                               , new java.util.Date(rs.getLong(8)), new java.util.Date(rs.getLong(9))                                               ,  rs.getInt(12), rs.getInt(13));              returnval.setPassword(rs.getString(7));            }            if(returnval !=null){              getHardTokenSession().getIsTokenTypeAvailableToIssuer(admin, issuerid, returnval);              getLogSession().log(admin, returnval.getCAId(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),returnval.getUsername(), null, LogEntry.EVENT_ERROR_HARDTOKEN_USERDATASENT,"Userdata sent for token generation to issuer with dn: " + CertTools.getSubjectDN(issuercert));            }        }catch(Exception e){          getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_HARDTOKEN, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_HARDTOKEN_USERDATASENT,"Error when retrieving next token for issuer with dn: " + CertTools.getSubjectDN(issuercert));          throw new EJBException(e);        }finally{           try{             if(rs != null) rs.close();             if(con!= null) con.close();           }catch(SQLException se){               error("Fel vid upprensning: ", se);           }        }      }      debug("<getNextHardTokenToGenerateInQueue()");      return returnval;    }// getNextHardTokenToGenerateInQueue