org.melati.login
Class CommandLineAccessHandler

Package class diagram package CommandLineAccessHandler
java.lang.Object
  extended by org.melati.login.CommandLineAccessHandler
All Implemented Interfaces:
AccessHandler

public class CommandLineAccessHandler
extends Object
implements AccessHandler

A handler invoked when an AccessPoemException is thrown. If the application is invoked without a username and password on the command line then the user will be prompted for them. If the usename is supplied then the user will not be prompted as this migth interfere with use in a scripting environment.

See Also:
AccessHandler

Constructor Summary
CommandLineAccessHandler()
          Constructor.
 
Method Summary
 void buildRequest(Melati melati)
          A no-op in a command line application.
 Melati establishUser(Melati melati)
          Called when the PoemTask is initialised, recalled after a login.
 void handleAccessException(Melati melati, AccessPoemException accessException)
          Actually handle the AccessPoemException.
 void setInput(InputStream input)
           
 void setOutput(PrintStream output)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineAccessHandler

public CommandLineAccessHandler()
Constructor.

Method Detail

handleAccessException

public void handleAccessException(Melati melati,
                                  AccessPoemException accessException)
                           throws Exception
Actually handle the AccessPoemException. Deal with an AccessPoemException, often by allowing login.

Specified by:
handleAccessException in interface AccessHandler
Parameters:
melati - current Melati
accessException - the AccessException
Throws:
Exception
See Also:
(org.melati.Melati, org.melati.poem.AccessPoemException)

establishUser

public Melati establishUser(Melati melati)
Called when the PoemTask is initialised, recalled after a login. Called when a @link PoemTask} is initiated.

Specified by:
establishUser in interface AccessHandler
Returns:
A Melati with the appropriate fields filled.
See Also:
AccessHandler.establishUser(org.melati.Melati)

buildRequest

public void buildRequest(Melati melati)
                  throws MelatiException,
                         IOException
A no-op in a command line application. Rebuild request if we have had to login, otherwise nothing.

Specified by:
buildRequest in interface AccessHandler
Parameters:
melati - used to hold original request
Throws:
MelatiException
IOException
See Also:
AccessHandler.buildRequest(org.melati.Melati)

setInput

public void setInput(InputStream input)
Parameters:
input - The input to set.

setOutput

public void setOutput(PrintStream output)
Parameters:
output - The output to set.


Copyright © 2000-2010 PanEris. All Rights Reserved.