logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CREATECRL,e.getMessage());
logsession.log(admin, admin.getCaId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CREATECRL,e.getMessage());
    public int createCRLs(Admin admin)  {    	int createdcrls = 0;    	try {    		Date currenttime = new Date();    		ICAAdminSessionLocal caadmin = caadminHome.create();    		ICertificateStoreSessionLocal store = storeHome.create();    		Iterator iter = caadmin.getAvailableCAs(admin).iterator();    		while(iter.hasNext()){    			int caid = ((Integer) iter.next()).intValue();    			try{    			   CAInfo cainfo = caadmin.getCAInfo(admin, caid);    			   if(cainfo instanceof X509CAInfo){    			      CRLInfo crlinfo = store.getLastCRLInfo(admin,cainfo.getSubjectDN());    			      if((currenttime.getTime() + CRLOVERLAPTIME) >= crlinfo.getExpireDate().getTime()){    			      	 this.run(admin, cainfo.getSubjectDN());    			      	 createdcrls++;    			      }    			   }    		    }catch(Exception e){    		    	logsession.log(admin, caid, LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CREATECRL,e.getMessage());    		    	throw new EJBException(e);    		    }    		}    	} catch (Exception e) {    		logsession.log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CREATECRL,e.getMessage());    		throw new EJBException(e);    	}    	return createdcrls;    }