01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.security.audit;
09:
10: //base classes
11: import java.math.BigDecimal;
12: import java.util.HashMap;
13:
14: //project specific classes
15: import org.jfolder.common.UnexpectedSystemException;
16: import org.jfolder.common.utils.misc.MiscHelper;
17: import org.jfolder.security.model.UserHolder;
18: import org.jfolder.security.model.UserIdentity;
19:
20: //other classes
21:
22: public abstract class BaseSecurityAudit implements SecurityAudit {
23:
24: protected BaseSecurityAudit() {
25: }
26:
27: protected void refreshSecurityAudit(SecurityAudit inSa) {
28:
29: //
30: setAuditUserIdentity(inSa.getAuditUserIdentity());
31: setAuditSequenceNumber(inSa.getAuditSequenceNumber());
32: setAuditMachineOfOrigin(inSa.getAuditMachineOfOrigin());
33: setAuditDateTime(inSa.getAuditDateTime());
34: setAuditSeverityLevel(inSa.getAuditSeverityLevel());
35: setAuditCategoryType(inSa.getAuditCategoryType());
36: setAuditSourceType(inSa.getAuditSourceType());
37: setAuditServerVersion(inSa.getAuditServerVersion());
38: //
39: setAuditCustomCode(inSa.getAuditCustomCode());
40: setAuditCustomCategoryType(inSa.getAuditCustomCategoryType());
41: setAuditCustomSourceType(inSa.getAuditCustomSourceType());
42: setAuditCustomMessage(inSa.getAuditCustomMessage());
43: //
44: setAuditOpened(inSa.isAuditOpened());
45: }
46:
47: protected final static String blankForNull(String inValue) {
48:
49: String outValue = inValue;
50:
51: if (inValue == null) {
52: outValue = "";
53: }
54:
55: return outValue;
56: }
57:
58: //
59: protected abstract void setAuditUserIdentity(UserIdentity inUi);
60:
61: protected abstract void setAuditSequenceNumber(BigDecimal inSeqNum);
62:
63: protected abstract void setAuditMachineOfOrigin(
64: String inMachineOfOrig);
65:
66: protected abstract void setAuditDateTime(String inDateTime);
67:
68: protected abstract void setAuditSeverityLevel(String inSeverityLevel);
69:
70: protected abstract void setAuditCategoryType(HashMap inCategoryType);
71:
72: protected abstract void setAuditSourceType(HashMap inSourceType);
73:
74: protected abstract void setAuditServerVersion(String inServerVersion);
75:
76: //
77: protected abstract void setAuditCustomCode(BigDecimal inCustomCode);
78:
79: protected abstract void setAuditCustomCategoryType(
80: HashMap inCategoryType);
81:
82: protected abstract void setAuditCustomSourceType(
83: HashMap inSourceType);
84:
85: protected abstract void setAuditCustomMessage(String inCustomMessage);
86:
87: //
88: public abstract void setAuditOpened(boolean inOpened);
89: }
|