kom.tools.access
Class AccessControl
java.lang.Object
|
+--kom.tools.access.AccessControl
- public class AccessControl
- extends java.lang.Object
Access Control for hosts.
Field Summary |
protected java.util.Hashtable |
allowed
|
protected java.util.Hashtable |
denied
|
Constructor Summary |
AccessControl(java.util.Vector allowed,
java.util.Vector denied)
Constructor. |
Method Summary |
protected boolean |
findAllowed(java.lang.String name)
Checks if access is allowed from a host |
protected boolean |
findDenied(java.lang.String name)
Checks if access from host will be denied |
boolean |
isAllowed(java.lang.String host)
Checks if access is allowed from a host
(denied takes preference over allowed ). |
static void |
main(java.lang.String[] args)
Test program for Access |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
allowed
protected java.util.Hashtable allowed
denied
protected java.util.Hashtable denied
AccessControl
public AccessControl(java.util.Vector allowed,
java.util.Vector denied)
- Constructor.
- Parameters:
allowed
- list of hosts that can access a servicedenied
- list of hosts that have no access to the service
findAllowed
protected boolean findAllowed(java.lang.String name)
- Checks if access is allowed from a host
- Parameters:
name
- the host name- Returns:
- true if the host is explicitly allowed
findDenied
protected boolean findDenied(java.lang.String name)
- Checks if access from host will be denied
- Parameters:
name
- the host name- Returns:
- true if the host is explicitly denied
isAllowed
public boolean isAllowed(java.lang.String host)
- Checks if access is allowed from a host
(
denied
takes preference over allowed
).
- Parameters:
host
- the host name- Returns:
- true if access from the host is allowed, false otherwise
main
public static void main(java.lang.String[] args)
- Test program for Access