BrightSide Workbench Full Report + Source Code
LogSystem.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.contacts.log;
19 
20 import java.io.Serializable;
21 import java.util.Date;
22 import org.turro.contacts.LogEntry;
23 import org.turro.contacts.db.ContactsPU;
24 import org.turro.elephant.log.ILogger;
25 import org.turro.elephant.log.LogType;
26 
31 public class LogSystem implements ILogger {
32 
33  @Override
34  public void doLog(LogType type, String id, String name, String path, String msg, Serializable data) {
35  LogEntry entry = new LogEntry();
36  entry.setDateLog(new Date());
37  entry.setIdUser(id);
38  entry.setName(name);
39  entry.setComment(msg);
40  entry.setObject(data);
41  entry.setLogType(type);
42  entry.setPath(path);
43  new ContactsPU().saveObject(entry);
44  }
45 
46  @Override
47  public long getCountOf(String comment, String logPath, Date since) {
48  return new LogModel().getCountOf(comment, logPath, since);
49  }
50 
51 }
void setObject(Serializable object)
Definition: LogEntry.java:137
void setIdUser(String idUser)
Definition: LogEntry.java:97
void setLogType(LogType logType)
Definition: LogEntry.java:105
void setPath(String path)
Definition: LogEntry.java:121
void setComment(String comment)
Definition: LogEntry.java:65
void setDateLog(Date dateLog)
Definition: LogEntry.java:81
void setName(String name)
Definition: LogEntry.java:113
long getCountOf(String comment, String logPath, Date since)
Definition: LogModel.java:46
long getCountOf(String comment, String logPath, Date since)
Definition: LogSystem.java:47
void doLog(LogType type, String id, String name, String path, String msg, Serializable data)
Definition: LogSystem.java:34