01: /*
02: * Created by IntelliJ IDEA.
03: * User: Jacques
04: * Date: May 28, 2005
05: * Time: 7:54:24 PM
06: */
07: package com.technoetic.xplanner.history;
08:
09: import java.util.Date;
10:
11: import net.sf.hibernate.Session;
12:
13: import com.technoetic.xplanner.domain.DomainObject;
14:
15: public class Historian {
16: private Session session;
17: private int currentUserId;
18:
19: //DEBT 3LAYERCONTEXT: Introduce a 3 layer context file hierarchy: 1 request, 1 session, 1 application: The session should hold the Historian so that it can be initialized after the user has authenticated.
20: public Historian(Session session, int currentUserId) {
21: this .session = session;
22: this .currentUserId = currentUserId;
23: }
24:
25: public void saveEvent(DomainObject object, String action,
26: String description, Date when) {
27: HistorySupport.saveEvent(session, object, action, description,
28: currentUserId, when);
29: }
30: }
|