18,11 → 18,35 |
private Boolean virusCheck; |
private Boolean spamCheck; |
private SystemUser systemUser; |
private Mailbox origin; // save original object state before any changes |
|
protected Mailbox() |
{ |
} |
|
protected Mailbox(Mailbox origin) |
{ |
super(origin); |
this.login = origin.login; |
this.password = origin.password; |
this.domain = origin.domain; |
this.owner = origin.owner; |
this.virusCheck = origin.virusCheck; |
this.spamCheck = origin.spamCheck; |
this.systemUser = origin.systemUser; |
} |
|
protected Mailbox getOrigin() |
{ |
return origin; |
} |
|
protected void backupMe() |
{ |
if(origin == null) |
origin = new Mailbox(this); |
} |
|
/** |
* |
* @hibernate.property |
43,6 → 67,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.login = login; |
} |
|
66,6 → 91,7 |
if(password == null) |
throw new NullPointerException("Null password"); |
|
backupMe(); |
this.password = Digest.encode(password); |
} |
|
89,6 → 115,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.domain = domain; |
} |
|
112,6 → 139,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.owner = owner; |
} |
|
135,6 → 163,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.virusCheck = virusCheck; |
} |
|
158,6 → 187,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.spamCheck = spamCheck; |
} |
|
181,6 → 211,7 |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
backupMe(); |
this.systemUser = systemUser; |
} |
|
225,9 → 256,10 |
|
protected static Mailbox createLimitedCopy(Mailbox origin) |
{ |
Mailbox u = new Mailbox(); |
u.setLogin(origin.getLogin()); |
u.setDomain(origin.getDomain()); |
return u; |
Mailbox m = new Mailbox(); |
m.setLogin(origin.getLogin()); |
m.setDomain(origin.getDomain()); |
m.setOwner(origin.getOwner()); |
return m; |
} |
} |