Class LockOutFlag

java.lang.Object
org.jivesoftware.openfire.lockout.LockOutFlag
All Implemented Interfaces:
Externalizable, Serializable, Cacheable

public class LockOutFlag extends Object implements Cacheable, Externalizable
A LockOutFlag represents the current disabled status set on a particular user account. It can have a start and end time (a period of time in which the disabled status is active).
Author:
Daniel Henninger
See Also:
  • Constructor Details

    • LockOutFlag

      public LockOutFlag()
      Constructor added for Externalizable. Do not use this constructor.
    • LockOutFlag

      public LockOutFlag(String username, Date startTime, Date endTime)
      Creates a representation of a lock out flag, including which user it is attached to and an optional start and end time.
      Parameters:
      username - User the flag is attached to.
      startTime - Optional start time for the disabled status to start.
      endTime - Optional end time for the disabled status to end.
  • Method Details

    • getUsername

      public String getUsername()
      Retrieves the username that this lock out flag is attached to.
      Returns:
      Username the flag is attached to.
    • getStartTime

      public Date getStartTime()
      Retrieves the date/time at which the account this flag references will begin having a disabled status. This can be null if there is no start time set, meaning that the start time is immediate.
      Returns:
      The Date when the disabled status will start, or null for immediately.
    • setStartTime

      public void setStartTime(Date startTime)
      Sets the start time for when the account will be disabled, or null if immediate.
      Parameters:
      startTime - Date when the disabled status will start, or null for immediately.
    • getEndTime

      public Date getEndTime()
      Retrieves the date/time at which the account this flag references will stop having a disabled status. This can be null if the disabled status is to continue until manually disabled.
      Returns:
      The Date when the disabled status will end, or null for "forever".
    • setEndTime

      public void setEndTime(Date endTime)
      Sets the end time for when the account will be reenabled, or null if manual reenable required.
      Parameters:
      endTime - Date when the disabled status will end, or null for forever.
    • getCachedSize

      public int getCachedSize()
      Description copied from interface: Cacheable
      Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

      Specified by:
      getCachedSize in interface Cacheable
      Returns:
      the size of the Object in bytes.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException