solar.service.dan
Class Monitor

java.lang.Object
  |
  +--solar.service.dan.Monitor
All Implemented Interfaces:
DanConstants, DirectoryListener, EventHandler, FapConstants

class Monitor
extends java.lang.Object
implements EventHandler, DirectoryListener, DanConstants, FapConstants

A monitor is attached to some operator to manage its subscriptions or advertisement.

Version:
$Id: Monitor.java,v 1.3 2003/09/25 21:37:37 glchen Exp $
Author:
Guanling Chen

Field Summary
private  DanService _dan
           
private  DirectoryService _directory
           
private  Guid _guid
           
private  Name _name
           
private  NodeManager _nodeman
           
private  java.lang.Object _object
           
private  Name _pname
           
private  Name _pquery
           
private  Name _query
           
 
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
Monitor(DanService dan)
           
 
Method Summary
 void advertise(Guid guid, Name name, java.lang.Object obj)
           
private  Name composeName(Name name, Event evt)
           
 void handleEvent(Event evt)
          Processing an event.
 void nameAdded(Name name, NameRecord rec)
          Handle event about the addition of a name.
 void nameMigrated(Name name, NameRecord oldrec, NameRecord newrec)
          Handle event about the migration of a name (named resource).
 void nameRemoved(Name name, NameRecord rec)
          Handle event about the removal of a name.
 void nameUpdated(Name oldName, NameRecord oldrec, Name newName, NameRecord newrec)
          Handle event about the change of a name.
private  AttributeRecord replaceValue(AttributeRecord ar, Event evt)
           
private  void select()
           
 void subscribe(Guid guid, Name query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_guid

private Guid _guid

_name

private Name _name

_pname

private Name _pname

_object

private java.lang.Object _object

_query

private Name _query

_pquery

private Name _pquery

_dan

private DanService _dan

_nodeman

private NodeManager _nodeman

_directory

private DirectoryService _directory
Constructor Detail

Monitor

public Monitor(DanService dan)
Method Detail

advertise

public void advertise(Guid guid,
                      Name name,
                      java.lang.Object obj)
               throws java.lang.Exception
java.lang.Exception

subscribe

public void subscribe(Guid guid,
                      Name query)
               throws java.lang.Exception
java.lang.Exception

nameAdded

public void nameAdded(Name name,
                      NameRecord rec)
Description copied from interface: DirectoryListener
Handle event about the addition of a name.

Specified by:
nameAdded in interface DirectoryListener

nameRemoved

public void nameRemoved(Name name,
                        NameRecord rec)
Description copied from interface: DirectoryListener
Handle event about the removal of a name.

Specified by:
nameRemoved in interface DirectoryListener

nameUpdated

public void nameUpdated(Name oldName,
                        NameRecord oldrec,
                        Name newName,
                        NameRecord newrec)
Description copied from interface: DirectoryListener
Handle event about the change of a name.

Specified by:
nameUpdated in interface DirectoryListener

nameMigrated

public void nameMigrated(Name name,
                         NameRecord oldrec,
                         NameRecord newrec)
Description copied from interface: DirectoryListener
Handle event about the migration of a name (named resource).

Specified by:
nameMigrated in interface DirectoryListener

select

private void select()

composeName

private Name composeName(Name name,
                         Event evt)

replaceValue

private AttributeRecord replaceValue(AttributeRecord ar,
                                     Event evt)

handleEvent

public void handleEvent(Event evt)
                 throws java.lang.Exception
Description copied from interface: EventHandler
Processing an event.

Specified by:
handleEvent in interface EventHandler
java.lang.Exception