|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ami.AMIUtil
Convenient methods for AMI engine
Field Summary | |
(package private) static long |
MAX
Get an AMIPacket and return a byte array ready to be sent |
Constructor Summary | |
AMIUtil()
|
Method Summary | |
static AMIPublicKey |
amiping(String sIP)
Used to get the pu corresponding to an IP, Basicaly, sends an AMIping at given address and wait for answer |
(package private) static byte[] |
bfDecode(byte[] bIn)
Used to factorise blowfish code utilation in: byte array to decode out: decoded byte array |
(package private) static byte[] |
bfEncode(byte[] bIn)
Used to factorise blowfish code utilation in: byte array to encode out: encoded byte array We can't work with lines because a encoded string can contain an '\n'. |
static boolean |
check(AMIPublicKey apk,
String sIP)
Used to check if a given pu matchs a given ip, the real check is done only if the RT entry is no more trusted ( DLC too old ) |
static boolean |
checkIPAddress(String sIPAddress)
Check an IP address under format ip:port , no port completion |
static boolean |
checkIPAddress(String sIPAddress,
boolean bPortCompletion)
Check an IP address under format ip:port |
static String |
closeTag(String sTag)
Add closing brackets for a string |
static void |
commitAIS(String sAIS)
Write an AIS to in.xml file |
static String |
completeIPAddress(String sIPAddress)
Returns completed IP address under format ip:port Assumes that given IP is correct ( ip or ip:port ) |
(package private) static void |
decodeFile(File fIn)
Used to decode a file with extention "amis" to a clear file with extention "ami" |
static boolean |
forcedCheck(AMIPublicKey apk,
String sIP)
Used to check if a given pu matchs a given ip, the real check is always done |
(package private) static String |
getRandomID()
Return a random ID on 32 bits in radix specified as AMILocalParameter.RADIX_REPRESENTATION |
static String |
getRandomID4()
|
static String |
openTag(String sTag)
Add opening brackets for a string |
(package private) static void |
parseXML(char[] cRawData,
org.xml.sax.helpers.DefaultHandler dh,
boolean bValidating,
String sSystemID)
This is a generic method to parse a XML file using SAX and using the given Handler. |
(package private) static void |
parseXML(String sFileName,
org.xml.sax.helpers.DefaultHandler dh,
boolean bValidating)
This is a generic method to parse a XML file using SAX and using the given Handler. |
(package private) static long |
secondsSince(long lDate)
Return nb seconds since the given date ( lDate is in sec ) |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long MAX
Constructor Detail |
public AMIUtil()
Method Detail |
static long secondsSince(long lDate)
static void parseXML(String sFileName, org.xml.sax.helpers.DefaultHandler dh, boolean bValidating) throws Exception
static void parseXML(char[] cRawData, org.xml.sax.helpers.DefaultHandler dh, boolean bValidating, String sSystemID) throws Exception
cRawData
- Raw data to processdh
- class used as handler ( tells what to do with incomming data )bValidating
- true if the xml stream is validated by a DTDsSystemID
- used to tell where is the DTD ( the static String getRandomID()
public static String getRandomID4()
public static void commitAIS(String sAIS) throws AMIException
String
- sAIS the AIS as a stringpublic static AMIPublicKey amiping(String sIP) throws AMIException
public static boolean check(AMIPublicKey apk, String sIP) throws AMIException
public static boolean forcedCheck(AMIPublicKey apk, String sIP)
static byte[] bfEncode(byte[] bIn) throws AMIException
static byte[] bfDecode(byte[] bIn) throws AMIException
static void decodeFile(File fIn) throws AMIException
public static String openTag(String sTag)
public static String closeTag(String sTag)
public static boolean checkIPAddress(String sIPAddress, boolean bPortCompletion)
String
- sIPAddress the ip address to be checkedboolean
- bCheckPort. If true, check also portpublic static boolean checkIPAddress(String sIPAddress)
String
- sIPAddress the ip address to be checkedpublic static String completeIPAddress(String sIPAddress)
Assumes that given IP is correct ( ip or ip:port )
String
- sIPAddress the ip address to be completed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |