BrightSide Workbench Full Report + Source Code
org.turro.mail.impl.MailUser Class Reference

Public Member Functions

 MailUser (IConstructor constructor, String login, String link, String message, String exParam)
 
 MailUser (IConstructor constructor, IUser user, String link, String message, String exParam)
 
String getEmail ()
 
String getMessage (String comment)
 
boolean equals (Object obj)
 
int hashCode ()
 

Detailed Description

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

Definition at line 30 of file MailUser.java.

Constructor & Destructor Documentation

◆ MailUser() [1/2]

org.turro.mail.impl.MailUser.MailUser ( IConstructor  constructor,
String  login,
String  link,
String  message,
String  exParam 
)

Definition at line 35 of file MailUser.java.

35  {
36  user = ContextFactory.getUser(constructor);
37  user.impersonate(login);
38  this.constructor = constructor;
39  this.link = link;
40  this.message = message;
41  this.exParam = exParam;
42  }
boolean impersonate(String login)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MailUser() [2/2]

org.turro.mail.impl.MailUser.MailUser ( IConstructor  constructor,
IUser  user,
String  link,
String  message,
String  exParam 
)

Definition at line 44 of file MailUser.java.

44  {
45  this.constructor = constructor;
46  this.user = user;
47  this.link = link;
48  this.message = message;
49  this.exParam = exParam;
50  }

Member Function Documentation

◆ equals()

boolean org.turro.mail.impl.MailUser.equals ( Object  obj)

Definition at line 77 of file MailUser.java.

77  {
78  if (obj == null) {
79  return false;
80  }
81  if (getClass() != obj.getClass()) {
82  return false;
83  }
84  final MailUser other = (MailUser) obj;
85  if (this.user.getId() != other.user.getId() && (this.user.getId() == null || !this.user.getId().equals(other.user.getId()))) {
86  return false;
87  }
88  return true;
89  }
MailUser(IConstructor constructor, String login, String link, String message, String exParam)
Definition: MailUser.java:35
Here is the call graph for this function:

◆ getEmail()

String org.turro.mail.impl.MailUser.getEmail ( )

Definition at line 52 of file MailUser.java.

52  {
53  if (user == null) {
54  return null;
55  }
56  return user.getProperty(IUser.CONNECTOR_EMAIL);
57  }
String getProperty(String key)
Here is the call graph for this function:

◆ getMessage()

String org.turro.mail.impl.MailUser.getMessage ( String  comment)

Definition at line 59 of file MailUser.java.

59  {
60  if(user == null) return null;
61 
62  if(message.indexOf("{linkTmpSes}") > -1) {
63  String key = user.createTmpKey(new Date(new Date().getTime() + (2L * 24L * 60L * 60L * 1000L)));
64  String server = ElephantContext.getServerUrl("http") +
65  (exParam == null ? "?" : exParam + "&") + "tmpses=" + key;
66  message = message.replaceAll("\\{linkTmpSes\\}", "<a href=\"" + server + "\">" + link + "</a>");
67  }
68 
69  message = message.replaceAll("\\{login\\}", user.getId())
70  .replaceAll("\\{name\\}", user.getName())
71  .replaceAll("\\{comment\\}", comment);
72 
73  return message;
74 }
String createTmpKey(Date valid)
Here is the call graph for this function:

◆ hashCode()

int org.turro.mail.impl.MailUser.hashCode ( )

Definition at line 92 of file MailUser.java.

92  {
93  int hash = 7;
94  hash = 31 * hash + (this.user != null && this.user.getId() != null ? this.user.getId().hashCode() : 0);
95  return hash;
96  }
Here is the call graph for this function:

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