Package io.github.tkasozi.domain.redis
Class EventLog
java.lang.Object
io.github.tkasozi.domain.BaseEntity
io.github.tkasozi.domain.redis.EventLog
- All Implemented Interfaces:
Serializable
,Comparable<EventLog>
- Direct Known Subclasses:
CpuEventLog
,MemoryEventLog
@RedisHash(value="Logs",
timeToLive=60L)
public class EventLog
extends BaseEntity
implements Serializable, Comparable<EventLog>
Event Log.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
EventLog.EventLogBuilder<T extends EventLog.EventLogBuilder<T>>
Event log builder.Nested classes/interfaces inherited from class io.github.tkasozi.domain.BaseEntity
BaseEntity.BaseEntityBuilder<T extends BaseEntity.BaseEntityBuilder<T>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Event description.protected String
Event name.protected String
Formatted timestamp when the event happened.protected Date
Timestamp when the event happened.protected Long
Time to live.protected String
User access for user who caused the event.protected String
Username for user who caused the event. -
Constructor Summary
ConstructorsConstructorDescriptionEventLog()
Constructor.EventLog
(@NonNull EventLog.EventLogBuilder<?> builder) Builder to construct from. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares in favor of the newest.boolean
Equal method.Event description.Event name.Formatted timestamp when the event happened.Timestamp when the event happened.getTtl()
Time to live.User access for user who caused the event.Username for user who caused the event.int
hashCode()
Hash code.Methods inherited from class io.github.tkasozi.domain.BaseEntity
getId, setId
-
Field Details
-
ttl
Time to live. -
description
Event description. -
eventName
Event name. -
username
Username for user who caused the event. -
userAccess
User access for user who caused the event. -
timestamp
Timestamp when the event happened. -
formattedTimeStamp
Formatted timestamp when the event happened.
-
-
Constructor Details
-
EventLog
public EventLog()Constructor. -
EventLog
Builder to construct from.- Parameters:
builder
- .
-
-
Method Details
-
compareTo
Compares in favor of the newest.- Specified by:
compareTo
in interfaceComparable<EventLog>
- Parameters:
o
- the object to be compared.- Returns:
- 0, 1, -1.
-
equals
Equal method. -
hashCode
public int hashCode()Hash code. -
getTtl
Time to live.- Returns:
- Seconds as
Long
.
-
getDescription
Event description.- Returns:
- String description.
-
getEventName
Event name.- Returns:
- String name.
-
getUsername
Username for user who caused the event.- Returns:
- String username.
-
getUserAccess
User access for user who caused the event.- Returns:
- String access.
-
getTimestamp
Timestamp when the event happened.- Returns:
Date
.
-
getFormattedTimeStamp
Formatted timestamp when the event happened.- Returns:
- formatted as MM/dd/yyyy HH:mm:ss.
-