Class LoginAddress
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.system.LoginAddress
- All Implemented Interfaces:
Serializable, Comparable<Object>, IDBean, RemoteAddressBean, Cacheable
A bean to store Login address information for a user.
- Since:
- 1.0
- Version:
- 10.2
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of logins by this user from this address.Returns the remote IP address.Returns the remote host name.voidsetLoginCount(int logins) Updates the number of logins by this user from this address.voidsetRemoteAddr(String addr) Updates the IP address used to log in.voidsetRemoteHost(String host) Updates the host name used to log in.Methods inherited from class DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intbooleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.inthashCode()voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RemoteAddressBean
getIsResolvedModifier and TypeMethodDescriptiondefault booleanReturns if the host name has been resolved.
-
Constructor Details
-
LoginAddress
public LoginAddress(int id) Initializes the bean.- Parameters:
id- the database ID of the user
-
-
Method Details
-
getRemoteAddr
Description copied from interface:RemoteAddressBeanReturns the remote IP address.- Specified by:
getRemoteAddrin interfaceRemoteAddressBean- Returns:
- an IPv4 or IPv6 address
-
getRemoteHost
Description copied from interface:RemoteAddressBeanReturns the remote host name.- Specified by:
getRemoteHostin interfaceRemoteAddressBean- Returns:
- the host name, or address if unresolved
-
getLoginCount
public int getLoginCount()Returns the number of logins by this user from this address.- Returns:
- the number of logins
- See Also:
-
setRemoteAddr
Updates the IP address used to log in.- Parameters:
addr- the IP address- See Also:
-
setRemoteHost
Updates the host name used to log in.- Parameters:
host- the host name- See Also:
-
setLoginCount
public void setLoginCount(int logins) Updates the number of logins by this user from this address.- Parameters:
logins- the number of logins- Throws:
IllegalArgumentException- if logins is negative- See Also:
-