|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectuk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener
uk.ac.ic.doc.automed.p2p.AutoMedPeer
uk.ac.ic.doc.automed.p2p.Peer
uk.ac.ic.doc.automed.p2p.DirectoryServicePeer
public class DirectoryServicePeer
DirectoryServicePeer.java
Represents directory service peer on the network. It is basically an AutoMedPeer
with capabilities of an P2PDirectory object.
As such this class relies on P2PDirectory to serve network requests but
but uses its own handling routine.
| Field Summary | |
|---|---|
private P2PDirectory |
_directory
|
private static DirectoryServicePeer |
_dsp
|
private java.util.List |
_eventListeners
|
private java.util.List |
_requestListeners
|
private SICP |
_sicp
|
| Fields inherited from class uk.ac.ic.doc.automed.p2p.Peer |
|---|
_nsp, _p2pcfg, _rexe |
| Fields inherited from class uk.ac.ic.doc.automed.p2p.AutoMedPeer |
|---|
config, peerAddress, peerObjs, role, ROLE_AUTOMED_PEER, ROLE_DSP, ROLE_PEER, thePeer |
| Constructor Summary | |
|---|---|
protected |
DirectoryServicePeer(java.lang.String name,
PeerStateHandler stateHandler)
Creates a new instance of DirectoryServicePeer |
protected |
DirectoryServicePeer(java.lang.String name,
PeerStateHandler stateHandler,
java.lang.String repCfgFile)
|
| Method Summary | |
|---|---|
void |
addEventListener(java.util.EventListener listener)
Register an EventListener object |
void |
addRequestListener(RequestListener listener)
Register a RequestListener object to client requests |
P2PDirectory |
getDirectory()
Return directory service object |
static DirectoryServicePeer |
getInstance(java.lang.String name,
PeerStateHandler stateHandler)
Returns a single instance of the dsp |
static DirectoryServicePeer |
getInstance(java.lang.String name,
PeerStateHandler stateHandler,
java.lang.String repCfgFile)
|
private void |
init()
|
void |
initDirectoryRepository()
This method allows a peer to indirectly re-initialises the directory repository used by the peer's P2PDirectory instance |
void |
initHelloProtocol()
Intialise the hello protocol for directory service |
NSP |
initNSP()
|
void |
initSICP()
Initialises SICP protocol |
| Methods inherited from class uk.ac.ic.doc.automed.p2p.Peer |
|---|
close, finalize, getAddress, getDefaultP2PConfig, getDHTProtocol, getDSRConfigFileName, getNSP, getQEP, getQueryAggregator, getREXEP, getSICP, getSMRProtocol, initSMRProtocol, isDSRConfigurationChanged, isSMREnabled, newPeer, newPeer, newPeer, newPeer, newPeer, newPeerProcess, outputQuery, refreshDSRConfiguration, requestAbstractPathToSource, requestQuery, shutDownSMRProtocol |
| Methods inherited from class uk.ac.ic.doc.automed.p2p.communication.AbstractRequestListener |
|---|
getRequestMessage, getResponseData, getType, handleRequest, handleRequest, handleRequest, handleUDPRequest, handleUDPRequest, handleUDPRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static DirectoryServicePeer _dsp
private java.util.List _requestListeners
private java.util.List _eventListeners
private P2PDirectory _directory
private SICP _sicp
| Constructor Detail |
|---|
protected DirectoryServicePeer(java.lang.String name,
PeerStateHandler stateHandler)
throws StateChangedException,
AutoMedException
StateChangedException
AutoMedException
protected DirectoryServicePeer(java.lang.String name,
PeerStateHandler stateHandler,
java.lang.String repCfgFile)
throws StateChangedException,
AutoMedException
StateChangedException
AutoMedException| Method Detail |
|---|
public static DirectoryServicePeer getInstance(java.lang.String name,
PeerStateHandler stateHandler)
throws StateChangedException,
AutoMedException
StateChangedException
AutoMedException
public static DirectoryServicePeer getInstance(java.lang.String name,
PeerStateHandler stateHandler,
java.lang.String repCfgFile)
throws StateChangedException,
AutoMedException
StateChangedException
AutoMedException
private void init()
throws AutoMedException
AutoMedException
public void initDirectoryRepository()
throws AutoMedException
P2PDirectory instance
initDirectoryRepository in class AutoMedPeerAutoMedExceptionpublic P2PDirectory getDirectory()
getDirectory in class AutoMedPeerpublic void addRequestListener(RequestListener listener)
RequestListener object to client requests
addRequestListener in class AutoMedPeerpublic void addEventListener(java.util.EventListener listener)
EventListener object
public void initHelloProtocol()
throws CommunicationException,
AutoMedException
initHelloProtocol in class PeerCommunicationException
AutoMedExceptionpublic void initSICP()
initSICP in class Peerpublic NSP initNSP()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||