solar.service.dan
Class AbstractDanService

java.lang.Object
  |
  +--solar.service.BaseService
        |
        +--solar.service.dan.AbstractDanService
All Implemented Interfaces:
DanConstants, DanService, EventHandler, FapConstants, RequestHandler, Service
Direct Known Subclasses:
SolarDanService

public abstract class AbstractDanService
extends BaseService
implements DanService, DanConstants, FapConstants

The abstract implementation (mostly dealing with clients) of DAN (Data Aggregation Network) service.

Version:
$Id: AbstractDanService.java,v 1.4 2003/10/05 18:50:54 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  RpcService _coreRpc
           
protected  TransportService _coreTransport
           
protected  DirectoryService _directory
           
protected  RpcService _edgeRpc
           
protected  TransportService _edgeTransport
           
protected  FapService _fap
           
protected  Address _laddr
           
protected  NodeManager _nodeman
           
protected  SpecParser _parser
           
protected  PipeConnector _pc
           
 
Fields inherited from class solar.service.BaseService
_inited, _manager, _name
 
Fields inherited from interface solar.service.dan.DanConstants
DAN_INPORT, DAN_OUTPORT
 
Fields inherited from interface solar.service.fap.FapConstants
FAP_DATA, FAP_MIXED, FAP_PID, FAP_PULL, FAP_PUSH
 
Constructor Summary
AbstractDanService()
           
 
Method Summary
private  Guid advertise(AdvertiseRequest request)
           
 DirectoryService getDirectoryService()
          Get the directory service used by DAN.
 FapService getFapService()
          Get the fap service used by DAN.
 Address getLocalAddress()
          Return the local address of the resident Planet.
 NodeManager getNodeManager()
          Return the node manager for this DAN service.
 RpcService getRpcService()
          Get the rpc service used by DAN.
 java.lang.Object handleRequest(Request request)
          Processing a request.
 void init()
          Initiate the service, do not try to init dependent services here.
 void initDependents()
          Initialize dependent services here.
private  Guid loadGraph(GraphSpec gs, java.lang.String op)
           
private  java.util.List lookup(LookupRequest request)
           
protected  GraphManager makeGraphManager(GraphSpec gs)
           
 Guid makeGuid()
          Create a global unique ID.
private  Guid subscribe(SubscribeRequest request)
           
 
Methods inherited from class solar.service.BaseService
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, handleEvent, handleEvent, hasInited, init, setInited, setName, setServiceManager, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface solar.service.dan.DanService
connect
 
Methods inherited from interface solar.service.Service
getName, getServiceManager, handleDispatchUnit, hasInited, setName, setServiceManager, start, stop
 
Methods inherited from interface solar.api.EventHandler
handleEvent
 

Field Detail

_fap

protected FapService _fap

_directory

protected DirectoryService _directory

_coreRpc

protected RpcService _coreRpc

_edgeRpc

protected RpcService _edgeRpc

_coreTransport

protected TransportService _coreTransport

_edgeTransport

protected TransportService _edgeTransport

_laddr

protected Address _laddr

_pc

protected PipeConnector _pc

_nodeman

protected NodeManager _nodeman

_parser

protected SpecParser _parser
Constructor Detail

AbstractDanService

public AbstractDanService()
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

initDependents

public void initDependents()
                    throws ServiceException
Description copied from interface: Service
Initialize dependent services here.

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

handleRequest

public java.lang.Object handleRequest(Request request)
                               throws java.lang.Exception
Description copied from interface: RequestHandler
Processing a request.

Specified by:
handleRequest in interface RequestHandler
Overrides:
handleRequest in class BaseService
java.lang.Exception

getLocalAddress

public Address getLocalAddress()
Description copied from interface: DanService
Return the local address of the resident Planet.

Specified by:
getLocalAddress in interface DanService

getFapService

public FapService getFapService()
Description copied from interface: DanService
Get the fap service used by DAN.

Specified by:
getFapService in interface DanService

getRpcService

public RpcService getRpcService()
Description copied from interface: DanService
Get the rpc service used by DAN.

Specified by:
getRpcService in interface DanService

getDirectoryService

public DirectoryService getDirectoryService()
Description copied from interface: DanService
Get the directory service used by DAN.

Specified by:
getDirectoryService in interface DanService

getNodeManager

public NodeManager getNodeManager()
Description copied from interface: DanService
Return the node manager for this DAN service.

Specified by:
getNodeManager in interface DanService

makeGuid

public Guid makeGuid()
Description copied from interface: DanService
Create a global unique ID.

Specified by:
makeGuid in interface DanService

makeGraphManager

protected GraphManager makeGraphManager(GraphSpec gs)

lookup

private java.util.List lookup(LookupRequest request)
                       throws java.lang.Exception
java.lang.Exception

advertise

private Guid advertise(AdvertiseRequest request)
                throws java.lang.Exception
java.lang.Exception

subscribe

private Guid subscribe(SubscribeRequest request)
                throws java.lang.Exception
java.lang.Exception

loadGraph

private Guid loadGraph(GraphSpec gs,
                       java.lang.String op)
                throws java.lang.Exception
java.lang.Exception