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:
  • Field Details

    • ttl

      @TimeToLive @Indexed protected Long ttl
      Time to live.
    • description

      protected String description
      Event description.
    • eventName

      protected String eventName
      Event name.
    • username

      protected String username
      Username for user who caused the event.
    • userAccess

      protected String userAccess
      User access for user who caused the event.
    • timestamp

      protected Date timestamp
      Timestamp when the event happened.
    • formattedTimeStamp

      protected String formattedTimeStamp
      Formatted timestamp when the event happened.
  • Constructor Details

    • EventLog

      public EventLog()
      Constructor.
    • EventLog

      public EventLog(@NonNull @NonNull EventLog.EventLogBuilder<?> builder)
      Builder to construct from.
      Parameters:
      builder - .
  • Method Details

    • compareTo

      public int compareTo(@NonNull @NonNull EventLog o)
      Compares in favor of the newest.
      Specified by:
      compareTo in interface Comparable<EventLog>
      Parameters:
      o - the object to be compared.
      Returns:
      0, 1, -1.
    • equals

      public boolean equals(Object o)
      Equal method.
      Overrides:
      equals in class Object
      Parameters:
      o - Should be of this type.
      Returns:
      true if equal, false otherwise.
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash integer.
    • getTtl

      public Long getTtl()
      Time to live.
      Returns:
      Seconds as Long.
    • getDescription

      public String getDescription()
      Event description.
      Returns:
      String description.
    • getEventName

      public String getEventName()
      Event name.
      Returns:
      String name.
    • getUsername

      public String getUsername()
      Username for user who caused the event.
      Returns:
      String username.
    • getUserAccess

      public String getUserAccess()
      User access for user who caused the event.
      Returns:
      String access.
    • getTimestamp

      public Date getTimestamp()
      Timestamp when the event happened.
      Returns:
      Date.
    • getFormattedTimeStamp

      public String getFormattedTimeStamp()
      Formatted timestamp when the event happened.
      Returns:
      formatted as MM/dd/yyyy HH:mm:ss.