dermi.core
Class DermiKernel

java.lang.Object
  extended by rice.p2p.scribe.ScribeImpl
      extended by dermi.core.DermiKernel
All Implemented Interfaces:
rice.p2p.commonapi.Application, rice.p2p.scribe.Scribe

public class DermiKernel
extends rice.p2p.scribe.ScribeImpl

This class implements the kernel of Dermi. It extends the Scribe event service to provide all the features and services

Author:
Carles Pairot

Nested Class Summary
 
Nested classes inherited from class rice.p2p.scribe.ScribeImpl
rice.p2p.scribe.ScribeImpl.TopicManager
 
Field Summary
 
Fields inherited from class rice.p2p.scribe.ScribeImpl
endpoint, handle, log, MESSAGE_TIMEOUT, policy, topics
 
Constructor Summary
DermiKernel(java.lang.String instance, DermiConnection conn)
          The kernel constructor
 
Method Summary
 void addInterceptor(rice.p2p.scribe.ScribeClient client, rice.p2p.scribe.Topic topic, java.lang.String intId)
          Method for adding an interceptor object to an object group
 void continueInterception(java.util.Hashtable evt, java.util.ArrayList interceptors)
          Method invoked by interceptor skeletons to resume the interception process
 void deliver(rice.p2p.commonapi.Id id, rice.p2p.commonapi.Message message)
          This method is called on the application at the destination node for the given id.
 boolean forward(rice.p2p.commonapi.RouteMessage message)
          The Common API forward method has been changed to first pass the RouteMessage to Dermi's notification parser, so as to be able to route new messages with contents changes (useful in manycalls)
 rice.p2p.commonapi.NodeHandle getLocalNodeHandle()
          Returns the local node handle
 void publishDirect(rice.p2p.scribe.Topic topic, DermiContent content)
          Publishes a direct message to the topic.
 void removeInterceptor(rice.p2p.scribe.Topic topic, java.lang.String intId)
          Method for removing an interceptor from an object group
 void update(rice.p2p.commonapi.NodeHandle handle, boolean joined)
          This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call.
 
Methods inherited from class rice.p2p.scribe.ScribeImpl
addChild, anycast, getChildren, getClients, getId, getParent, getPolicy, isRoot, publish, removeChild, removeChild, sendSubscribe, setPolicy, subscribe, subscribe, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DermiKernel

public DermiKernel(java.lang.String instance,
                   DermiConnection conn)
The kernel constructor

Parameters:
instance - String Instance name
conn - DermiConnection The connection node
Method Detail

addInterceptor

public void addInterceptor(rice.p2p.scribe.ScribeClient client,
                           rice.p2p.scribe.Topic topic,
                           java.lang.String intId)
Method for adding an interceptor object to an object group

Parameters:
client - ScribeClient Interceptor application
topic - Topic Group's identifier
intId - String Interceptor id

removeInterceptor

public void removeInterceptor(rice.p2p.scribe.Topic topic,
                              java.lang.String intId)
Method for removing an interceptor from an object group

Parameters:
topic - Topic Group's identifier
intId - String Interceptor id

getLocalNodeHandle

public rice.p2p.commonapi.NodeHandle getLocalNodeHandle()
Returns the local node handle

Returns:
NodeHandle Returned node handle

publishDirect

public void publishDirect(rice.p2p.scribe.Topic topic,
                          DermiContent content)
Publishes a direct message to the topic. (This means sending it not via the rendezvous point, but directly to the destination peer)

Parameters:
topic - The topic to publish to
content - The content to publish

update

public void update(rice.p2p.commonapi.NodeHandle handle,
                   boolean joined)
This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call.

Specified by:
update in interface rice.p2p.commonapi.Application
Overrides:
update in class rice.p2p.scribe.ScribeImpl
Parameters:
handle - The handle that has joined/left
joined - Whether the node has joined or left

forward

public boolean forward(rice.p2p.commonapi.RouteMessage message)
The Common API forward method has been changed to first pass the RouteMessage to Dermi's notification parser, so as to be able to route new messages with contents changes (useful in manycalls)

Specified by:
forward in interface rice.p2p.commonapi.Application
Overrides:
forward in class rice.p2p.scribe.ScribeImpl
Parameters:
message - RouteMessage Received message
Returns:
boolean true if message has to be routed further

deliver

public void deliver(rice.p2p.commonapi.Id id,
                    rice.p2p.commonapi.Message message)
This method is called on the application at the destination node for the given id.

Specified by:
deliver in interface rice.p2p.commonapi.Application
Overrides:
deliver in class rice.p2p.scribe.ScribeImpl
Parameters:
id - The destination id of the message
message - The message being sent

continueInterception

public void continueInterception(java.util.Hashtable evt,
                                 java.util.ArrayList interceptors)
Method invoked by interceptor skeletons to resume the interception process

Parameters:
evt - Hashtable Event data
interceptors - ArrayList Remaining interceptors to be traversed