org.ssonet.mechanisms.anonymity
Class JAPAnonLevelChecker

java.lang.Object
  |
  +--org.ssonet.mechanisms.anonymity.JAPAnonLevelChecker
All Implemented Interfaces:
java.lang.Runnable

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

This class implements a thread, which periodically checks the anonymity level of the choosen AnonServer, and calls the


Field Summary
(package private)  anon.AnonServer anonServer
          the AnonServer used for this connection
(package private)  java.lang.Thread checkerThread
          The Thread, in which the checker runs.
(package private)  org.ssonet.net.SSONETContext context
          the SSONETContext for this connection
(package private)  int currentLevel
          current anonymity level
(package private)  int currentState
          Current anonymity state
(package private)  boolean debug
          for debugging purposes only: switch debug-messages on or off
(package private)  anon.infoservice.InfoService infoService
          the InfoService to ask for the anonymity level
(package private)  boolean running
          true, if the checker is running, false otherwise
(package private)  java.net.Socket socket
          The Socket, which is connected through the AnonServer
 
Constructor Summary
JAPAnonLevelChecker(org.ssonet.net.SSONETContext context, anon.infoservice.InfoService infoService, anon.AnonServer anonServer)
          Creates and initializes a JAPAnonLevelChecker.
 
Method Summary
 void run()
          This method periodically checks the anonymity level of the AnonServer and sends warning- or abort-messages to the AnonymityListeners registered in the context.
 void start(java.net.Socket socket)
          Starts the JAPAnonLevelChecker.
 void stop()
          Stops the JAPAnonLevelChecker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

boolean debug
for debugging purposes only: switch debug-messages on or off


running

boolean running
true, if the checker is running, false otherwise


context

org.ssonet.net.SSONETContext context
the SSONETContext for this connection


infoService

anon.infoservice.InfoService infoService
the InfoService to ask for the anonymity level


anonServer

anon.AnonServer anonServer
the AnonServer used for this connection


socket

java.net.Socket socket
The Socket, which is connected through the AnonServer


checkerThread

java.lang.Thread checkerThread
The Thread, in which the checker runs.


currentState

int currentState
Current anonymity state


currentLevel

int currentLevel
current anonymity level

Constructor Detail

JAPAnonLevelChecker

public JAPAnonLevelChecker(org.ssonet.net.SSONETContext context,
                           anon.infoservice.InfoService infoService,
                           anon.AnonServer anonServer)
Creates and initializes a JAPAnonLevelChecker.

Parameters:
context - the SSONETContext for the connection, for which the anonLevel is to be checked
infoService - the InfoService to ask for the anonLevel
anonServer - the AnonServer, through which the connection goes
Method Detail

run

public void run()
This method periodically checks the anonymity level of the AnonServer and sends warning- or abort-messages to the AnonymityListeners registered in the context. On an abort-message the Socket is closed, i.e. the connection is aborted.

Specified by:
run in interface java.lang.Runnable

start

public void start(java.net.Socket socket)
Starts the JAPAnonLevelChecker.

Parameters:
socket - the Socket, which is connected through the AnonServer.

stop

public void stop()
Stops the JAPAnonLevelChecker.



Copyright © 2003 DRIM Team. All Rights Reserved.