- java.lang.Object
-
- io.ebean.event.readaudit.ReadEvent
-
public class ReadEvent extends Object
Read event sent to the ReadEventLogger.This is a flattened in that it contains either a read bean or list of beans. It is flattened in this way to simplify logging and processing and simply means that it either contains an id or a list of ids.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbeanTypeThe type of the bean(s) read.protected StringbindLogThe bind log when the query was executed.protected longeventTimeThe time the bean change was created.protected ObjectidThe id of the bean read.protected List<Object>idsThe ids of the beans read.protected StringqueryKeyThe query key (relative to the bean type).protected StringsourceUser defined 'source' such as the application name.protected Map<String,String>userContextArbitrary user context information expected to be optionally populated by ChangeLogPrepare.protected StringuserIdApplication user id expected to be optionally populated by ChangeLogPrepare.protected StringuserIpAddressApplication user ip address expected to be optionally populated by ChangeLogPrepare.
-
Constructor Summary
Constructors Modifier Constructor Description ReadEvent()Constructor for JSON tools.ReadEvent(String beanType)Construct for many future list query.protectedReadEvent(String beanType, String queryKey, String bindLog)Common constructor for single bean and multi-bean read events.ReadEvent(String beanType, String queryKey, String bindLog, Object id)Construct for a single bean read.ReadEvent(String beanType, String queryKey, String bindLog, List<Object> ids)Construct for many beans read.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBeanType()Return the type of bean read.StringgetBindLog()Return the bind log used when executing the query.longgetEventTime()Return the event date time.ObjectgetId()Return the id of the bean read.List<Object>getIds()Return the ids of the beans read.StringgetQueryKey()Return the query key (relative to the bean type).StringgetSource()Return a code that identifies the source of the change (like the name of the application).Map<String,String>getUserContext()Return a user context value - anything you set yourself in ChangeLogListener prepare().StringgetUserId()Return the application user Id.StringgetUserIpAddress()Return the application users ip address.voidsetBeanType(String beanType)Set the type of bean read.voidsetBindLog(String bindLog)Set the bind log used when executing the query.voidsetEventTime(long eventTime)Set the event date time.voidsetId(Object id)Set the id of the bean read.voidsetIds(List<Object> ids)Set the ids of the beans read.voidsetQueryKey(String queryKey)Set the query key (relative to the bean type).voidsetSource(String source)Set the source of the change (like the name of the application).voidsetUserContext(Map<String,String> userContext)Set a user context value (anything you like).voidsetUserId(String userId)Set the application user Id.voidsetUserIpAddress(String userIpAddress)Set the application users ip address.
-
-
-
Field Detail
-
source
protected String source
User defined 'source' such as the application name.
-
userId
protected String userId
Application user id expected to be optionally populated by ChangeLogPrepare.
-
userIpAddress
protected String userIpAddress
Application user ip address expected to be optionally populated by ChangeLogPrepare.
-
userContext
protected Map<String,String> userContext
Arbitrary user context information expected to be optionally populated by ChangeLogPrepare.
-
eventTime
protected long eventTime
The time the bean change was created.
-
beanType
protected String beanType
The type of the bean(s) read.
-
queryKey
protected String queryKey
The query key (relative to the bean type).
-
bindLog
protected String bindLog
The bind log when the query was executed.
-
id
protected Object id
The id of the bean read.
-
-
Constructor Detail
-
ReadEvent
protected ReadEvent(String beanType, String queryKey, String bindLog)
Common constructor for single bean and multi-bean read events.
-
ReadEvent
public ReadEvent(String beanType, String queryKey, String bindLog, Object id)
Construct for a single bean read.
-
ReadEvent
public ReadEvent(String beanType, String queryKey, String bindLog, List<Object> ids)
Construct for many beans read.
-
ReadEvent
public ReadEvent(String beanType)
Construct for many future list query.
-
ReadEvent
public ReadEvent()
Constructor for JSON tools.
-
-
Method Detail
-
getSource
public String getSource()
Return a code that identifies the source of the change (like the name of the application).
-
setSource
public void setSource(String source)
Set the source of the change (like the name of the application).
-
getUserId
public String getUserId()
Return the application user Id.
-
setUserId
public void setUserId(String userId)
Set the application user Id.This can be set by the ChangeLogListener in the prepare() method which is called in the foreground thread.
-
getUserIpAddress
public String getUserIpAddress()
Return the application users ip address.
-
setUserIpAddress
public void setUserIpAddress(String userIpAddress)
Set the application users ip address.This can be set by the ChangeLogListener in the prepare() method which is called in the foreground thread.
-
getUserContext
public Map<String,String> getUserContext()
Return a user context value - anything you set yourself in ChangeLogListener prepare().
-
setUserContext
public void setUserContext(Map<String,String> userContext)
Set a user context value (anything you like).This can be set by the ChangeLogListener in the prepare() method which is called in the foreground thread.
-
getBeanType
public String getBeanType()
Return the type of bean read.
-
setBeanType
public void setBeanType(String beanType)
Set the type of bean read.
-
getQueryKey
public String getQueryKey()
Return the query key (relative to the bean type).
-
setQueryKey
public void setQueryKey(String queryKey)
Set the query key (relative to the bean type).
-
getBindLog
public String getBindLog()
Return the bind log used when executing the query.
-
setBindLog
public void setBindLog(String bindLog)
Set the bind log used when executing the query.
-
getEventTime
public long getEventTime()
Return the event date time.
-
setEventTime
public void setEventTime(long eventTime)
Set the event date time.
-
getId
public Object getId()
Return the id of the bean read.
-
setId
public void setId(Object id)
Set the id of the bean read.
-
-