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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LockOutFlag()Constructor added for Externalizable.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCachedSize()Returns the approximate size of the Object in bytes.DategetEndTime()Retrieves the date/time at which the account this flag references will stop having a disabled status.DategetStartTime()Retrieves the date/time at which the account this flag references will begin having a disabled status.StringgetUsername()Retrieves the username that this lock out flag is attached to.voidreadExternal(ObjectInput in)voidsetEndTime(Date endTime)Sets the end time for when the account will be reenabled, or null if manual reenable required.voidsetStartTime(Date startTime)Sets the start time for when the account will be disabled, or null if immediate.voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
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 Detail
-
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:CacheableReturns 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:
getCachedSizein interfaceCacheable- Returns:
- the size of the Object in bytes.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-