Class HotmailYahooMailRHULMailRecognizer

java.lang.Object
  |
  +--HotmailYahooMailRHULMailRecognizer
All Implemented Interfaces:
RequestRecognizer

class HotmailYahooMailRHULMailRecognizer
extends java.lang.Object
implements RequestRecognizer

This class recognizes HTTP requests that constitute login requests into one of the following websites: Microsoft Hotmail (Passport), Yahoo Mail (Secure version) and Royal Holloway, University of London webmail. It is typically instantiated by an Impostor, using the getRequestRecognizer method of a UserManager implementation.


Field Summary
protected  boolean isHotmail
           
protected  boolean isRhulMail
           
protected  boolean isYahooMailSecure
           
(package private)  java.lang.String request
           
 
Constructor Summary
(package private) HotmailYahooMailRHULMailRecognizer()
           
 
Method Summary
 java.lang.String fillInUsernameAndPassword(java.lang.String username, java.lang.String password)
          A RequestRecognizer must also implement the functionality to fill a given username and password into the HTTP request with which is was initialized, such that the resulting HTTP request effectively logs the specified username into the site, using the specified password.
 java.lang.String getLogEntry()
          The Impostor daemon calls this method in order to store an entry in a log for this RequestRecognizer.
 java.lang.String getServiceName()
          The Impostor daemon calls this method only if this RequestRecognizer's isRecognized method returns true.
 void init(java.lang.String host, int port, java.lang.String request)
          The Impostor daemon calls this method in order to initialize the RequestRecognizer.
 boolean isRecognized()
          The Impostor daemon calls this method in order to determine whether this RequestRecognizer recognized the HTTP request with which it was initialized as a login attempt into a website.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

java.lang.String request

isHotmail

protected boolean isHotmail

isYahooMailSecure

protected boolean isYahooMailSecure

isRhulMail

protected boolean isRhulMail
Constructor Detail

HotmailYahooMailRHULMailRecognizer

HotmailYahooMailRHULMailRecognizer()
Method Detail

init

public void init(java.lang.String host,
                 int port,
                 java.lang.String request)
Description copied from interface: RequestRecognizer
The Impostor daemon calls this method in order to initialize the RequestRecognizer. It is called for every HTML request coming from a user. The parameters passed to the method is the host name of the website, the port number of the TCP socket (this is typically 80 for HTTP or 447 for HTTPS) and the HTTP request itself. This includes HTML request headers and, only in the case of a POST request, the POST string that follows immetiately after the headers. An implementing class should analyze the request and determine whether this is a login request for a website or not.

Specified by:
init in interface RequestRecognizer

fillInUsernameAndPassword

public java.lang.String fillInUsernameAndPassword(java.lang.String username,
                                                  java.lang.String password)
Description copied from interface: RequestRecognizer
A RequestRecognizer must also implement the functionality to fill a given username and password into the HTTP request with which is was initialized, such that the resulting HTTP request effectively logs the specified username into the site, using the specified password. The Impostor daemon calls this method only if this RequestRecognizer's isRecognized method returns true. The daemon will call this method only after a valid Impostor user has successfully authenticated him/herself. (as determined by the imlementation of a ChallengeResponseManager). The username and password the Impostor daemon passes as parameters to this method are determined by the implementation of a UserManager.

Specified by:
fillInUsernameAndPassword in interface RequestRecognizer

getServiceName

public java.lang.String getServiceName()
Description copied from interface: RequestRecognizer
The Impostor daemon calls this method only if this RequestRecognizer's isRecognized method returns true. This method should return the name of the service or website this recognized request is a login attempt for. The daemon uses this name in order to generate the Impostor login page.

Specified by:
getServiceName in interface RequestRecognizer

getLogEntry

public java.lang.String getLogEntry()
Description copied from interface: RequestRecognizer
The Impostor daemon calls this method in order to store an entry in a log for this RequestRecognizer. An implementation should return the details of an HTTP request if, of course, it has been initialized.

Specified by:
getLogEntry in interface RequestRecognizer

isRecognized

public boolean isRecognized()
Description copied from interface: RequestRecognizer
The Impostor daemon calls this method in order to determine whether this RequestRecognizer recognized the HTTP request with which it was initialized as a login attempt into a website. The method should return false if the init method of this object has not been called yet, or if the request was not recognized as a login attempt. If this method returns true, the Impostor daemon expects the remaining methods to return non-null values.

Specified by:
isRecognized in interface RequestRecognizer