ami
Class AMIPacket

java.lang.Object
  |
  +--ami.AMIPacket

class AMIPacket
extends Object

Stores an query with destination address and general internal features.

A packet can be sent either to an ip address ( direct mode without check ) or to a peer ( identified by its public key) and mapped with the rt.

Priority of the packet = average priority of queries inside

Note: A packet can contain only one AMIPing query and this one can't be mixed with any other query

Version:
1.0
Author:
Bertrand Florat

Field Summary
private  AMIPublicKey apk
           
private  boolean bPing
           
private  char[] cPacketXML
           
private  int iPriority
           
private  int iTTL
           
private  String sIP
           
private  Vector vQueries
           
 
Constructor Summary
(package private) AMIPacket(AMIPublicKey apk)
           
(package private) AMIPacket(String sIP)
           
 
Method Summary
(package private)  void addQuery(AMIQuery aq)
           
(package private)  boolean contains(AMIQuery aq)
          put your documentation comment here
(package private)  void decTTL()
          decrements time to live
(package private)  void generateXML()
          Used to refresh raw data of the packet Note that it includes HTTP tuneling and SOAP headers
(package private)  AMIPublicKey getApk()
          put your documentation comment here
(package private)  char[] getData()
          Get raw data
(package private)  String getIP()
          return destination IP ( format: ip:port )
(package private)  int getPriority()
          put your documentation comment here
(package private)  Vector getQueries()
          Get queries vector
(package private)  int getTTL()
          returns TTL
(package private)  boolean isPing()
          return bPing value
(package private)  void merge(AMIPacket ap)
          Merge two ami packets
private  void refreshPriority()
          put your documentation comment here
(package private)  void removeQuery(AMIQuery aq)
           
 String toString()
          Return a string representation of queries inside this packet
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

sIP

private String sIP

apk

private AMIPublicKey apk

iPriority

private int iPriority

vQueries

private Vector vQueries

cPacketXML

private char[] cPacketXML

iTTL

private int iTTL

bPing

private boolean bPing
Constructor Detail

AMIPacket

AMIPacket(String sIP)

AMIPacket

AMIPacket(AMIPublicKey apk)
Method Detail

addQuery

void addQuery(AMIQuery aq)

removeQuery

void removeQuery(AMIQuery aq)

refreshPriority

private void refreshPriority()
put your documentation comment here

generateXML

void generateXML()
Used to refresh raw data of the packet

Note that it includes HTTP tuneling and SOAP headers

Returns:
raw data as char array

contains

boolean contains(AMIQuery aq)
put your documentation comment here
Parameters:
aq -  
Returns:
boolean

getIP

String getIP()
return destination IP ( format: ip:port )
Returns:
ip

getApk

AMIPublicKey getApk()
put your documentation comment here
Returns:
the AMIPublicKey

getPriority

int getPriority()
put your documentation comment here
Returns:
the priority

getQueries

Vector getQueries()
Get queries vector
Returns:
queries vector

getData

char[] getData()
Get raw data
Returns:
raw data of the packet

decTTL

void decTTL()
decrements time to live

getTTL

int getTTL()
returns TTL

isPing

boolean isPing()
return bPing value

merge

void merge(AMIPacket ap)
Merge two ami packets

toString

public String toString()
Return a string representation of queries inside this packet
Overrides:
toString in class Object