edu.uci.isr.yancees.server.service.jmdns
Class JmDNSService

java.lang.Object
  extended byedu.uci.isr.yancees.server.service.AbstractService
      extended byedu.uci.isr.yancees.server.service.jmdns.JmDNSService
All Implemented Interfaces:
ServiceInterface

public class JmDNSService
extends AbstractService

This service connects YANCESS with its peers in a subnetwork. It uses the service location protocol (SLP)


Nested Class Summary
 class JmDNSService.MySubscriber
          This is a dummy class to uniquely identify the subscriber in this case.
 
Field Summary
 java.util.Vector _myJmDNSList
           
 java.util.Vector _myURLList
           
static java.lang.String JMDNS_SERVICE_TYPE
           
static java.lang.String LOOKUP_NAME
           
static int RETRY_TENTATIVES
           
static int RETRY_TIMEOUT
           
static java.lang.String SERVICE_NAME
           
static int TIME_OUT
           
 
Constructor Summary
JmDNSService()
           
 
Method Summary
 void addService(JmDNS jmdns, java.lang.String type, java.lang.String name)
           
 void executeRemoveService(JmDNS jmdns, java.lang.String type, java.lang.String name)
          Starts a thread to execute the remove command
protected  boolean isNotMyURL(java.lang.String textString)
           
 void publishToPeers(EventInterface evt)
          Propagates, or publishes an event in all the peers of the network.
 void publishToPeers(EventInterface[] evtList)
          Propagates, or publishes an event in all the peers of the network.
 void removeService(JmDNS jmdns, java.lang.String type, java.lang.String name)
          This method is called whenever a new service is unregistered from the LAN
 void resolveService(JmDNS jmdns, java.lang.String type, java.lang.String name, ServiceInfo info)
           
 
Methods inherited from class edu.uci.isr.yancees.server.service.AbstractService
getName, isActive, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static java.lang.String SERVICE_NAME

LOOKUP_NAME

public static java.lang.String LOOKUP_NAME

JMDNS_SERVICE_TYPE

public static java.lang.String JMDNS_SERVICE_TYPE

TIME_OUT

public static int TIME_OUT

RETRY_TIMEOUT

public static int RETRY_TIMEOUT

RETRY_TENTATIVES

public static int RETRY_TENTATIVES

_myURLList

public java.util.Vector _myURLList

_myJmDNSList

public java.util.Vector _myJmDNSList
Constructor Detail

JmDNSService

public JmDNSService()
Method Detail

addService

public void addService(JmDNS jmdns,
                       java.lang.String type,
                       java.lang.String name)

isNotMyURL

protected boolean isNotMyURL(java.lang.String textString)

removeService

public void removeService(JmDNS jmdns,
                          java.lang.String type,
                          java.lang.String name)
This method is called whenever a new service is unregistered from the LAN

Parameters:
jmdns - is the reference to the service running locally
type - is the type of the service removed
name - is the name of the resource removed

executeRemoveService

public void executeRemoveService(JmDNS jmdns,
                                 java.lang.String type,
                                 java.lang.String name)
Starts a thread to execute the remove command

Parameters:
jmdns - is the reference to the jmdns protocol manager
type - is the type of the service that left the network
name - is the unique name of the service that left the network

resolveService

public void resolveService(JmDNS jmdns,
                           java.lang.String type,
                           java.lang.String name,
                           ServiceInfo info)

publishToPeers

public void publishToPeers(EventInterface evt)
Propagates, or publishes an event in all the peers of the network. Note that for this operation, we do not use the regular publishing interface of YANCEES as a way to prevent repeated circular publishing of events.

Parameters:
evt - is the event to be propagated to the other peers.

publishToPeers

public void publishToPeers(EventInterface[] evtList)
Propagates, or publishes an event in all the peers of the network. Note that for this operation, we do not use the regular publishing interface of YANCEES as a way to prevent repeated circular publishing of events.

Parameters:
evtList - is the event list to be propagated to the other peers.