|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--ami.AMIInputSpool
Manages and stores incoming AMI packets
Singleton
The AMIInputSpool contains static parts and multi-threaded instance parts
There are the same number of AMIReader than of AMIInputSpool threads
Field Summary | |
private AMICriteria |
ac
Used to parse crierias |
private static AMIInputSpool |
ais
Self instance used for signleton pattern |
private AMIQuery |
aqCurrent
Currently processed AMI query |
private boolean |
bPing
amiping flag, means that current packet is an amiping |
private static boolean |
bStop
boolean used to stop the thread |
private char[] |
cRawData
Processed raw data |
private static String |
sCurrentIP
Processed packet ip address as got by socket properties |
private static String |
sCurrentPort
Processed packet reply port |
private String |
sCurrentSign
Stores signature for further use |
(package private) String |
sProtocol
|
private String |
sSystemID
Contains the absolute path of the DTD used to validate the incoming XML stream |
(package private) Thread |
t
Thread used for auto-start |
(package private) Vector |
vParam
|
private Vector |
vPreQueries
Vector with queries being checked |
private static Vector |
vQueries
Stores new parsed and checked queries, first elements = max priority : FIFO |
private static Vector |
vRawData
Raw data vector, contains a 2 entries Object array : char[] rawData and String sIP |
Constructor Summary | |
private |
AMIInputSpool()
Default constructor |
Method Summary | |
private void |
addQuery(AMIQuery aq)
Adds and sorts queries by priority in vector vQueries |
(package private) boolean |
checkSignature(char[] cData,
char[] cProposedSignature,
AMIPublicKey apk)
Check signature of a packet signature is the hashcode of data between |
void |
endElement(String sUri,
String sName,
String sQName)
Called when we end an element |
static AMIInputSpool |
getInstance()
Return a self instance Implementation of the singleton pattern |
(package private) static void |
put(char[] cRawData,
String sIP)
Push an incoming packet to be parsed |
void |
run()
Thread loop used to check raw data vector, parse them and fill a query buffer |
void |
startDocument()
Called at parsing start |
void |
startElement(String sUri,
String sName,
String sQName,
org.xml.sax.Attributes attributes)
Called when we start an element |
(package private) static void |
stop()
Finalize the input spool |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static Vector vRawData
Thread t
private static AMIInputSpool ais
private static volatile boolean bStop
private String sCurrentSign
private static String sCurrentIP
private static String sCurrentPort
private char[] cRawData
private static Vector vQueries
private boolean bPing
private Vector vPreQueries
private AMIQuery aqCurrent
private AMICriteria ac
private String sSystemID
String sProtocol
Vector vParam
Constructor Detail |
private AMIInputSpool() throws AMIException
Method Detail |
public static AMIInputSpool getInstance() throws AMIException
Implementation of the singleton pattern
public void run()
run
in interface Runnable
static void put(char[] cRawData, String sIP) throws AMIException
cRawData
- raw packet data ( with headers dropped )sIP
- Incoming peer IP as detected by socket propertiesstatic void stop()
public void startDocument()
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(String sUri, String sName, String sQName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in class org.xml.sax.helpers.DefaultHandler
sUri
- Description of ParametersName
- Description of ParametersQName
- Description of Parameterattributes
- Description of Parameterorg.xml.sax.SAXException
- Description of Exceptionpublic void endElement(String sUri, String sName, String sQName) throws org.xml.sax.SAXException
endElement
in class org.xml.sax.helpers.DefaultHandler
sUri
- Description of ParametersName
- Description of ParametersQName
- Description of Parameterorg.xml.sax.SAXException
- Description of Exceptionprivate void addQuery(AMIQuery aq)
boolean checkSignature(char[] cData, char[] cProposedSignature, AMIPublicKey apk) throws AMIException
cData
- raw datacProposedSignature
- signature as given in amipacketapk
- the amipublic key of the packet sender
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |