org.edg.security.authorization.map
Class FileMap
java.lang.Object
|
+--org.edg.security.authorization.map.FileMap
- All Implemented Interfaces:
- java.util.Map
- public class FileMap
- extends java.lang.Object
- implements java.util.Map
Class FileMap.
Creates a map from a file. Values associated with
a key is returned in a List object.
The following file formats are supported:
- gridmap
- file-table
- xml-table
- ...
- Version:
- $Id: FileMap.java,v 1.17 2003/10/27 15:55:00 gianluca Exp $
- Author:
- Niklas Karlsson HIP, Olle Mulmo PDC
Field Summary |
static java.util.Hashtable |
theFileTypes
Lookup table (name->class) for different file types |
Constructor Summary |
FileMap(java.lang.String fname,
java.lang.String ftype,
int period)
Creates a FileMap |
Method Summary |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
|
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map t)
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
void |
terminate()
Remove the reference to the Timer object, in
order to kill all threads responsible for
refreshing the FileMap. |
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
theFileTypes
public static java.util.Hashtable theFileTypes
- Lookup table (name->class) for different file types
FileMap
public FileMap(java.lang.String fname,
java.lang.String ftype,
int period)
- Creates a FileMap
- Parameters:
fname
- the file nameftype
- the file typeperiod
- The period (in seconds) to perform a reload on the file:
If set to 0
, no reload will take place. If set to -1
,
a "stat" operation will be performed on the file at each lookup, to
determine whether the modify date has changed and a reload is necessary
size
public int size()
- Specified by:
size
in interface java.util.Map
- See Also:
Map.size()
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Map
- See Also:
Map.isEmpty()
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interface java.util.Map
- See Also:
Map.containsKey(Object)
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interface java.util.Map
- See Also:
Map.containsValue(Object)
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interface java.util.Map
- See Also:
Map.get(Object)
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
- Specified by:
put
in interface java.util.Map
- Returns:
- java.util.List the updated list of values associated with the key
- See Also:
Map.put(Object, Object)
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interface java.util.Map
- See Also:
Map.remove(Object)
putAll
public void putAll(java.util.Map t)
- Specified by:
putAll
in interface java.util.Map
- See Also:
Map.putAll(Map)
clear
public void clear()
- Specified by:
clear
in interface java.util.Map
- See Also:
Map.clear()
keySet
public java.util.Set keySet()
- Specified by:
keySet
in interface java.util.Map
- See Also:
Map.keySet()
values
public java.util.Collection values()
- Specified by:
values
in interface java.util.Map
- See Also:
Map.values()
entrySet
public java.util.Set entrySet()
- Specified by:
entrySet
in interface java.util.Map
- See Also:
Map.entrySet()
terminate
public void terminate()
- Remove the reference to the Timer object, in
order to kill all threads responsible for
refreshing the FileMap.