solar.service.dan
Class DanClientService

java.lang.Object
  |
  +--solar.service.BaseService
        |
        +--solar.service.dan.DanClientService
All Implemented Interfaces:
DanConstants, DanService, EventHandler, FapConstants, RequestHandler, RpcConstants, Service

public class DanClientService
extends BaseService
implements DanService, RpcConstants, DanConstants, FapConstants

The client interface for DAN (Data Aggregation Network) service. We enforce that all the pipe setup requests involving a Solar client are always issued from that client. The Planet never issues request to setup a pipe to a Solar client. So we can be sure that the remote end for a requesting pipe is always on the Planet.

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

Field Summary
protected  FapService _fap
           
private  Address _laddr
           
protected  NodeManager _nodeman
           
protected  PipeConnector _pc
           
private  Address _planet
           
protected  RpcService _rpc
           
protected  TransportService _transport
           
 
Fields inherited from class solar.service.BaseService
_inited, _manager, _name
 
Fields inherited from interface solar.service.rpc.RpcConstants
RPC_BLOCK, RPC_HANDLER, RPC_REPLY, RPC_REQUEST, RPC_TIMEOUT
 
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
DanClientService()
           
 
Method Summary
 Guid advertise(java.lang.String name, java.lang.Object extra, Source src)
          Advertise a static name with a name object and return an ID.
 Guid advertise(java.lang.String graph, java.lang.String name, java.lang.Object extra, Source src)
          Advertise a dynamic name with a name object and return an ID.
private  java.lang.Object callRpc(Request req)
          Invoke a RPC call with specified request.
 void connect(int type, Guid sguid, java.lang.String outport, Guid dguid, java.lang.String inport)
          Connect two nodes (at least one local) with a pipe.
 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.
 void init()
          Initiate the service, do not try to init dependent services here.
 void initDependents()
          Initialize dependent services here.
 java.util.List lookup(java.lang.String query)
          Resolve a name query in the name space.
 Guid makeGuid()
          Create a global unique ID.
 Guid subscribe(java.lang.String query, Application app)
          Subscribe to any source whose name matches specified query.
 Guid subscribe(java.lang.String graph, java.lang.String root, Application app)
          Subscribe to a specified operator defined in a graph.
 
Methods inherited from class solar.service.BaseService
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, handleEvent, handleEvent, handleRequest, 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.Service
getName, getServiceManager, handleDispatchUnit, hasInited, setName, setServiceManager, start, stop
 
Methods inherited from interface solar.api.EventHandler
handleEvent
 
Methods inherited from interface solar.api.RequestHandler
handleRequest
 

Field Detail

_planet

private Address _planet

_laddr

private Address _laddr

_fap

protected FapService _fap

_rpc

protected RpcService _rpc

_transport

protected TransportService _transport

_pc

protected PipeConnector _pc

_nodeman

protected NodeManager _nodeman
Constructor Detail

DanClientService

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

connect

public void connect(int type,
                    Guid sguid,
                    java.lang.String outport,
                    Guid dguid,
                    java.lang.String inport)
             throws DanException
Description copied from interface: DanService
Connect two nodes (at least one local) with a pipe.

Specified by:
connect in interface DanService
DanException

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

lookup

public java.util.List lookup(java.lang.String query)
                      throws DanException
Resolve a name query in the name space.

DanException

advertise

public Guid advertise(java.lang.String name,
                      java.lang.Object extra,
                      Source src)
               throws DanException
Advertise a static name with a name object and return an ID.

DanException

advertise

public Guid advertise(java.lang.String graph,
                      java.lang.String name,
                      java.lang.Object extra,
                      Source src)
               throws DanException
Advertise a dynamic name with a name object and return an ID.

DanException

subscribe

public Guid subscribe(java.lang.String query,
                      Application app)
               throws DanException
Subscribe to any source whose name matches specified query.

DanException

subscribe

public Guid subscribe(java.lang.String graph,
                      java.lang.String root,
                      Application app)
               throws DanException
Subscribe to a specified operator defined in a graph.

DanException

callRpc

private java.lang.Object callRpc(Request req)
                          throws RpcException
Invoke a RPC call with specified request.

RpcException