All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.auth.IPMatcher

java.lang.Object
   |
   +----w3c.jigsaw.auth.IPMatcher

public class IPMatcher
extends Object
A fast way of associating IP adresses to any Object. This IPMatcher classes maps IP adresses to objects. It understands wild cards, encoded as ((short) 256). Wild card will match any adress below it.


Constructor Index

 o IPMatcher()

Method Index

 o add(short[], Object)
Associate the given IP adress to the given object.
 o lookup(byte[])
Lookup the adress for an association.
 o lookup(InetAddress)
Lookup the given InetAdress for any association.
 o print(PrintStream)
Print the IP matcher internal tree.

Constructors

 o IPMatcher
 public IPMatcher()

Methods

 o add
 public void add(short a[],
                 Object closure)
Associate the given IP adress to the given object. This method takes as parameter an array of short in order to extend natural IP adresses bytes with the wild card character.

Parameters:
a - The adress to use as a key for the association.
closure - The associated object.
 o lookup
 public Object lookup(byte a[])
Lookup the adress for an association.

Parameters:
a - The adress to look for.
Returns:
The object associated to the given IP address, or null if none was found.
 o lookup
 public Object lookup(InetAddress inetadr)
Lookup the given InetAdress for any association.

Parameters:
inetadr - The inet adress to look for.
Returns:
The object associated to the given IP adress, or null if none was found.
 o print
 public void print(PrintStream out)
Print the IP matcher internal tree.


All Packages  Class Hierarchy  This Package  Previous  Next  Index