org.hardtokenmgmt.core.ui
Class BaseController

java.lang.Object
  extended by org.hardtokenmgmt.core.ui.BaseController
All Implemented Interfaces:
IController
Direct Known Subclasses:
ActivateCardController, AdminCardRemovedController, AdminConfigController, AutoLogonController, BlockCardController, BlockCardResponseController, CardAnalyserController, CardPersonalizedExternallyController, CardStatusRevokedController, CreateCardController, CreateCardDoneController, CreatingCardController, DummyController1, DummyController2, ErrorController, ErrorLoadingAppletController, InvestigateCardController, LogonController, NormalCardController, NotAdminMenuController, NotAdminPUKStep1Controller, NotAdminTemporaryCardStep4Controller, NotAuthorizedController, OtherActionsController, PINLockedController, PINUnlockedController, RenewCertController, RenewCertDoneController, SetCardTypeController, TemplateController, ViewCertController, WaitForApprovalController, WCActionController, WCActivateResponseController, WCRevokeResponseController, WithoutCardController

public abstract class BaseController
extends java.lang.Object
implements IController

A Base class implementing the common methods of a Controller It also contains a lot of help methods of how to access the different interfaces and logging.

Version:
$Id$
Author:
Philip Vendil 2007 feb 15

Field Summary
protected  BaseView view
           
 
Constructor Summary
BaseController(BaseView view)
           
 
Method Summary
protected  void debug(java.lang.String msg)
          Help method to print a debug message to the local log
protected  void debug(java.lang.String msg, java.lang.Throwable throwable)
          Help method to print a debug message along with an excepttion to the local log
protected  void error(java.lang.String msg)
          Help method to print a error message to the local log
protected  void error(java.lang.String msg, java.lang.Throwable throwable)
          Help method to print a error message along with an excepttion to the local log
protected  AdministratorSettings getAdministratorSettings()
          Help method retrieving the Administrator Settings Interface
protected  ControllerMemory getControllerMemory()
          Help method returning the instace of the controller memory.
protected  java.lang.String getControllerSetting(java.lang.String key)
          Returns the value of the given controller setting.
protected  org.ejbca.core.protocol.ws.client.gen.EjbcaWS getEJBCAInterface()
          Help method retrieving the EJBCA Interface
protected  GlobalSettings getGlobalSettings()
          Help method retrieving the Global Settings Interface
protected  IToken getProcessableToken()
          Help method returning the first processable token Should only be used by controllers only supporting on processable token
protected  TokenManager getTokenManager()
          Help method retrieving the Token Manager Interface
 BaseView getView()
          Method called by the main applet when it add the view to the main panel.
protected  void info(java.lang.String msg)
          Help method to print a info message to the local log
protected  void info(java.lang.String msg, java.lang.Throwable throwable)
          Help method to print a info message along with an excepttion to the local log
protected  boolean isAdmin()
          Help method checking if the administrator have the administrator flag set in the administrative privileges.
protected  boolean isNonAdmin()
          Help method checking if the pages should be displayed in non-admin mode
protected  void switchControlTo(java.lang.String controllerClassPath)
          Method that should be used when the controller is complete with its operations and want to give the control to another controller
protected  void switchToFreshController(java.lang.String controllerClassPath)
          Same as swithcControlTo but always creates a fresh controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hardtokenmgmt.core.ui.IController
getControl, isAuthorizedToController
 

Field Detail

view

protected BaseView view
Constructor Detail

BaseController

public BaseController(BaseView view)
Method Detail

getView

public BaseView getView()
Description copied from interface: IController
Method called by the main applet when it add the view to the main panel.

Specified by:
getView in interface IController
See Also:
IController.getView()

switchControlTo

protected void switchControlTo(java.lang.String controllerClassPath)
Method that should be used when the controller is complete with its operations and want to give the control to another controller


switchToFreshController

protected void switchToFreshController(java.lang.String controllerClassPath)
Same as swithcControlTo but always creates a fresh controller. What it does is to remove the cached controller and then creates a new one.


getEJBCAInterface

protected org.ejbca.core.protocol.ws.client.gen.EjbcaWS getEJBCAInterface()
Help method retrieving the EJBCA Interface


getTokenManager

protected TokenManager getTokenManager()
Help method retrieving the Token Manager Interface


getGlobalSettings

protected GlobalSettings getGlobalSettings()
Help method retrieving the Global Settings Interface


getAdministratorSettings

protected AdministratorSettings getAdministratorSettings()
Help method retrieving the Administrator Settings Interface


getControllerMemory

protected ControllerMemory getControllerMemory()
Help method returning the instace of the controller memory.


getControllerSetting

protected java.lang.String getControllerSetting(java.lang.String key)
Returns the value of the given controller setting. The controller setting should start with the implementing controllers classname (not path) in lowercase. Ex for the controller named DummyController calling getControllerSetting with value 'testsetting' will lookup the property dummycontroller.testsetting in global.properties


getProcessableToken

protected IToken getProcessableToken()
Help method returning the first processable token Should only be used by controllers only supporting on processable token


debug

protected void debug(java.lang.String msg)
Help method to print a debug message to the local log

Parameters:
msg - the message to log.

debug

protected void debug(java.lang.String msg,
                     java.lang.Throwable throwable)
Help method to print a debug message along with an excepttion to the local log

Parameters:
msg - the message to log.
throwable - exception to log

info

protected void info(java.lang.String msg)
Help method to print a info message to the local log

Parameters:
msg - the message to log.

info

protected void info(java.lang.String msg,
                    java.lang.Throwable throwable)
Help method to print a info message along with an excepttion to the local log

Parameters:
msg - the message to log.
throwable - exception to log

error

protected void error(java.lang.String msg)
Help method to print a error message to the local log

Parameters:
msg - the message to log.

error

protected void error(java.lang.String msg,
                     java.lang.Throwable throwable)
Help method to print a error message along with an excepttion to the local log

Parameters:
msg - the message to log.
throwable - exception to log

isAdmin

protected boolean isAdmin()
Help method checking if the administrator have the administrator flag set in the administrative privileges.


isNonAdmin

protected boolean isNonAdmin()
Help method checking if the pages should be displayed in non-admin mode