JSPservletPkg
Interface MapperIntf

All Known Implementing Classes:
Mapper

abstract interface MapperIntf

Version 1.0.4. save method. User hostname mapper interface.

Copyright (c) 2000-2001

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2
 of the License.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 

Version:
1, 0, 4
Author:
Alexis Grandemange

Method Summary
 boolean check(java.lang.String subscriber)
          Checks the state of a subscribing PageBox and updates its state.
 void checkAll(int counterForPing)
          Update global subscriber state.
 java.lang.String getDomain(java.lang.String host)
          Service method.
 java.lang.String getInfo()
          returns info string.
 java.lang.String getMessage()
          returns error - diagnosis message.
 java.lang.String getPageBox(java.lang.String domain, java.lang.String address)
          Returns the URL of the PageBox to use for a given URL.
 

Method Detail

getPageBox

public java.lang.String getPageBox(java.lang.String domain,
                                   java.lang.String address)
Returns the URL of the PageBox to use for a given URL.

Intented use: JSPservlet uses ServletRequest.getRemoteHost to get the name of the requestor and updates page HREF with the returned URL. The invoker should use only the last two or three last fields of the URL, for instance proxad.net for nice-1-a7-14-82.dial.proxad.net.

Parameters:
domain - requestor domain.
address - requestor IP address.

checkAll

public void checkAll(int counterForPing)
Update global subscriber state. At each loop the scanner thread increments the invocation number up to 12. Then it reset the invocation number. Allows to do 1/12 of the checks at a call.
Parameters:
counterForPing - invocation number.

check

public boolean check(java.lang.String subscriber)
Checks the state of a subscribing PageBox and updates its state.
Parameters:
subscriber - subscribing PageBox.
Returns:
boolean true if PageBox is up.

getMessage

public java.lang.String getMessage()
returns error - diagnosis message.

getInfo

public java.lang.String getInfo()
returns info string.

getDomain

public java.lang.String getDomain(java.lang.String host)
Service method. Extract domain part from host name.
Parameters:
host - host name.