irssibot.modules
Class UserTools

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--irssibot.modules.AbstractModule
              |
              +--irssibot.modules.UserTools
All Implemented Interfaces:
java.lang.Runnable

public class UserTools
extends AbstractModule


Field Summary
private  ServerConnection caller
           
private  Core core
          Core reference
private  Host host
           
private  boolean isOk
           
private static java.lang.String moduleInfo
           
private  java.lang.String source
           
 
Fields inherited from class irssibot.modules.AbstractModule
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UserTools()
          Default constructor
 
Method Summary
private  void commandAdd(Host host, User invoker, java.lang.String[] args, Channel channel)
          add command
private  void commandDel(Host host, User invoker, java.lang.String[] args, Channel channel)
          del command
private  void commandEdit(Host host, User invoker, java.lang.String[] args, Channel channel)
          edit command.
private  void commandList(Host host, User invoker, java.lang.String[] args, Channel channel)
          list command
private  void doPrivmsg(IrcMessage message)
          Handles PRIVMSGs
 java.lang.String getModuleInfo()
          returns a module info string
 java.util.Properties getState()
          Gets module's state as a Properties object.
 boolean onLoad(java.util.Properties state, Core core)
          Called upon loading the module.
 void onUnload()
          Called upon unloading the module.
private  void processCmdMsg(Host host, java.lang.String cmd, Channel channel, java.lang.String[] args)
          Process command message.
protected  void processMessage(IrcMessage message, ServerConnection serverConnection)
          Processes incoming IrcMessages from a ServerConnection
private  void write(java.lang.String message)
          Sends message to source (channel/user)
 
Methods inherited from class irssibot.modules.AbstractModule
addMessage, killModule, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

moduleInfo

private static java.lang.String moduleInfo

host

private Host host

source

private java.lang.String source

caller

private ServerConnection caller

isOk

private boolean isOk

core

private Core core
Core reference

Constructor Detail

UserTools

public UserTools()
Default constructor

Method Detail

getState

public java.util.Properties getState()
Description copied from class: AbstractModule
Gets module's state as a Properties object. If module does not wish to save state OR its state has not been changed since last getState(), it should return null. This is to minimize disk access.

Overrides:
getState in class AbstractModule
Returns:
state of module as a Properties object

getModuleInfo

public java.lang.String getModuleInfo()
returns a module info string

Specified by:
getModuleInfo in class AbstractModule
Returns:
module info string

onLoad

public boolean onLoad(java.util.Properties state,
                      Core core)
Description copied from class: AbstractModule
Called upon loading the module.

Overrides:
onLoad in class AbstractModule
Parameters:
state - the initial state of module as an Properties object, or null if no state was saved for module.
core - a Core instance. this can be used to initialize module if no state was retrieved.
Returns:
true if ok, false if error. modules returning false from onLoad() will be unloaded immediately.
See Also:
Core

onUnload

public void onUnload()
Description copied from class: AbstractModule
Called upon unloading the module.

Overrides:
onUnload in class AbstractModule

commandList

private void commandList(Host host,
                         User invoker,
                         java.lang.String[] args,
                         Channel channel)
list command

Parameters:
host - host of invoker
invoker - invoking User
args - arguments of command
channel - target channel

commandAdd

private void commandAdd(Host host,
                        User invoker,
                        java.lang.String[] args,
                        Channel channel)
add command

Parameters:
host - host of invoker
invoker - invoking User
args - arguments of command
channel - target channel

commandEdit

private void commandEdit(Host host,
                         User invoker,
                         java.lang.String[] args,
                         Channel channel)
edit command. edits

commandDel

private void commandDel(Host host,
                        User invoker,
                        java.lang.String[] args,
                        Channel channel)
del command

Parameters:
host - host of invoker
invoker - invoking User
args - arguments of command
channel - target channel

processCmdMsg

private void processCmdMsg(Host host,
                           java.lang.String cmd,
                           Channel channel,
                           java.lang.String[] args)
Process command message. assuming valid channel argument.

Parameters:
channel - valid channel name

doPrivmsg

private void doPrivmsg(IrcMessage message)
Handles PRIVMSGs

Parameters:
message - PRIVMSG IrcMessage to process

processMessage

protected void processMessage(IrcMessage message,
                              ServerConnection serverConnection)
Processes incoming IrcMessages from a ServerConnection

Specified by:
processMessage in class AbstractModule
Parameters:
message - IrcMessage to process
serverConnection - invoking ServerConnection

write

private void write(java.lang.String message)
Sends message to source (channel/user)

Parameters:
message - message to send


IrssiBot (c) 2000-2002 Matti Dahlbom