📄 loginterfacebean.java
字号:
return logsession.loadLogConfiguration(caid); } /** * Saves the log configuration to the database. * * @param logconfiguration the logconfiguration to save. */ public void saveLogConfiguration(int caid, LogConfiguration logconfiguration) { logsession.saveLogConfiguration(admin, caid, logconfiguration); } /** * Help methods that sets up id mappings between event ids and event name hashes. * * @return a hasmap with error info eventname hash to id mappings. */ public HashMap getEventNameHashToIdMap(){ return localeventnamehashtoid; } /** * Help methods that sets up id mappings between event ids and event names in local languange. * * @return a hasmap with error info eventname (translated and html-unescaped) to id mappings. */ public HashMap getTranslatedEventNameToIdMap(){ return localtranslatedeventnamestoid; } /** * Help methods that sets up id mappings between module ids and module names in local languange. * * @return a hasmap with error info eventname to id mappings. */ public HashMap getModuleNameToIdMap(){ return localmodulenamestoid; } /** * Help methods that translates info event names to the local languange. * * @return an array with local info eventnames. */ public String[] getLocalInfoEventNames(){ return localinfoeventnames; } /** * Help methods that translates error event names to the local languange. * * @return an array with local info eventnames. */ public String[] getLocalErrorEventNames(){ return localerroreventnames; } /** * Help methods that returns an array with all translated event names. * * @return an array of all translated eventnames. */ public String[] getAllLocalEventNames(){ return alllocaleventnames; } /** * Help methods that returns an array with all translated module names. * * @return an array of all translated eventnames. */ public String[] getLocalModuleNames(EjbcaWebBean ejbcawebbean){ Collection authorizedmodules = this.informationmemory.getAuthorizedModules(); String[] returnval = new String[authorizedmodules.size()]; Iterator iter = authorizedmodules.iterator(); int i = 0; while(iter.hasNext()){ returnval[i] = ejbcawebbean.getText(LogEntry.MODULETEXTS[((Integer) iter.next()).intValue()]); i++; } return returnval; } /** * Method that exports log entries according to an exporter passed as argument. * @param exporter the export implementation to use, implements the ILogExporter interface * @return byte[] byte data or null if no of exported entries are 0. * @throws IllegalQueryException * @throws ExtendedCAServiceNotActiveException * @throws IllegalExtendedCAServiceRequestException * @throws ExtendedCAServiceRequestException * @throws CADoesntExistsException * @see org.ejbca.core.model.log.ILogExporter */ public byte[] exportLastQuery(ILogExporter exporter) throws IllegalQueryException, CADoesntExistsException, ExtendedCAServiceRequestException, IllegalExtendedCAServiceRequestException, ExtendedCAServiceNotActiveException { byte[] ret = logsession.export(admin, lastquery, informationmemory.getViewLogQueryString(), informationmemory.getViewLogCAIdString(), exporter); return ret; } // Private methods. private void initializeEventNameTables(EjbcaWebBean ejbcawebbean){ int alleventsize = LogEntry.EVENTNAMES_INFO.length + LogEntry.EVENTNAMES_ERROR.length; alllocaleventnames = new String[alleventsize]; localinfoeventnames = new String[LogEntry.EVENTNAMES_INFO.length]; localinfoeventnamesunsorted = new String[LogEntry.EVENTNAMES_INFO.length]; localeventnamehashtoid = new HashMap(); localtranslatedeventnamestoid = new HashMap(); for(int i = 0; i < localinfoeventnames.length; i++){ // If the translation contains html characters (é etc) we must turn it into regular chars, just like the browser does String s = ejbcawebbean.getText(LogEntry.EVENTNAMES_INFO[i]); localinfoeventnames[i] = s; localinfoeventnamesunsorted[i] = s; String translateds = HTMLTools.htmlunescape(s); alllocaleventnames[i] = translateds; // We must make this independent of language encoding, utf, html escaped etc Integer hashcode = new Integer(localinfoeventnames[i].hashCode()); String hash = hashcode.toString(); localeventnamehashtoid.put(hash, new Integer(i)); localtranslatedeventnamestoid.put(translateds, new Integer(i)); } Arrays.sort(localinfoeventnames); localerroreventnamesunsorted = new String[LogEntry.EVENTNAMES_ERROR.length]; localerroreventnames = new String[LogEntry.EVENTNAMES_ERROR.length]; for(int i = 0; i < localerroreventnames.length; i++){ // If the translation contains html characters (é etc) we must turn it into regular chars, just like the browser does String s = ejbcawebbean.getText(LogEntry.EVENTNAMES_ERROR[i]); localerroreventnames[i] = s; localerroreventnamesunsorted[i] = s; String translateds = HTMLTools.htmlunescape(s); alllocaleventnames[LogEntry.EVENTNAMES_INFO.length + i] = translateds; // We must make this independent of language encoding, utf, html escaped etc Integer hashcode = new Integer(s.hashCode()); String hash = hashcode.toString(); localeventnamehashtoid.put(hash, new Integer(i + LogEntry.EVENT_ERROR_BOUNDRARY)); localtranslatedeventnamestoid.put(translateds, new Integer(i + LogEntry.EVENT_ERROR_BOUNDRARY)); } Arrays.sort(localerroreventnames); Arrays.sort(alllocaleventnames); localmodulenames = new String[LogEntry.MODULETEXTS.length]; localmodulenamesunsorted = new String[LogEntry.MODULETEXTS.length]; localmodulenamestoid = new HashMap(9); for(int i = 0; i < localmodulenames.length; i++){ localmodulenames[i] = ejbcawebbean.getText(LogEntry.MODULETEXTS[i]); localmodulenamesunsorted[i] = localmodulenames[i]; localmodulenamestoid.put(localmodulenames[i], new Integer(i)); } Arrays.sort(localmodulenames); } // Private fields. private ICertificateStoreSessionLocal certificatesession; private ILogSessionLocal logsession; private LogEntriesView logentriesview; private Admin admin; private SubjectDNProxy dnproxy; private boolean initialized=false; private InformationMemory informationmemory; private HashMap localeventnamehashtoid; private HashMap localtranslatedeventnamestoid; private HashMap localmodulenamestoid; private String[] localinfoeventnames; private String[] localerroreventnames; private String[] localinfoeventnamesunsorted; private String[] localerroreventnamesunsorted; private String[] alllocaleventnames; private String[] localmodulenames; private String[] localmodulenamesunsorted; private Query lastquery; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -