uk.ac.ic.doc.automed.p2p.son
Class SMRFactory

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.son.SMRFactory

public class SMRFactory
extends java.lang.Object

Version:
1.0 Department of Computing, Imperial College
Author:
Duc M Le dmle@doc.ic.ac.uk

Field Summary
static int CHORD
           
static java.lang.String CHORD_NAME
           
private static ChordNetworkHelper chordHelper
           
static int PGRID
           
static java.lang.String PGRID_NAME
           
private static PGridNetworkHelper pgridHelper
           
 
Constructor Summary
private SMRFactory()
           
 
Method Summary
static void displayStat(SMRController smrc, java.io.PrintStream out)
          Periodically display status of the DHT
static ow.id.ID generateDHTID(java.lang.String str)
          Generate a DHT-based id from a string
static ChordNetworkHelper getChordHelper()
           
static PGridNetworkHelper getPGridHelper()
           
static SMRController getSMRControllerInstance(int type, java.lang.Object peerID, java.lang.String selfHost, int selfPort, AutoMedPeer p, java.util.Properties props)
          Create a new instance of a SMRController
static int getTypeID(java.lang.String smrTypeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHORD

public static final int CHORD
See Also:
Constant Field Values

PGRID

public static final int PGRID
See Also:
Constant Field Values

CHORD_NAME

public static final java.lang.String CHORD_NAME
See Also:
Constant Field Values

PGRID_NAME

public static final java.lang.String PGRID_NAME
See Also:
Constant Field Values

pgridHelper

private static PGridNetworkHelper pgridHelper

chordHelper

private static ChordNetworkHelper chordHelper
Constructor Detail

SMRFactory

private SMRFactory()
Method Detail

getSMRControllerInstance

public static SMRController getSMRControllerInstance(int type,
                                                     java.lang.Object peerID,
                                                     java.lang.String selfHost,
                                                     int selfPort,
                                                     AutoMedPeer p,
                                                     java.util.Properties props)
                                              throws SMRInitException
Create a new instance of a SMRController

Parameters:
type - type of controller to create
peerID - the peerID
selfHost - the name of the peer's host
selfPort - the peer's port for listening to connections
p - the AutoMedPeer to which this peer is representing
props - any extra parameters
Returns:
an instance of SMRController
Throws:
SMRInitException

getPGridHelper

public static PGridNetworkHelper getPGridHelper()

getChordHelper

public static ChordNetworkHelper getChordHelper()

displayStat

public static void displayStat(SMRController smrc,
                               java.io.PrintStream out)
Periodically display status of the DHT


generateDHTID

public static ow.id.ID generateDHTID(java.lang.String str)
Generate a DHT-based id from a string

Parameters:
str - the string from which to generate the id
Returns:
an instance of ID object

getTypeID

public static int getTypeID(java.lang.String smrTypeName)