|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectGenerateJavaDictionary
Class to generate an AXL Radius Vendor dictionary .java file from a dictionary file.
This class is used to generate the DefaultDictionary.java file and can generate any combination of dictionaries for RADIUS to use.
If the DefaultDictionary.java is overwritten it will be automatically picked up by the client or server if in the class path. If a new dictionary is created you can incorporate it into the system by invoking AttributeName.addDictionary(new MyDictionary()); where MyDictionary is substituted with the name of the dictionary you've built. This will be added to any other dictionaries present.
Example:
public static void main(String a[])
{
// Set up the path to the main dictionary file that includes other
// dictionary files. This uses the dictionary file as distributed.
String dictFile = "/usr/local/share/freeradius/dictionary";
try {
// This will the directory where the dictionary file will be written.
// In this case it's the current directory.
String destinationPath = ".";
// The package for the dictionary file. This will becom the Java
// package statement name.
String packageName = "com.mycompany.radius";
// This is the location of the RADIUSDictionary class in your AXL RADIUS Server/Clientdistribution.
// You can use the wildcard or the explicit name. This example uses the wild card.
String importClassName = "com.theorem.radserver3.dictionary.*";
// This is the class name and the name of the Java file.
// In this example class will be "com.mycompany.radius.MyDictionary"
// the file will be placed in "/java/com/mycompany/radius/MyDictionary.java"
String className = "MyDictionary";
GenerateJavaDictionary gjd = new GenerateJavaDictionary(
dictFile,
destinationPath,
packageName,
importClassName,
className);
gjd.writeJavaDictionary();
} catch (Exception e) {
e.printStackTrace();
}
}
| Constructor Summary | |
GenerateJavaDictionary(String dictionaryPath,
String destinationPath,
String packageName,
String importClassName,
String className)
Constructor to generate Java code to include RADIUS dictionaries in packages. |
|
| Method Summary | |
static void |
main(String[] a)
Generate a dictionary file from the command line. |
void |
writeJavaDictionary()
Write the java dictionary file. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GenerateJavaDictionary(String dictionaryPath,
String destinationPath,
String packageName,
String importClassName,
String className)
dictionaryPath - Path to FreeRadius dictionary. The dictionary should be configured to
include only the vendor dictionary files you'll require.destinationPath - Path to the RADIUSDictionary java that will be written.
For example /java/com/company/server/dictionary.packageName - Package for the resulting Java code - for example "com.company.server.dictionary".importClassName - This is the location of the RADIUSDictionary class in your distribution.
For example you could use either "com.theorem.radserver3.dictionary.*" or "com.theorem.radserver3.dictionary.RADIUSDictionary".className - This is the class name you want to generate. For example it could be
"LocalDictionary".| Method Detail |
public static void main(String[] a)
Usage: GenerateJavaDictionary dictionary_file packageName importClassName className
For example:
GenerateJavaDictionary cisco.dict com.company.radiusserver.dictionary
com.theorem.radserver3.dictionary.RADIUSDictionary LocalDictionary
This would produce java output for a class called "LocalDictionary"
in the package "com.company.radiusserver.dictionary".
It would import "com.theorem.radserver3.dictionary.RADIUSDictionary" to satisfy
RADIUSDictionary class references.
It would use the FreeRadius dictionary found in the local file "cisco.dict".
Files included in the dictionary will also be included in the java source.
The results are written to stdout.
public void writeJavaDictionary()
throws IOException
IOException - if there's a problem writing.
|
AXL RADIUS Server API V3 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||