ami
Class AMIInputProcessor

java.lang.Object
  |
  +--ami.AMIInputProcessor
All Implemented Interfaces:
Runnable

public final class AMIInputProcessor
extends Object
implements Runnable

Processor used to analyse incomming queries and to manage them ( reply to an amiping, broadcast an AR ...)

Version:
1.0
Author:
Bertrand Florat

Field Summary
private  AMIQuery aq
          Query to process
private  AMIQuery aqVoid
          void query used for synchronization
private  boolean bStop
          boolean used to stop the thread
private static Hashtable hAmiping
          Hashtable mapping IP with amiping pu results ( synchronous query )
(package private)  Thread t
          Thread used for auto-start
private static Vector vProcessors
          Contains all AMIInputProcessor
 
Constructor Summary
(package private) AMIInputProcessor()
          Default constructor
 
Method Summary
(package private) static void createProcessors(int iNbProcessors)
          Used to instancate n processors, n must be equals to nb readers
(package private) static int evaluateIaiInformation(AMIiai iai)
          Used to avaluate interrest of the iai and stores results if it is a reply for an AR Note that the fact of having unknown putr is not concidered as new result
(package private) static Hashtable getAmipingTable()
          Returns the amiping table ( used by AMISenders )
(package private) static AMIInputProcessor getProcessor()
          Get next available processor
(package private)  AMIQuery getQuery()
          Returns current processed query
(package private)  boolean isAvailable()
          Returns availability of the processor
(package private) static void process(AMIQuery aq)
          processes new queries
(package private) static void processAmiping(AMIping aping)
          processes incoming amiping
(package private) static void processAr(AMIar ar)
          processes incoming ar assumes ( thanks to input spool ) that: - TTL is ok
(package private) static void processIai(AMIiai iai)
          processes incoming iai
 void run()
          Thread used to process new queries assumes that Input queries are validated and well-formed ( XML and AMI level ).
(package private)  void setQuery(AMIQuery aq)
          Convenient method to notify new data to process
(package private)  void stop()
          Finalize the input processor
(package private) static void stopAll()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

hAmiping

private static Hashtable hAmiping
Hashtable mapping IP with amiping pu results ( synchronous query )

bStop

private volatile boolean bStop
boolean used to stop the thread

vProcessors

private static Vector vProcessors
Contains all AMIInputProcessor

aqVoid

private AMIQuery aqVoid
void query used for synchronization

aq

private AMIQuery aq
Query to process

t

Thread t
Thread used for auto-start
Constructor Detail

AMIInputProcessor

AMIInputProcessor()
Default constructor
Method Detail

createProcessors

static void createProcessors(int iNbProcessors)
Used to instancate n processors, n must be equals to nb readers

getProcessor

static AMIInputProcessor getProcessor()
Get next available processor
Returns:

next available processor

null if no one is available


isAvailable

boolean isAvailable()
Returns availability of the processor

getQuery

AMIQuery getQuery()
Returns current processed query

run

public void run()
Thread used to process new queries assumes that
Specified by:
run in interface Runnable

setQuery

void setQuery(AMIQuery aq)
Convenient method to notify new data to process

getAmipingTable

static Hashtable getAmipingTable()
Returns the amiping table ( used by AMISenders )

process

static void process(AMIQuery aq)
             throws AMIException
processes new queries

processAmiping

static void processAmiping(AMIping aping)
                    throws AMIException
processes incoming amiping

processIai

static void processIai(AMIiai iai)
                throws AMIException
processes incoming iai

evaluateIaiInformation

static int evaluateIaiInformation(AMIiai iai)
                           throws AMIException
Used to avaluate interrest of the iai and stores results if it is a reply for an AR Note that the fact of having unknown putr is not concidered as new result
Returns:

-1 if information is wrong

0 if information is right but known or non-ami AR

1 if information is right and new

Throws:
AMIException -  

processAr

static void processAr(AMIar ar)
               throws AMIException
processes incoming ar assumes ( thanks to input spool ) that: - TTL is ok

stop

void stop()
Finalize the input processor

stopAll

static void stopAll()