campus.compass
Class CompassService

java.lang.Object
  |
  +--solar.service.BaseService
        |
        +--campus.compass.CompassService
All Implemented Interfaces:
EventHandler, RequestHandler, java.lang.Runnable, Service

public class CompassService
extends BaseService
implements java.lang.Runnable

Compass service provides a Web proxy that impose location-dependent information on the pages viewed by the clients. The implementation is based on Muffin (http://muffin.doit.org/).

Version:
$Id: CompassService.java,v 1.8 2003/09/21 03:13:35 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  java.lang.String _community
           
protected static java.lang.String _locfile
           
protected static java.util.Hashtable _loctable
           
protected static org.apache.log4j.Logger _log
           
protected static CampusMap _map
           
protected  java.lang.String _mappath
           
protected static boolean _needparse
           
protected static SyslogParser _parser
           
protected static SnmpLocator _snmploc
           
protected  java.lang.String _snmpscript
           
protected  java.lang.String _sysloghost
           
protected  int _syslogport
           
static java.lang.String VERSION
           
 
Fields inherited from class solar.service.BaseService
_inited, _manager, _name
 
Constructor Summary
CompassService()
           
 
Method Summary
private static void addIpLocation(java.lang.String ip, Location loc)
           
static java.lang.String getApByIp(java.lang.String ip)
           
static ApStat getApStatByIp(java.lang.String ip)
           
static Location getLocationByIp(java.lang.String ip)
           
 void init()
          Initiate the service, do not try to init dependent services here.
 void run()
           
 
Methods inherited from class solar.service.BaseService
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, handleEvent, handleEvent, handleRequest, hasInited, init, initDependents, setInited, setName, setServiceManager, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

_log

protected static org.apache.log4j.Logger _log

_locfile

protected static java.lang.String _locfile

_loctable

protected static java.util.Hashtable _loctable

_sysloghost

protected java.lang.String _sysloghost

_syslogport

protected int _syslogport

_snmpscript

protected java.lang.String _snmpscript

_community

protected java.lang.String _community

_mappath

protected java.lang.String _mappath

_snmploc

protected static SnmpLocator _snmploc

_map

protected static CampusMap _map

_needparse

protected static boolean _needparse

_parser

protected static SyslogParser _parser
Constructor Detail

CompassService

public CompassService()
Method Detail

init

public void init()
          throws ServiceException
Description copied from interface: Service
Initiate the service, do not try to init dependent services here.

Specified by:
init in interface Service
Overrides:
init in class BaseService
ServiceException

run

public void run()
Specified by:
run in interface java.lang.Runnable

getApStatByIp

public static ApStat getApStatByIp(java.lang.String ip)

getApByIp

public static java.lang.String getApByIp(java.lang.String ip)

getLocationByIp

public static Location getLocationByIp(java.lang.String ip)
                                throws java.lang.Exception
java.lang.Exception

addIpLocation

private static void addIpLocation(java.lang.String ip,
                                  Location loc)