Package org.tinyradius.core.dictionary
Class MemoryDictionary
java.lang.Object
org.tinyradius.core.dictionary.MemoryDictionary
- All Implemented Interfaces:
CoreDictionary
,Dictionary
,WritableDictionary
A dictionary that keeps the values and names in hash maps
in the memory. The dictionary has to be filled using the
methods
addAttributeTemplate
and
addVendor
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributeTemplate
(AttributeTemplate attributeTemplate) Adds an AttributeTemplate object to the cache.Adds the given vendor to the dictionary.getAttributeTemplate
(int vendorCode, int type) Retrieves an AttributeTemplate for a vendor-specific attribute.getAttributeTemplate
(String name) Retrieves an AttributeTemplate by name.getVendor
(int vendorId) Retrieves the vendor with the given vendor code.Retrieves the ID of the vendor with the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tinyradius.core.dictionary.CoreDictionary
getAttributeTemplate
Methods inherited from interface org.tinyradius.core.dictionary.Dictionary
createAttribute, createAttribute, createAttribute, createAttribute, createAttribute, createAttribute
-
Constructor Details
-
MemoryDictionary
public MemoryDictionary()
-
-
Method Details
-
getAttributeTemplate
Description copied from interface:CoreDictionary
Retrieves an AttributeTemplate for a vendor-specific attribute.- Specified by:
getAttributeTemplate
in interfaceCoreDictionary
- Parameters:
vendorCode
- vendorId if appropriate or -1type
- type 1-255- Returns:
- AttributeTemplate
-
getAttributeTemplate
Description copied from interface:CoreDictionary
Retrieves an AttributeTemplate by name. This includes vendor-specific attribute types whose name is prefixed by the vendor name.- Specified by:
getAttributeTemplate
in interfaceCoreDictionary
- Parameters:
name
- attribute name- Returns:
- AttributeTemplate object or null
-
getVendor
Description copied from interface:CoreDictionary
Retrieves the ID of the vendor with the given name.- Specified by:
getVendor
in interfaceCoreDictionary
- Parameters:
vendorName
- name of the vendor- Returns:
- vendorId or -1
-
getVendor
Description copied from interface:CoreDictionary
Retrieves the vendor with the given vendor code.- Specified by:
getVendor
in interfaceCoreDictionary
- Parameters:
vendorId
- vendor number- Returns:
- vendor
-
addVendor
Description copied from interface:WritableDictionary
Adds the given vendor to the dictionary.- Specified by:
addVendor
in interfaceWritableDictionary
- Parameters:
vendor
- vendor to add- Returns:
- this WritableDictionary
-
addAttributeTemplate
Adds an AttributeTemplate object to the cache.- Specified by:
addAttributeTemplate
in interfaceWritableDictionary
- Parameters:
attributeTemplate
- AttributeTemplate object- Returns:
- this WritableDictionary
- Throws:
IllegalArgumentException
- duplicate attribute name/type code
-