dermi.core
Class DermiConnection

java.lang.Object
  extended by dermi.core.DermiConnection
Direct Known Subclasses:
DermiConnection

public abstract class DermiConnection
extends java.lang.Object

This class wraps a connection to any DHT substrate and is used by Dermi as its main routing substrate.

Version:
1.2
Author:
Carles Pairot

Field Summary
protected  ActivatorClient activatorClient
           
protected  ActivatorImpl activatorImpl
           
static java.lang.String BOOTSTRAP_HOST
           
protected  java.lang.String configurationFile
           
static java.lang.String INSTANCE_NAME
           
protected  java.util.logging.Logger logger
           
 
Constructor Summary
protected DermiConnection(java.lang.Object... args)
           
 
Method Summary
 void addActiveObject(java.lang.String uid, ERemote ref)
           
abstract  void addInterceptor(DermiApplicationListener npar, Id subsKey, java.lang.String interceptorId)
          Method for adding an interceptor to an object group
abstract  void anycall(Topic topic, java.io.Serializable data)
          Method for anycalling to a group of objects
abstract  void close()
          Method for closing a connection, thus killing the node
 boolean containsActiveObject(java.lang.String uid)
           
abstract  void continueInterception(java.util.Hashtable evt, java.util.ArrayList interceptors)
          Method for resuming the interception process.
 ActivatorClient getActivator()
          This method returns the activator client responsible for the community
abstract  PriorityList getComponentHops(java.lang.String uid)
           
abstract  Node getLocalNode()
          Utility method for obtaining the local node
abstract  NodeHandle getLocalNodeHandle()
          Utility method for obtaining the local node handle
abstract  Id getLocalNodeId()
           
abstract  java.util.Collection getReplicaSet(Id id, int maxRank)
          Returns a set of suitable replica nodes for such Id
 java.util.Collection listActiveObjects()
           
 void loadActivator()
          This method loads all activator objects for this Dermi instance, one for each community it is member of
abstract  void publish(Topic topic, java.io.Serializable data)
          Method for publishing data
abstract  void publishDirect(Topic topic, java.io.Serializable data)
          Method for publishing data directly to a node
 void removeActiveObject(java.lang.String uid)
           
abstract  void removeInterceptor(Id subsKey, java.lang.String interceptorId)
          Method for removing an interceptor from an object group
abstract  void subscribe(Topic topic, Client subscriber)
          Method for subscribing an application to a multicast group
abstract  void unsubscribe(Topic topic, Client subscriber)
          Method for unsubscribing an application from a multicast group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE_NAME

public static java.lang.String INSTANCE_NAME

logger

protected transient java.util.logging.Logger logger

BOOTSTRAP_HOST

public static java.lang.String BOOTSTRAP_HOST

configurationFile

protected java.lang.String configurationFile

activatorClient

protected ActivatorClient activatorClient

activatorImpl

protected ActivatorImpl activatorImpl
Constructor Detail

DermiConnection

protected DermiConnection(java.lang.Object... args)
                   throws ConnectionException
Throws:
ConnectionException
Method Detail

loadActivator

public void loadActivator()
This method loads all activator objects for this Dermi instance, one for each community it is member of


getActivator

public ActivatorClient getActivator()
This method returns the activator client responsible for the community

Parameters:
communityId - String The community id
Returns:
ActivatorClient The activator client responsible for that community

subscribe

public abstract void subscribe(Topic topic,
                               Client subscriber)
Method for subscribing an application to a multicast group

Parameters:
topic - Topic The group's identifier
subscriber - ScribeClient The application to subscribe

unsubscribe

public abstract void unsubscribe(Topic topic,
                                 Client subscriber)
Method for unsubscribing an application from a multicast group

Parameters:
topic - Topic The group's identifier
subscriber - ScribeClient The application to unsubscribe

publish

public abstract void publish(Topic topic,
                             java.io.Serializable data)
Method for publishing data

Parameters:
topic - Topic The group's identifier
data - Serializable Data to publish

publishDirect

public abstract void publishDirect(Topic topic,
                                   java.io.Serializable data)
Method for publishing data directly to a node

Parameters:
topic - Topic The group's identifier
data - Serializable Data to publish

anycall

public abstract void anycall(Topic topic,
                             java.io.Serializable data)
Method for anycalling to a group of objects

Parameters:
topic - Topic The group's identifier
data - Serializable Data to publish

getLocalNodeHandle

public abstract NodeHandle getLocalNodeHandle()
Utility method for obtaining the local node handle

Returns:
NodeHandle Local node handle

getLocalNode

public abstract Node getLocalNode()
Utility method for obtaining the local node

Returns:
Node Local node

getLocalNodeId

public abstract Id getLocalNodeId()

addInterceptor

public abstract void addInterceptor(DermiApplicationListener npar,
                                    Id subsKey,
                                    java.lang.String interceptorId)
Method for adding an interceptor to an object group

Parameters:
npar - NotificationParser Interceptor application
subsKey - Id Subscription key
interceptorId - String Interceptor id

removeInterceptor

public abstract void removeInterceptor(Id subsKey,
                                       java.lang.String interceptorId)
Method for removing an interceptor from an object group

Parameters:
subsKey - Id Subscription key
interceptorId - String Interceptor id

continueInterception

public abstract void continueInterception(java.util.Hashtable evt,
                                          java.util.ArrayList interceptors)
Method for resuming the interception process. Automatically called by interceptor skeletons

Parameters:
evt - Hashtable
interceptors - ArrayList

getReplicaSet

public abstract java.util.Collection getReplicaSet(Id id,
                                                   int maxRank)
Returns a set of suitable replica nodes for such Id

Parameters:
id - Id Which id to replicate
maxRank - int Maximum number of replicas
Returns:
Collection Set of replicas

close

public abstract void close()
Method for closing a connection, thus killing the node


addActiveObject

public void addActiveObject(java.lang.String uid,
                            ERemote ref)

removeActiveObject

public void removeActiveObject(java.lang.String uid)

listActiveObjects

public java.util.Collection listActiveObjects()

containsActiveObject

public boolean containsActiveObject(java.lang.String uid)

getComponentHops

public abstract PriorityList getComponentHops(java.lang.String uid)