|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.cm.Srdi
public class Srdi
Srdi is a service which provides Srdi functionalities such as :
Nested Class Summary | |
---|---|
static interface |
Srdi.SrdiInterface
Interface for pushing entries. |
Field Summary | |
---|---|
static int |
RPV_REPLICATION_THRESHOLD
|
Constructor Summary | |
---|---|
Srdi(PeerGroup group,
String handlername,
Srdi.SrdiInterface srdiService,
SrdiIndex srdiIndex,
long connectPollInterval,
long pushInterval)
Starts the Srdi Service. wait for connectPollInterval prior to pushing the index if connected to a rdv, otherwise index is as soon as the Rendezvous connect occurs |
Method Summary | |
---|---|
void |
forwardQuery(Object peer,
ResolverQueryMsg query)
Forwards a Query to a specific peer hopCount is incremented to indicate this query is forwarded |
void |
forwardQuery(Vector peers,
ResolverQueryMsg query)
Forwards a Query to a list of peers hopCount is incremented to indicate this query is forwarded |
void |
forwardQuery(Vector peers,
ResolverQueryMsg query,
int threshold)
Forwards a Query to a list of peers if the list of peers exceeds threshold, and random threshold is picked from peers
hopCount is incremented to indicate this query is forwarded |
void |
forwardSrdiMessage(PeerID peerid,
PeerID srcPid,
String primaryKey,
String secondarykey,
String value,
long expiration)
forward srdi message to another peer |
Vector |
getGlobalPeerView()
get the global peerview as the rendezvous service only returns the peerview without the local RDV peer. |
PeerID |
getReplicaPeer(String expression)
Given an expression return a peer from the list peers in the peerview this function is used to to give a replication point, and entry point to query on a pipe |
void |
pushSrdi(ID peer,
SrdiMessage srdi)
Push an SRDI message to a peer ttl is 1, and therefore services receiving this message could choose to replicate this message |
protected Vector |
randomResult(Vector result,
int threshold)
returns a random vector(threshold) from a given vector |
void |
rendezvousEvent(RendezvousEvent event)
|
void |
replicateEntries(SrdiMessage srdiMsg)
Replicates a SRDI message to other rendezvous' entries are replicated by breaking out entries out of the message and sorted out into rdv distribution bins. after which smaller messages are sent to other rdv's |
void |
run()
Main processing method for the SRDI Worker thread Send all entries, wait for pushInterval, then send deltas |
void |
stop()
stop the current running thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RPV_REPLICATION_THRESHOLD
Constructor Detail |
---|
public Srdi(PeerGroup group, String handlername, Srdi.SrdiInterface srdiService, SrdiIndex srdiIndex, long connectPollInterval, long pushInterval)
group
- group context to operate inhandlername
- the SRDI handlernamesrdiService
- the service utilizing this Srdi, for purposes of
callback push entries on events such as rdv connect/disconnect, etc.srdiIndex
- The index instance associated with this serviceconnectPollInterval
- initial timeout before the very first push of entries in millisecondspushInterval
- the Interval at which the deltas are pushed in millisecondsMethod Detail |
---|
public void stop()
public void replicateEntries(SrdiMessage srdiMsg)
srdiMsg
- srdi message to replicatepublic void pushSrdi(ID peer, SrdiMessage srdi)
peer
- peer to push message to, if peer is null it is
the message is propagatedsrdi
- SRDI message to sendpublic void forwardQuery(Object peer, ResolverQueryMsg query)
peer
- peerid to forward query toquery
- The querypublic void forwardQuery(Vector peers, ResolverQueryMsg query)
peers
- The peerids to forward query toquery
- The querypublic void forwardQuery(Vector peers, ResolverQueryMsg query, int threshold)
peers
hopCount is incremented to indicate this query is forwarded
peers
- The peerids to forward query toquery
- The queryprotected Vector randomResult(Vector result, int threshold)
public PeerID getReplicaPeer(String expression)
expression
- expression to derive the mapping from
public void forwardSrdiMessage(PeerID peerid, PeerID srcPid, String primaryKey, String secondarykey, String value, long expiration)
peerid
- PeerID to forward query tosrcPid
- The source originatorprimaryKey
- primary keysecondarykey
- secondary keyvalue
- value of the entryexpiration
- expiration in mspublic void rendezvousEvent(RendezvousEvent event)
rendezvousEvent
in interface RendezvousListener
public void run()
run
in interface Runnable
public Vector getGlobalPeerView()
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |