BrightSide Workbench Full Report + Source Code
org.turro.contacts.log.LogLoader Class Reference
Inheritance diagram for org.turro.contacts.log.LogLoader:
Collaboration diagram for org.turro.contacts.log.LogLoader:

Public Member Functions

Collection< ILogRegisterload (LogType type, String pathOrigin, int group, String comment)
 
Collection< ILogRegisterloadLogin ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 41 of file LogLoader.java.

Member Function Documentation

◆ load()

Collection<ILogRegister> org.turro.contacts.log.LogLoader.load ( LogType  type,
String  pathOrigin,
int  group,
String  comment 
)

Implements org.turro.plugin.log.ILogLoader.

Definition at line 44 of file LogLoader.java.

44  {
45  Dao dao = new ContactsPU();
46  List<Object[]> list = dao.getResultList(createCriteria(type, pathOrigin, group, comment));
47  ArrayList<ILogRegister> result = new ArrayList<ILogRegister>();
48  for(Object o[] : list) {
49  String path = null, name = null, actualComment = null;
50  Date date = null;
51  int count = 0, field = 0;
52  if(group == LogUtil.GROUP_ENTITY) {
53  path = (String) o[field++];
54  } else if(group == LogUtil.GROUP_USER) {
55  name = (String) o[field++];
56  }
57  if(Strings.isBlank(comment)) {
58  actualComment = (String) o[field++];
59  }
60  count = ((Long) o[field++]).intValue();
61  date = (Date) o[field++];
62  result.add(new LogRegister(type, path, null, name, date, actualComment, null, count));
63  }
64  return result;
65  }

◆ loadLogin()

Collection<ILogRegister> org.turro.contacts.log.LogLoader.loadLogin ( )

Implements org.turro.plugin.log.ILogLoader.

Definition at line 127 of file LogLoader.java.

127  {
128  Dao dao = new ContactsPU();
129  List<Object[]> list = dao.getResultList(createLoginCriteria());
130  ArrayList<ILogRegister> result = new ArrayList<ILogRegister>();
131  for(Object o[] : list) {
132  String path, name;
133  Date date;
134  int count = 0, field = 0;
135  path = (String) o[field++];
136  name = (String) o[field++];
137  count = ((Long) o[field++]).intValue();
138  date = (Date) o[field++];
139  result.add(new LogRegister(null, null, null, name, date, path, null, count));
140  }
141  return result;
142  }

The documentation for this class was generated from the following file: