|
||||||||||
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.AMILocalParameter
Stores current AMI parameters.
We find three parameters types:
Field Summary | |
private static AMILocalParameter |
alp
|
(package private) static float |
AMIPING_FACTOR
CHECK_INTERVAL * AMIPING_FACTOR is the time sleep between two checks |
private static AMIPasswordWindow |
apw
|
private static byte[] |
bPreK
|
(package private) static int |
BUFFER_SIZE
sender default buffer size, ok for most puroposes ( ex: an IAI is about 500 characters-long ) |
static int |
DEFAULT_BONUS
Standard value of the performance points gained after a right reply |
(package private) static String |
DEFAULT_LANGUAGE
Default language |
static int |
DEFAULT_MALUS
Standard value of the performance points removed after a wrong reply |
(package private) static int |
DEFAULT_PORT
AMI default port |
private Hashtable |
hParam
|
private static Hashtable |
hPriorityTable
Used to store priority weights for common queries |
private static Hashtable |
hProtocolAvailable
Stores availability for all protocols |
private static HashMap |
hProtocolLanguageDescription
Stores protocols descriptions in any language protocol name -> HashMap language ( string) - > String description for this protocol |
private static Hashtable |
hProtocolParam
Stores parameters for all protocols protocol name -> hashtable hParam hParam : param name -> param value |
private static HashMap |
hProtocolParamFormat
Stores parameters descriptions in any language protocol name -> hashmap parameter name -> hashmap language -> parameter description |
private static HashMap |
hProtocolParamLanguageDescription
Stores parameters format protocol name -> hashmap parameter name -> String[] [ type,minlength,maxlength,minvalue,maxvalue,default ] null if not applicable |
private static Hashtable |
hProtocolSecure
Stores security flag for all protocols |
private static Hashtable |
hProtocolSet
Stores sets for all protocols protocol name -> hashtable hParam hParam : param name -> vector vector -> n param value strings |
private static InetAddress |
iaIP
|
(package private) static int |
INITIAL_SENDER_NUMBER
number of senders at begining |
(package private) int |
iNoteType
Used to store parsing states 0=protocol description note1=parameter description note |
private static Object[] |
k
|
(package private) static int |
LEVEL_1_PERIOD
used by cleanrt AIS, period in sec |
(package private) static int |
LEVEL_2_PERF
used by cleanrt AIS, perf |
static int |
MAX_ALIAS_LENGTH
Alias max size |
(package private) static int |
MAX_ALIAS_SIZE
maximum size for the alias |
static int |
MAX_COMMENT_LENGTH
Comment max size |
(package private) static int |
MAX_TTL
Maximum allowed TTL |
static int |
MIN_ALIAS_LENGTH
Alias min size |
static int |
MIN_COMMENT_LENGTH
Comment min size |
static int |
MIN_PASSWORD_SIZE
Minimum passwork size |
(package private) static int |
NB_TRIES
nb of allowed tries for password |
(package private) static int |
OUTPUT_BUFFER_FACTOR
nb cycles we wait when output processor buffer is full |
private static AMIPrivateKey |
pr
|
private static AMIPublicKey |
pu
|
(package private) static int |
RADIX_REPRESENTATION
RADIX for storage |
static String |
sAlias
|
private static String |
sAMIPath
|
(package private) String |
sParsedParam
Stores currently parsed parameter |
(package private) String |
sParsedSet
Stores currently parsed set |
private String |
sProtocol
|
Constructor Summary | |
private |
AMILocalParameter(String sAMIPath)
parameters are stored this way: Hashtable hProtocolParam ( protocol name, Hashtable parameters list) Hashtable parameter list (param name,value) |
Method Summary | |
(package private) static void |
|
(package private) static void |
addProtocol(String sProtocol,
String sFileName,
String sSecure)
Add a new protocol |
static void |
addSetEntry(String sProtocol,
String sSet,
String sValue)
Add an entry in a set |
static boolean |
checkFormat(String sProtocol,
String sParam,
String sValue)
Check format for a parameter Assumes boundaries and all formats are correct and in right format |
(package private) void |
chgpass(boolean bGui)
Method used to alter AMI symetrical key |
(package private) static void |
commit()
commit : serialize parameters of the protocol into XML files |
static void |
createSet(String sProtocol,
String sSet)
Create a void set |
(package private) static String |
displayParameters(String sProtocol)
Displays all params values for a given protocol, used mainly for debug |
void |
endElement(String sUri,
String sName,
String sQName)
Called when we end an element |
(package private) static String |
getAlias()
Return own alias ( quick access ) |
static HashMap |
getFormats()
Return format table |
(package private) static String |
getFullIP()
Return IP with port : ex: 10.0.0.0:1000 |
(package private) static String |
getHostname()
Return host name |
(package private) static InetAddress |
getInetAddress()
Return own full InetAddress (with host name...) |
static AMILocalParameter |
getInstance(String sAMIPath)
AMILocalParameter is a singleton, this method returns it |
(package private) static String |
getIP()
Return own IP address under numeric format |
(package private) static Object[] |
getK()
Return the symmetrical key |
static byte[] |
getKInit()
Return the non-computed symmetrical key |
static String |
getLocal()
Returns the language in use |
(package private) static String |
getManualPassphrase(boolean bConfirmation,
String sLabel)
Ask user for a password ( text mode ) and check it |
static String |
getParamDefaultValue(String sProtocol,
String sParam)
Get default value as a string for a protocol and a parameter |
static HashMap |
getParamDescriptions()
Return parameters description table |
static String |
getParameterDescription(String sProtocol,
String sParam,
String sLang)
Get Description for a protocol, a parameter and a language |
(package private) static int |
getParamMaxLength(String sProtocol,
String sParam)
Get maxlength for a protocol and a parameter |
(package private) static int |
getParamMaxValue(String sProtocol,
String sParam)
Get max value for a protocol and a parameter |
(package private) static int |
getParamMinLength(String sProtocol,
String sParam)
Get minlength for a protocol and a parameter |
(package private) static int |
getParamMinValue(String sProtocol,
String sParam)
Get min value for a protocol and a parameter |
static Hashtable |
getParams()
Return parameters table |
(package private) static String |
getParamType(String sProtocol,
String sParam)
Get type for a protocol and a parameter |
static String |
getPath()
Returns the amipath |
(package private) static AMIPrivateKey |
getPr()
Return the private key |
(package private) static int |
getPriority(String sType)
Return the prority according to query type |
(package private) static String |
getProtocolDescription(String sProtocol,
String sLang)
Get Description for a protocol and a language |
static HashMap |
getProtocolDescriptions()
Return protocol description table |
static AMIPublicKey |
getPu()
Return the public key |
static Hashtable |
getSetArray()
Return the full set array |
static Enumeration |
getSetEnumeration(String sProtocol,
String sSet)
Return an enumeration of entries for a set |
static int |
intValue(String sProtocol,
String sParam)
Return the parameter as an int |
static boolean |
isAvailable(String sProtocol)
Return true if a protocol is available |
static boolean |
isInstanciated()
return true if this AMILocalParameter is instanciated |
static boolean |
isSecure(String sProtocol)
Says if a protocol is in secure mode |
void |
keyPressed(KeyEvent ke)
put your documentation comment here |
void |
keyReleased(KeyEvent ke)
put your documentation comment here |
void |
keyTyped(KeyEvent ke)
put your documentation comment here |
(package private) void |
loadPassphrase()
Called by main class to load password panel |
(package private) void |
loadPassphrase(String sDefault)
Called by main class to load password panel with default password |
(package private) static long |
longValue(String sProtocol,
String sParam)
Return the parameter as an long |
static void |
parseParameters()
Called by main class to start parameter files parsing |
(package private) static void |
reinitParam(String sProtocol,
String sParam)
Set default value for this param |
(package private) static void |
reinitProtocol(String sProtocol)
Re-init all parameters for a protocol |
static void |
removeProtocol(String sProtocol)
Remove a protocol |
static void |
removeSetEntry(String sProtocol,
String sSet,
String sValue)
Remove an entry from a set |
(package private) static void |
setAlias(String sAlias)
Set value of ALIAS ( used at installation ) |
static void |
setAvailable(String sProtocol,
String sAvailable)
Set availability of the given protocol |
static boolean |
setContains(String sProtocol,
String sSet,
String sValue)
Return true if the set given contains the entry |
static void |
setK(String sPass)
Set new password ( used during installation ) |
(package private) static void |
setParamDescription(String sProtocol,
String sParam,
String sLang,
String sDescription)
Set Description for a parameter in a protocol and a language |
static void |
setParameter(String sProtocol,
String sParam,
String sValue)
Set a value, the entry in parameters tables is created by setParamFormat method |
(package private) static void |
setParamFormat(String sProtocol,
String sParam,
String sType,
String sMinLength,
String sMaxLength,
String sMinValue,
String sMaxValue,
String sDefaultValue)
Set parameter format |
(package private) void |
setPassphrase(String sPass)
Called by main class in text mode to process the key directly |
(package private) static void |
setPR(AMIPrivateKey apr)
Set value of PR ( used at key generation ) |
(package private) static void |
setProtocolDescription(String sProtocol,
String sLang,
String sDescription)
Set Description for a protocol and a language |
(package private) static void |
setPU(AMIPublicKey apu)
Set value of PU ( used at key generation ) |
static void |
setSecure(String sProtocol,
String sSecure)
Set secure mode of the given protocol |
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 |
void |
startPrefixMapping(String sPrefix,
String sUri)
Called to process namespaces |
static String |
stringValue(String sProtocol,
String sParam)
Return the parameter as a String |
(package private) static void |
updateUserFile()
Updates or creates user file |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
private static AMILocalParameter alp
private String sProtocol
private Hashtable hParam
private static Hashtable hProtocolParam
protocol name -> hashtable hParam
hParam : param name -> param value
private static Hashtable hProtocolSet
protocol name -> hashtable hParam
hParam : param name -> vector
vector -> n param value strings
private static HashMap hProtocolLanguageDescription
protocol name -> HashMap
language ( string) - > String description for this protocol
private static HashMap hProtocolParamFormat
protocol name -> hashmap
parameter name -> hashmap
language -> parameter description
private static HashMap hProtocolParamLanguageDescription
protocol name -> hashmap
parameter name -> String[] [ type,minlength,maxlength,minvalue,maxvalue,default ] null if not applicable
private static Hashtable hProtocolAvailable
private static Hashtable hProtocolSecure
private static String sAMIPath
private static Hashtable hPriorityTable
private static InetAddress iaIP
private static AMIPublicKey pu
private static AMIPrivateKey pr
public static String sAlias
private static byte[] bPreK
private static Object[] k
private static AMIPasswordWindow apw
public static final int MIN_PASSWORD_SIZE
static final int RADIX_REPRESENTATION
static final int MAX_TTL
static final int LEVEL_1_PERIOD
static final int LEVEL_2_PERF
static final int INITIAL_SENDER_NUMBER
static final int OUTPUT_BUFFER_FACTOR
static final float AMIPING_FACTOR
static final int BUFFER_SIZE
static final int NB_TRIES
static final int DEFAULT_PORT
static final int MAX_ALIAS_SIZE
static final String DEFAULT_LANGUAGE
public static final int MIN_ALIAS_LENGTH
public static final int MAX_ALIAS_LENGTH
public static final int MIN_COMMENT_LENGTH
public static final int MAX_COMMENT_LENGTH
public static final int DEFAULT_BONUS
public static final int DEFAULT_MALUS
int iNoteType
0=protocol description note
1=parameter description note
String sParsedParam
String sParsedSet
Constructor Detail |
private AMILocalParameter(String sAMIPath) throws Exception
sAMIPath
- Description of ParameterException
- Description of ExceptionMethod Detail |
static void()
public static AMILocalParameter getInstance(String sAMIPath) throws Exception
void loadPassphrase() throws AMIException
void loadPassphrase(String sDefault) throws AMIException
void setPassphrase(String sPass)
public static void parseParameters() throws AMIException
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 Exceptionpublic void startPrefixMapping(String sPrefix, String sUri) throws org.xml.sax.SAXException
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
sPrefix
- Description of ParametersUri
- Description of Parameterorg.xml.sax.SAXException
- Description of Exceptionpublic static void setParameter(String sProtocol, String sParam, String sValue) throws AMIException
sProtocol
- The new Parameter valuesParam
- The new Parameter valuesValue
- The new Parameter valueAMIException
- Description of Exceptionpublic static boolean isSecure(String sProtocol)
sProtocol
- Description of Parameterpublic static boolean isAvailable(String sProtocol) throws AMIException
sProtocol
- Description of Parameterpublic static void setAvailable(String sProtocol, String sAvailable) throws AMIException
sProtocol
- Description of ParametersAvailable
- "true" or "false"public static void setSecure(String sProtocol, String sSecure) throws AMIException
sProtocol
- Description of ParametersSecure
- "true" or "false"static void addProtocol(String sProtocol, String sFileName, String sSecure) throws AMIException
sProtocol
- Description of Parameterpublic static void removeProtocol(String sProtocol) throws AMIException
sProtocol
- Description of Parameterpublic static int intValue(String sProtocol, String sParam) throws AMIException
sProtocol
- Description of ParametersParam
- Description of ParameterAMIException
- Description of Exceptionpublic static String getLocal()
public static String getPath()
static long longValue(String sProtocol, String sParam) throws AMIException
sProtocol
- Description of ParametersParam
- Description of ParameterAMIException
- Description of Exceptionpublic static String stringValue(String sProtocol, String sParam) throws AMIException
sProtocol
- Description of ParametersParam
- Description of ParameterAMIException
- Description of Exceptionpublic static Hashtable getSetArray()
public static Enumeration getSetEnumeration(String sProtocol, String sSet) throws AMIException
sProtocol
- protocolsSet
- set nameAMIException
- Description of Exceptionpublic static boolean setContains(String sProtocol, String sSet, String sValue) throws AMIException
sProtocol
- protocolsSet
- set namesValue
- value to be checkedAMIException
- Description of Exceptionpublic static void addSetEntry(String sProtocol, String sSet, String sValue) throws AMIException
sProtocol
- protocolsSet
- set namesValue
- value to add in the setAMIException
- Description of Exceptionpublic static void createSet(String sProtocol, String sSet)
public static void removeSetEntry(String sProtocol, String sSet, String sValue) throws AMIException
sProtocol
- protocolsSet
- set namesValue
- value to removeAMIException
- Description of Exceptionstatic void updateUserFile()
static void commit() throws AMIException
AMIException
- Description of Exceptionstatic int getPriority(String sType)
static String getIP()
static String getFullIP()
static InetAddress getInetAddress()
static String getHostname()
static String getProtocolDescription(String sProtocol, String sLang)
sProtocol
- Protocol namesLang
- Description languagestatic void setProtocolDescription(String sProtocol, String sLang, String sDescription)
sProtocol
- Protocol namesLang
- Description languagesDescription
- the descriptionpublic static String getParameterDescription(String sProtocol, String sParam, String sLang)
sProtocol
- Protocol namesParam
- Parameter namesLang
- Description languagestatic void setParamDescription(String sProtocol, String sParam, String sLang, String sDescription)
sProtocol
- Protocol namesParam
- Parameter namesLang
- Description languagesDescription
- the descriptionstatic String getParamType(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic int getParamMinLength(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic int getParamMaxLength(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic int getParamMinValue(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic int getParamMaxValue(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterpublic static String getParamDefaultValue(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic void setParamFormat(String sProtocol, String sParam, String sType, String sMinLength, String sMaxLength, String sMinValue, String sMaxValue, String sDefaultValue)
sProtocol
- Protocol namesParam
- parameterString
- sType : int|string|boolean|floatString
- sMinlengthString
- sMaxlengthString
- sMinValueString
- sMaxValueString
- sDefaultValuestatic void reinitParam(String sProtocol, String sParam)
sProtocol
- Protocol namesParam
- parameterstatic void reinitProtocol(String sProtocol)
sProtocol
- Protocol namepublic static boolean checkFormat(String sProtocol, String sParam, String sValue)
Assumes boundaries and all formats are correct and in right format
sProtocol
- Protocol namesParam
- parameterString
- sValuepublic void keyPressed(KeyEvent ke)
keyPressed
in interface KeyListener
ke
- public void keyReleased(KeyEvent ke)
keyReleased
in interface KeyListener
ke
- public void keyTyped(KeyEvent ke)
keyTyped
in interface KeyListener
ke
- public static AMIPublicKey getPu()
static String getAlias()
public static Hashtable getParams()
public static HashMap getFormats()
public static HashMap getProtocolDescriptions()
public static HashMap getParamDescriptions()
static AMIPrivateKey getPr()
static Object[] getK()
public static byte[] getKInit()
static void setPU(AMIPublicKey apu) throws AMIException
static void setPR(AMIPrivateKey apr) throws AMIException
static void setAlias(String sAlias) throws AMIException
public static void setK(String sPass) throws AMIException
void chgpass(boolean bGui)
public static boolean isInstanciated()
static String getManualPassphrase(boolean bConfirmation, String sLabel) throws AMIException
static String displayParameters(String sProtocol)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |