001/* 002 * Stallion Core: A Modern Web Framework 003 * 004 * Copyright (C) 2015 - 2016 Stallion Software LLC. 005 * 006 * This program is free software: you can redistribute it and/or modify it under the terms of the 007 * GNU General Public License as published by the Free Software Foundation, either version 2 of 008 * the License, or (at your option) any later version. This program is distributed in the hope that 009 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 011 * License for more details. You should have received a copy of the GNU General Public License 012 * along with this program. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>. 013 * 014 * 015 * 016 */ 017 018package io.stallion.services; 019 020import java.time.ZonedDateTime; 021 022import io.stallion.dataAccess.ModelBase; 023 024import javax.persistence.Column; 025import javax.persistence.Table; 026 027@Table(name="stallion_audit_trail") 028public class AuditTrail extends ModelBase { 029 private String table; 030 private Long objectId; 031 private String objectData; 032 private Long userId; 033 private String userEmail; 034 private String remoteIp; 035 private String userAgent; 036 private Long valetId; 037 private String valetEmail; 038 private Long orgId; 039 private ZonedDateTime createdAt; 040 private boolean keepLongTerm = false; 041 042 @Column 043 public String getTable() { 044 return table; 045 } 046 047 public AuditTrail setTable(String table) { 048 this.table = table; 049 return this; 050 } 051 052 @Column 053 public Long getObjectId() { 054 return objectId; 055 } 056 057 public AuditTrail setObjectId(Long objectId) { 058 this.objectId = objectId; 059 return this; 060 } 061 062 @Column(columnDefinition = "longtext") 063 public String getObjectData() { 064 return objectData; 065 } 066 067 public AuditTrail setObjectData(String objectData) { 068 this.objectData = objectData; 069 return this; 070 } 071 072 @Column 073 public Long getUserId() { 074 return userId; 075 } 076 077 public AuditTrail setUserId(Long userId) { 078 this.userId = userId; 079 return this; 080 } 081 082 @Column 083 public String getUserEmail() { 084 return userEmail; 085 } 086 087 public AuditTrail setUserEmail(String userEmail) { 088 this.userEmail = userEmail; 089 return this; 090 } 091 092 @Column(length = 50) 093 public String getRemoteIp() { 094 return remoteIp; 095 } 096 097 public AuditTrail setRemoteIp(String remoteIp) { 098 this.remoteIp = remoteIp; 099 return this; 100 } 101 102 @Column 103 public String getUserAgent() { 104 return userAgent; 105 } 106 107 public AuditTrail setUserAgent(String userAgent) { 108 this.userAgent = userAgent; 109 return this; 110 } 111 112 @Column 113 public Long getValetId() { 114 return valetId; 115 } 116 117 public AuditTrail setValetId(Long valetId) { 118 this.valetId = valetId; 119 return this; 120 } 121 122 @Column 123 public String getValetEmail() { 124 return valetEmail; 125 } 126 127 public AuditTrail setValetEmail(String valetEmail) { 128 this.valetEmail = valetEmail; 129 return this; 130 } 131 132 @Column 133 public Long getOrgId() { 134 return orgId; 135 } 136 137 public AuditTrail setOrgId(Long orgId) { 138 this.orgId = orgId; 139 return this; 140 } 141 142 @Column 143 public ZonedDateTime getCreatedAt() { 144 return createdAt; 145 } 146 147 public AuditTrail setCreatedAt(ZonedDateTime createdAt) { 148 this.createdAt = createdAt; 149 return this; 150 } 151 152 @Column 153 public boolean isKeepLongTerm() { 154 return keepLongTerm; 155 } 156 157 public AuditTrail setKeepLongTerm(boolean keepLongTerm) { 158 this.keepLongTerm = keepLongTerm; 159 return this; 160 } 161}