ecologylab.services.authentication
Interface Authenticatable<E extends AuthenticationListEntry>

All Known Implementing Classes:
DoubleThreadedAuthNIOServer

public interface Authenticatable<E extends AuthenticationListEntry>

Indicates that the implementer can be logged-into and out-of.

Author:
Zachary O. Toups (toupsz@cs.tamu.edu)

Method Summary
 boolean isLoggedIn(java.lang.String username)
          Indicates whether or not the supplied username is currently logged-in to the system.
 boolean login(E entry, java.lang.String sessionId)
          Determines whether a user can log in (based on the content of entry and its originating IP address (address)).
 boolean logout(E entry, java.lang.String sessionId)
          Logs the user out of the system (based on the content of entry and its originating IP address (address)).
 

Method Detail

login

boolean login(E entry,
              java.lang.String sessionId)
Determines whether a user can log in (based on the content of entry and its originating IP address (address)). Handles any necessary bookkeeping (such as a list of authenticated clients).

Parameters:
entry - the information about the user attempting to log in (username / password, etc.).
sessionId - the session id for the connected socket.
Returns:
true if the user successfully logged in, false otherwise.

logout

boolean logout(E entry,
               java.lang.String sessionId)
Logs the user out of the system (based on the content of entry and its originating IP address (address)). Handles necessary bookkeeping (such as a list of authenticated clients).

Parameters:
entry - the information about the user attempting to log out (username / password, etc.).
address - the originating IP address for the logout attempt.
Returns:
true if the user successfully logged out, false otherwise. This method may return false if the user was never logged in, or if the attempt appears to be a spoof.

isLoggedIn

boolean isLoggedIn(java.lang.String username)
Indicates whether or not the supplied username is currently logged-in to the system.

Parameters:
username - the username to check.
Returns: