lowinteraction
Class LIModule

java.lang.Object
  extended by lowinteraction.LIModule
All Implemented Interfaces:
java.lang.Runnable

public class LIModule
extends java.lang.Object
implements java.lang.Runnable

An LIModule listens on a port specified by a LIProtocol and launches threads to handle client connections. LIModules are part of a HoneyRJ

Author:
Eric Peter
See Also:
HoneyRJ, LIModuleThread

Constructor Summary
LIModule(LIProtocol protocol)
          Create the module from the given protocol
 
Method Summary
 HoneyRJ getParent()
           
 int getPort()
          return the port this Module listens on (as defined by the protocol)
 LIProtocol getProtocol()
           
 boolean isStarted()
          Has our thread been created/socket started?
 void pauseListeningForConnections()
          Stop listening for client connections temporarily
protected  void recieveLogFileFromThread(LogFile file)
          A child thread that is communicating with a client should call this method upon closing the connection to store the log
 void registerParent(HoneyRJ honey)
          Called once a HoneyRJ adds this module to itself.
 void run()
          thread run method start listening on the socket and launch sub-threads to handle connections when clients connect
 void startInteractionModule()
          Launch into a thread and start listening for client connections
 void startListeningForConnections()
          instruct the module to begin listening does nothing if module is already started
 void stopInteractionModule()
          Stops listening, stores the log into the HoneyRJ parent and stops the thread.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LIModule

public LIModule(LIProtocol protocol)
Create the module from the given protocol

Parameters:
protocol - LIProtcol object to implement here
See Also:
LIProtocol
Method Detail

getPort

public int getPort()
return the port this Module listens on (as defined by the protocol)

Returns:
the port this Module listens on (as defined by the protocol)
See Also:
LIProtocol.getPort()

registerParent

public void registerParent(HoneyRJ honey)
Called once a HoneyRJ adds this module to itself. Allows this module to be created in memory but not yet registered to a HoneyRJ

Parameters:
honey - parent HoneyRJ
See Also:
HoneyRJ.RegisterService(LIModule)

run

public void run()
thread run method start listening on the socket and launch sub-threads to handle connections when clients connect

Specified by:
run in interface java.lang.Runnable

startListeningForConnections

public void startListeningForConnections()
instruct the module to begin listening does nothing if module is already started


getParent

public HoneyRJ getParent()
Returns:
HoneyRJ that is our parent

pauseListeningForConnections

public void pauseListeningForConnections()
Stop listening for client connections temporarily


startInteractionModule

public void startInteractionModule()
                            throws java.io.IOException
Launch into a thread and start listening for client connections

Throws:
java.io.IOException - if the socket can't be started

stopInteractionModule

public void stopInteractionModule()
Stops listening, stores the log into the HoneyRJ parent and stops the thread.


getProtocol

public LIProtocol getProtocol()
Returns:
the protocol

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isStarted

public boolean isStarted()
Has our thread been created/socket started?

Returns:
True if yes.

recieveLogFileFromThread

protected void recieveLogFileFromThread(LogFile file)
A child thread that is communicating with a client should call this method upon closing the connection to store the log

Parameters:
file -