public ISystemLog save(DateTime dateTime, SystemLogType type, SystemLogLevel level, String server, String user, String source, String computer, String userAgent, String sessionId, String message) { SystemLogVo entry = new SystemLogVo(); entry.setEventDateTime(dateTime); entry.setEventType(type.getId()); entry.setEventLevel(level.getId()); entry.setApplicationServer(server); entry.setUser(user); entry.setSource(source); entry.setComputer(computer); entry.setMessage(message); entry.setSessionId(sessionId); entry.setUserAgent(userAgent); ims.core.admin.domain.objects.SystemLog domainObject = SystemLogVoAssembler.extractSystemLog(getDomainFactory(), entry); try { getDomainFactory().save(domainObject); } catch (StaleObjectException e) { return null; } return SystemLogVoAssembler.create(domainObject); }
@SuppressWarnings("unchecked") public SystemLogVoCollection getEntries(String sessionId) { if(sessionId == null || sessionId.trim().length() == 0) return new SystemLogVoCollection(); DomainFactory factory = getDomainFactory(); String hql = " from SystemLog sl where sl.sessionId = '" + sessionId + "' order by sl.id desc"; List entries = factory.find(hql); return SystemLogVoAssembler.createSystemLogVoCollectionFromSystemLog(entries); }
public SystemLogVo getEntry(Integer eventId) { return SystemLogVoAssembler.create((SystemLog)getDomainFactory().getDomainObject(SystemLog.class, eventId)); }