amisample
Class ASUtil

java.lang.Object
  |
  +--amisample.ASUtil

public class ASUtil
extends Object

Set of utility methods used by amisample project

Version:
1.0
Author:
Bertrand Florat

Field Summary
private static String access
           
private static ArrayList al
           
private static String arg
           
private static String code
           
private static String id
           
private static String name
           
private static Random random
          A randomizer
private static String value
           
 
Constructor Summary
ASUtil()
           
 
Method Summary
(package private) static String addAMISet(String sParam, String sValue)
          Add a new entry in the given set
(package private) static void addAR(String sParam, String sValue, org.xml.sax.helpers.DefaultHandler dh, String sID)
          Perform a discovery AR
(package private) static String deleteAMISet(String sParam, String sElement)
          Send an AIS set remove query to drop an amiset element
(package private) static String getRandomID()
          Return a random ID on 32 bits in radix 36
(package private) static String loadAMIParam(String sParam)
          Send an AIS parameter query and parse it, then load the value
(package private) static ArrayList loadAMISet(String sParam)
          Send an AIS set query and parse it, then load the value
(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.
protected  void sendAR()
          Perform an AMI Address Request to get list of substribed IPs
private static void writeAIS(String sAIS)
          Access to in.xml file
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

random

private static Random random
A randomizer

name

private static String name

id

private static String id

arg

private static String arg

value

private static String value

access

private static String access

code

private static String code

al

private static ArrayList al
Constructor Detail

ASUtil

public ASUtil()
Method Detail

sendAR

protected void sendAR()
Perform an AMI Address Request to get list of substribed IPs

writeAIS

private static void writeAIS(String sAIS)
                      throws ASException
Access to in.xml file
Parameters:
sAIS - the AIS

getRandomID

static String getRandomID()
Return a random ID on 32 bits in radix 36

loadAMIParam

static String loadAMIParam(String sParam)
                    throws ASException
Send an AIS parameter query and parse it, then load the value

loadAMISet

static ArrayList loadAMISet(String sParam)
                     throws ASException
Send an AIS set query and parse it, then load the value

deleteAMISet

static String deleteAMISet(String sParam,
                           String sElement)
                    throws ASException
Send an AIS set remove query to drop an amiset element
Parameters:
sParam - amiset for the element
sElement - element to drop from the amiset
Returns:
String return code ( "0" ) if ok
Throws:
ASException -  

addAMISet

static String addAMISet(String sParam,
                        String sValue)
                 throws ASException
Add a new entry in the given set
Parameters:
sParam - The set name
sValue - value to add
Returns:
String return code

addAR

static void addAR(String sParam,
                  String sValue,
                  org.xml.sax.helpers.DefaultHandler dh,
                  String sID)
           throws Exception
Perform a discovery AR
Parameters:
sParam - criteria parameter
sValue - criteria value
dh - the hanfler to parse the results
sID - AR id

parseXML

static void parseXML(String sFileName,
                     org.xml.sax.helpers.DefaultHandler dh,
                     boolean bValidating)
              throws ASException
This is a generic method to parse a XML file using SAX and using the given Handler. Read a file