BrightSide Workbench Full Report + Source Code
org.turro.log.OldLogEntry Class Reference

Public Member Functions

 OldLogEntry (int type, String path, String idUser, String name, Date dateLog, String comment, byte[] data)
 
int getType ()
 
String getPath ()
 
String getIdUser ()
 
String getName ()
 
Date getDateLog ()
 
String getComment ()
 
byte[] getData ()
 
void migrate (Dao dao)
 

Detailed Description

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

Definition at line 33 of file OldLogEntry.java.

Constructor & Destructor Documentation

◆ OldLogEntry()

org.turro.log.OldLogEntry.OldLogEntry ( int  type,
String  path,
String  idUser,
String  name,
Date  dateLog,
String  comment,
byte[]  data 
)

Definition at line 40 of file OldLogEntry.java.

40  {
41  this.type = type;
42  this.path = path;
43  this.idUser = idUser;
44  this.name = name;
45  this.dateLog = dateLog;
46  this.comment = comment;
47  this.data = data;
48  }

Member Function Documentation

◆ getComment()

String org.turro.log.OldLogEntry.getComment ( )

Definition at line 70 of file OldLogEntry.java.

70  {
71  return comment;
72  }

◆ getData()

byte [] org.turro.log.OldLogEntry.getData ( )

Definition at line 74 of file OldLogEntry.java.

74  {
75  return data;
76  }

◆ getDateLog()

Date org.turro.log.OldLogEntry.getDateLog ( )

Definition at line 66 of file OldLogEntry.java.

66  {
67  return dateLog;
68  }

◆ getIdUser()

String org.turro.log.OldLogEntry.getIdUser ( )

Definition at line 58 of file OldLogEntry.java.

58  {
59  return idUser;
60  }

◆ getName()

String org.turro.log.OldLogEntry.getName ( )

Definition at line 62 of file OldLogEntry.java.

62  {
63  return name;
64  }

◆ getPath()

String org.turro.log.OldLogEntry.getPath ( )

Definition at line 54 of file OldLogEntry.java.

54  {
55  return path;
56  }

◆ getType()

int org.turro.log.OldLogEntry.getType ( )

Definition at line 50 of file OldLogEntry.java.

50  {
51  return type;
52  }

◆ migrate()

void org.turro.log.OldLogEntry.migrate ( Dao  dao)

Definition at line 78 of file OldLogEntry.java.

78  {
79  SystemLog entry = new SystemLog();
80  entry.setDateLog(dateLog);
81  if(Strings.isBlank(idUser) || idUser.length() < 20) {
82  entry.setGeneratorPath(Strings.isBlank(idUser, "#"));
83  entry.setGeneratorName("Unknown");
84  } else {
85  entry.setGeneratorPath("/contact/" + idUser);
86  entry.setGeneratorName(name);
87  }
88  IElephantEntity entity = Entities.getController(path);
89  if((entity == null) || (entity instanceof EmptyController)) {
90  entry.setEntityPath(path);
91  entry.setEntityName("Unknown");
92  } else {
93  entry.setEntityPath(entity.getPath());
94  entry.setEntityName(entity.getName());
95  }
96  entry.setComment(comment);
97  entry.setData(data);
98  switch(type) {
99  case 1:
100  entry.setLogType(SystemLogType.LOG_WARNING);
101  break;
102  case 2:
103  entry.setLogType(SystemLogType.LOG_SEVERE);
104  break;
105  default:
106  entry.setLogType(SystemLogType.LOG_INFO);
107  break;
108  }
109  dao.saveObject(entry);
110  }
Here is the call graph for this function:

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