src.server
Class ModuleClass

java.lang.Object
  extended bysrc.server.ModuleClass
All Implemented Interfaces:
Module
Direct Known Subclasses:
AlertDummy, BookModule, EasterModule, EchoModule, LedigaModule, LunchModule, MapModule, MapModule, RandomModule, RoomBookingModule, RSSModule, ScheduleModule, SLModule, StudentSearchModule, SYOModule, THSNewsModule, WordGameModule, ZLocateModule

public abstract class ModuleClass
extends java.lang.Object
implements Module

Last updated $Date: 2005/08/09 21:00:21 $ by $Author: andreas $ Changelog: $Log: ModuleClass.html,v $ Revision 1.1.1.1 2005/08/09 21:00:21 andreas Initial entry Revision 1.4 2005/05/05 11:05:41 andreas No longer acts as a layer for ModuleSettings as that class has been replaced. The processSetting method is now easier to tap into for overriding methods (to avoid unnecessary code). Revision 1.3 2005/05/04 21:58:17 andreas Wrote a layer for modules so that they don't have to access ModuleSettings directly (so they don't have to worry about incorrectly formatting setting names etc). Revision 1.2 2005/05/04 13:35:23 andreas Added some error handeling and implemented setting checks in the config. Revision 1.1 2005/05/04 11:24:48 linus Made updates to: - Configuration handlign - Query testing - Module handling (including module settings).

Version:
$Revision: 1.1.1.1 $ TODO
Author:
linus

Constructor Summary
ModuleClass()
           
 
Method Summary
 ModuleMeta getModuleMeta()
          Get the module meta data.
 Package processSettingRequest(QueryPackage query)
          This is the default setting handler.
 java.lang.String processSettingRequest(RecipientTag tag, java.lang.String settingName, java.lang.String settingValue)
          This is the default setting handler.
 void setModuleMeta(ModuleMeta m)
          Set the module meta data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface src.server.Module
isValidCache, processQuery
 

Constructor Detail

ModuleClass

public ModuleClass()
Method Detail

processSettingRequest

public Package processSettingRequest(QueryPackage query)
This is the default setting handler. Most modules will want to use this as this basically does everything for htem. For some modules though they'll want to override this to provide their own checks / handling etc. Saves the setting as moduleClassName_settingName to avoid name conflicts.

Specified by:
processSettingRequest in interface Module
Parameters:
query - The query to be processed.
Returns:
A package containing the result of the setting request.

processSettingRequest

public java.lang.String processSettingRequest(RecipientTag tag,
                                              java.lang.String settingName,
                                              java.lang.String settingValue)
                                       throws java.lang.IllegalStateException
This is the default setting handler. Most modules will want to use this as this basically does everything for htem. For some modules though they'll want to override this to provide their own checks / handling etc. Saves the setting as moduleClassName_settingName to avoid name conflicts.

Parameters:
tag - The tag of the user that sent the request.
settingName - The name of the setting to be processed.
settingValue - The new value of the setting that is being processed.
Throws:
java.lang.IllegalStateException - if the user is not registered, or if the configuration does not match the request.

getModuleMeta

public ModuleMeta getModuleMeta()
Get the module meta data.

Specified by:
getModuleMeta in interface Module
Returns:
A module meta data structure.

setModuleMeta

public void setModuleMeta(ModuleMeta m)
Set the module meta data.

Specified by:
setModuleMeta in interface Module