org.mmbase.module
Class sessions

java.lang.Object
  extended byorg.mmbase.module.Module
      extended byorg.mmbase.module.ProcessorModule
          extended byorg.mmbase.module.sessions
All Implemented Interfaces:
ProcessorInterface, sessionsInterface

public class sessions
extends ProcessorModule
implements sessionsInterface

CLEARSET-NAME : This command clears the session variable called NAME ADDSET-NAME-VALUE : This command adds VALUE to the SESSION variable set called NAME, no duplicates are allowed PUTSET-NAME-VALUE : This command adds VALUE to the SESSION variable set called NAME, duplicates are allowed DELSET-NAME-VALUE : This command deletes VALUE form the SESSION variable set called NAME. CONTAINSSET-NAME-VALUE : returns "YES" if the session variable NAME contains the VALUE, otherwise returns "NO" SETSTRING-NAME : This command gives all values of the session variable NAME, comma separated. SETCOUNT-NAME : This command gives the number of values contained by the session variable NAME. AVGSET-NAME : This command returns the average of a set numbers. CLEARSESSIONINFO : This command clears the SessionInfo.

Version:
$Id: sessions.java,v 1.26 2003/07/04 14:36:32 pierre Exp $
Author:
Daniel Ockeloen
Warning: Will be renamed to:
Sessions

Constructor Summary
sessions()
          sessions Module constructor.
 
Method Summary
 void addSetValue(sessionInfo session, java.lang.String key, java.lang.String value)
          Adds a String to a set.
 void addSetValues(sessionInfo session, java.lang.String key, java.util.Vector values)
          Adds a number of Strings to a set.
 java.lang.String doAddSet(scanpage sp, java.util.StringTokenizer tok)
          Adds a sessionvariable with specified value
 java.lang.String doClearSet(scanpage sp, java.util.StringTokenizer tok)
          This methode clears a SESSION variable
 java.lang.String doDelSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.util.Vector doGetSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.lang.String doPutSet(scanpage sp, java.util.StringTokenizer tok)
           
 void forgetSession(java.lang.String wanted)
           
 java.lang.String getAvgSet(scanpage sp, java.util.StringTokenizer tok)
           
 java.lang.String getContainsSet(scanpage sp, java.util.StringTokenizer tok)
          Checks if a Session variable contains a certain value.
 java.util.Vector getList(scanpage sp, StringTagger tagger, java.lang.String cmd)
          Generate a list of values from a command to the processor
 sessionInfo getSession(scanpage sp, java.lang.String wanted)
           
 java.lang.String getSetCount(scanpage sp, java.util.StringTokenizer tok)
          Gives the number of values contained by a certain session variable
 java.lang.String getSetString(scanpage sp, java.util.StringTokenizer tok)
          returns the values of a session variable comma separated
 int getSize()
           
 java.lang.String getValue(sessionInfo session, java.lang.String wanted)
           
 void init()
          Initializes the module. Init must be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.
 void loadNewProperties(sessionInfo session)
           
 void loadProperties(sessionInfo session)
           
 java.lang.String replace(scanpage sp, java.lang.String cmds)
          Handle a $MOD command
 java.lang.String saveValue(sessionInfo session, java.lang.String key)
           
 java.lang.String saveValueNew(sessionInfo session, java.lang.String key)
           
 java.lang.String setValue(sessionInfo session, java.lang.String key, java.lang.String value)
          Sets or changes a parameter in a sessionInfo.
 void setValueFromNode(sessionInfo session, MMObjectNode node)
           
 java.util.Hashtable state()
          state, returns the state hashtable that is/can be used to debug.
 java.lang.String xmlEscape(java.lang.String s)
          the XML reader will correct the escaped characters again.
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getListBuilder, getNodeList, onload, process, reload, replace, unload
 
Methods inherited from class org.mmbase.module.Module
getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModuleInfo, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, setInitParameter, setMaintainer, setName, setVersion, shutdown, shutdownModules, startModule, startModules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

sessions

public sessions()
sessions Module constructor.

Method Detail

init

public void init()
Description copied from class: ProcessorModule
Initializes the module. Init must be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.

Specified by:
init in interface sessionsInterface
Overrides:
init in class ProcessorModule

getSession

public sessionInfo getSession(scanpage sp,
                              java.lang.String wanted)
Specified by:
getSession in interface sessionsInterface

forgetSession

public void forgetSession(java.lang.String wanted)
Specified by:
forgetSession in interface sessionsInterface

getValue

public java.lang.String getValue(sessionInfo session,
                                 java.lang.String wanted)
Specified by:
getValue in interface sessionsInterface

setValue

public java.lang.String setValue(sessionInfo session,
                                 java.lang.String key,
                                 java.lang.String value)
Sets or changes a parameter in a sessionInfo.

Specified by:
setValue in interface sessionsInterface
Parameters:
session - the sessionInfo wich has to contain the parameter.
key - the name of the parameter to be set.
value - the value to wich the parameter should be set.

addSetValues

public void addSetValues(sessionInfo session,
                         java.lang.String key,
                         java.util.Vector values)
Adds a number of Strings to a set.

Specified by:
addSetValues in interface sessionsInterface
Parameters:
session - the sessionInfo containing the set.
key - the name of the set.

addSetValue

public void addSetValue(sessionInfo session,
                        java.lang.String key,
                        java.lang.String value)
Adds a String to a set. If the String is allready contained by the set nothing happens.

Specified by:
addSetValue in interface sessionsInterface
Parameters:
session - the sessionInfo containing the set.
key - the name of the set.
value - the String to be added to the set.

setValueFromNode

public void setValueFromNode(sessionInfo session,
                             MMObjectNode node)
Specified by:
setValueFromNode in interface sessionsInterface

loadProperties

public void loadProperties(sessionInfo session)

loadNewProperties

public void loadNewProperties(sessionInfo session)

saveValue

public java.lang.String saveValue(sessionInfo session,
                                  java.lang.String key)
Specified by:
saveValue in interface sessionsInterface

saveValueNew

public java.lang.String saveValueNew(sessionInfo session,
                                     java.lang.String key)

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger tagger,
                                java.lang.String cmd)
                         throws ParseException
Description copied from class: ProcessorModule
Generate a list of values from a command to the processor

Specified by:
getList in interface ProcessorInterface
Overrides:
getList in class ProcessorModule
Throws:
ParseException

replace

public java.lang.String replace(scanpage sp,
                                java.lang.String cmds)
Handle a $MOD command

Specified by:
replace in interface sessionsInterface
Overrides:
replace in class ProcessorModule

doAddSet

public java.lang.String doAddSet(scanpage sp,
                                 java.util.StringTokenizer tok)
Adds a sessionvariable with specified value


doPutSet

public java.lang.String doPutSet(scanpage sp,
                                 java.util.StringTokenizer tok)

doClearSet

public java.lang.String doClearSet(scanpage sp,
                                   java.util.StringTokenizer tok)
This methode clears a SESSION variable


getAvgSet

public java.lang.String getAvgSet(scanpage sp,
                                  java.util.StringTokenizer tok)

doDelSet

public java.lang.String doDelSet(scanpage sp,
                                 java.util.StringTokenizer tok)

getContainsSet

public java.lang.String getContainsSet(scanpage sp,
                                       java.util.StringTokenizer tok)
Checks if a Session variable contains a certain value.

Returns:
"YES" if the session variable contains the specified value "NO" if the session variable doesn't contains the specified value

doGetSet

public java.util.Vector doGetSet(scanpage sp,
                                 java.util.StringTokenizer tok)

getSetString

public java.lang.String getSetString(scanpage sp,
                                     java.util.StringTokenizer tok)
returns the values of a session variable comma separated


getSetCount

public java.lang.String getSetCount(scanpage sp,
                                    java.util.StringTokenizer tok)
Gives the number of values contained by a certain session variable

Returns:
the number of values contained by the session variable

getSize

public int getSize()

state

public java.util.Hashtable state()
Description copied from class: Module
state, returns the state hashtable that is/can be used to debug. Should be overridden when live state should be done.

Overrides:
state in class Module

xmlEscape

public java.lang.String xmlEscape(java.lang.String s)
the XML reader will correct the escaped characters again. but scan will not evaluate the tags. only < has to be parsed to &<



MMBase build 1.7.1.20041002