org.kth.dks.dks_node
Class DKSNode

java.lang.Object
  extended by org.kth.dks.dks_node.DKSNode
All Implemented Interfaces:
DKSCallbackInterface, DKSMessagingInterface

public class DKSNode
extends java.lang.Object
implements DKSCallbackInterface, DKSMessagingInterface


Field Summary
protected  ConnectionManager cm
           
static int F
           
static int K
           
static int L
           
 DKSMarshal marshal
           
static long N
           
 
Constructor Summary
DKSNode()
           
 
Method Summary
 void ackByeH(DKSRef source, AckByeMsg msg)
           
 void ackHelloH(DKSRef nj, AckHelloMsg msg)
           
 void ackJoinInitH(DKSRef nj, AckJoinInitMsg msg)
           
 void adaptH(DKSRef nj, AdaptMsg msg)
           
 void adaptLeaveH(DKSRef nj, AdaptLeaveMsg msg)
           
 boolean addMsgHandler(DKSMessage msg, java.lang.Object handlerObject, java.lang.String methodName)
           
 void badPointerH(DKSRef sender, BadPointerMsg msg)
           
 void becomeNormalH(DKSRef nj, BecomeNormalMsg msg)
           
 DKSRef bestCandidate(DKSRef node, long target)
           
 void broadCast(DKSObject message)
           
 void broadCastH(DKSRef sender, BroadCastMsg msg)
           
 void broadCastRestricted(DKSObject message, long startId, long endId)
           
 void broadCastRestrictedCallback(DKSObject message)
           
 void byeH(DKSRef source, ByeMsg msg)
           
 void cocJoinInterleavedH(DKSRef succ, CorrectionOnJoinMsg msg)
           
 void cocJoinNotificationH(CorrectionOnJoinMsg msg)
           
 void cocLeaveNotificationH(CorrectionOnLeaveMsg msg)
           
 void correctionOnChangeH(CorrectionOnChangeInterface cocMsg)
           
 void correctionOnChangeJoin()
           
 void correctionOnChangeLeave(DKSRef leavingPred, DKSRef leavingNode, DKSRef leavingSucc)
           
 boolean correctionOnUse(DKSRef sender, ForwardedMsgInterface msg)
           
 void failureHandler(DKSRef src, FailureMsg fm)
           
 AsyncOperation findResponsible(long identifier)
           
 void fixNextPointer(DKSRef targetRef)
           
 void forward(ForwardedMsgInterface msg)
           
 CommunicationInfo getComInfo()
           
 java.io.Serializable getDebugInfo()
           
 java.util.List getDependentIntervals(DKSRef pred, DKSRef succ)
           
 DKSMarshal getDKSMarshal()
           
 DKSRef getDKSRef()
           
 MessageInfo[] getMessageInfo()
           
 java.util.Set getNeighboursSet()
           
 NodeInfo getNodeInfo()
           
 void goodBye()
           
 void heartbeatH(DKSRef succ, HeartbeatMsg hm)
           
 void helloH(DKSRef nj, HelloMsg msg)
           
 void insertNodeH(DKSRef nj, InsertNodeMsg msg)
           
protected  void installHandlers()
           
 void joinCallbackReturn()
          INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.joinCallback() is called
 void joinInitH(DKSRef np, JoinInitMsg msg)
           
 void leaveAcceptH(DKSRef source, LeaveAcceptMsg msg)
           
 void leaveCallbackReturn()
          INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.leaveCallback() is called
 void leaveRejectH(DKSRef source, LeaveRejectMsg msg)
           
 void leaveRequestH(DKSRef source, LeaveRequestMsg msg)
           
 DKSObject[] lookup(long key)
           
 void lookupH(DKSRef np, LookupMsg msg)
           
 void lookupRequestH(DKSRef sender, LookupRequestMsg lm)
           
 void lookupResponseH(DKSRef np, LookupResponseMsg lrm)
           
 void lookupResultH(DKSRef np, LookupResultMsg msg)
           
 AsyncOperation newNode(DKSRef nj, DKSRef n)
           
 void nodeLeftH(DKSRef coord, NodeLeftMsg m)
           
 AsyncOperation prepareForLeave()
           
 void restartJoinH(DKSRef nj, RestartJoinMsg msg)
           
 void restartOperationH(DKSRef from, RestartOperationMsg msg)
           
 AsyncOperation route(long identifier, DKSObject payload)
           
 void routeAsync(long identifier, DKSObject payload)
           
 void routeAsync(long identifier, DKSObject payload, boolean internal)
           
 void routeAsyncFrom(long identifier, DKSObject payload, boolean internal, DKSRef firstNode)
           
 void search(long key, javax.swing.JTextField jtvalue, java.lang.String msgId)
           
 boolean send(DKSRef dest, DKSMessage msg)
          Send a message directly to a node.
 DKSCallbackInterface setCallbackHandler(DKSAppInterface appHandler)
          Instructs the DKS system to pass on all received messages to the specified DKSAppInterface which contains the proper callbacks.
 void setConnectionManager(ConnectionManager cm, DKSRef _dksRef)
           
 void setMarshall(DKSMarshal dksMarshall)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marshal

public DKSMarshal marshal

N

public static long N

K

public static int K

L

public static int L

F

public static int F

cm

protected ConnectionManager cm
Constructor Detail

DKSNode

public DKSNode()
Method Detail

setConnectionManager

public void setConnectionManager(ConnectionManager cm,
                                 DKSRef _dksRef)
                          throws DKSNodeAlreadyRegistered
Throws:
DKSNodeAlreadyRegistered

setMarshall

public void setMarshall(DKSMarshal dksMarshall)

send

public boolean send(DKSRef dest,
                    DKSMessage msg)
Description copied from interface: DKSMessagingInterface
Send a message directly to a node.

Specified by:
send in interface DKSMessagingInterface
Parameters:
dest - The destination address.
msg - The message to be sent.

nodeLeftH

public void nodeLeftH(DKSRef coord,
                      NodeLeftMsg m)

getNeighboursSet

public java.util.Set getNeighboursSet()

newNode

public AsyncOperation newNode(DKSRef nj,
                              DKSRef n)
                       throws DKSRefNoResponse
Throws:
DKSRefNoResponse

insertNodeH

public void insertNodeH(DKSRef nj,
                        InsertNodeMsg msg)

restartOperationH

public void restartOperationH(DKSRef from,
                              RestartOperationMsg msg)

joinInitH

public void joinInitH(DKSRef np,
                      JoinInitMsg msg)

joinCallbackReturn

public void joinCallbackReturn()
Description copied from interface: DKSCallbackInterface
INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.joinCallback() is called

Specified by:
joinCallbackReturn in interface DKSCallbackInterface
See Also:
DKSAppInterface

helloH

public void helloH(DKSRef nj,
                   HelloMsg msg)

ackHelloH

public void ackHelloH(DKSRef nj,
                      AckHelloMsg msg)

ackJoinInitH

public void ackJoinInitH(DKSRef nj,
                         AckJoinInitMsg msg)

fixNextPointer

public void fixNextPointer(DKSRef targetRef)

becomeNormalH

public void becomeNormalH(DKSRef nj,
                          BecomeNormalMsg msg)

getDependentIntervals

public java.util.List getDependentIntervals(DKSRef pred,
                                            DKSRef succ)

correctionOnChangeJoin

public void correctionOnChangeJoin()

correctionOnChangeLeave

public void correctionOnChangeLeave(DKSRef leavingPred,
                                    DKSRef leavingNode,
                                    DKSRef leavingSucc)

cocJoinNotificationH

public void cocJoinNotificationH(CorrectionOnJoinMsg msg)

cocJoinInterleavedH

public void cocJoinInterleavedH(DKSRef succ,
                                CorrectionOnJoinMsg msg)

cocLeaveNotificationH

public void cocLeaveNotificationH(CorrectionOnLeaveMsg msg)

correctionOnChangeH

public void correctionOnChangeH(CorrectionOnChangeInterface cocMsg)

restartJoinH

public void restartJoinH(DKSRef nj,
                         RestartJoinMsg msg)
                  throws DKSTooManyRestartJoins
Throws:
DKSTooManyRestartJoins

adaptH

public void adaptH(DKSRef nj,
                   AdaptMsg msg)

adaptLeaveH

public void adaptLeaveH(DKSRef nj,
                        AdaptLeaveMsg msg)

prepareForLeave

public AsyncOperation prepareForLeave()

leaveRequestH

public void leaveRequestH(DKSRef source,
                          LeaveRequestMsg msg)

leaveAcceptH

public void leaveAcceptH(DKSRef source,
                         LeaveAcceptMsg msg)

leaveCallbackReturn

public void leaveCallbackReturn()
Description copied from interface: DKSCallbackInterface
INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.leaveCallback() is called

Specified by:
leaveCallbackReturn in interface DKSCallbackInterface
See Also:
DKSAppInterface

leaveRejectH

public void leaveRejectH(DKSRef source,
                         LeaveRejectMsg msg)

byeH

public void byeH(DKSRef source,
                 ByeMsg msg)

ackByeH

public void ackByeH(DKSRef source,
                    AckByeMsg msg)

goodBye

public void goodBye()

lookupRequestH

public void lookupRequestH(DKSRef sender,
                           LookupRequestMsg lm)

lookupH

public void lookupH(DKSRef np,
                    LookupMsg msg)

lookupResponseH

public void lookupResponseH(DKSRef np,
                            LookupResponseMsg lrm)

lookupResultH

public void lookupResultH(DKSRef np,
                          LookupResultMsg msg)

broadCastH

public void broadCastH(DKSRef sender,
                       BroadCastMsg msg)

badPointerH

public void badPointerH(DKSRef sender,
                        BadPointerMsg msg)

forward

public void forward(ForwardedMsgInterface msg)

bestCandidate

public DKSRef bestCandidate(DKSRef node,
                            long target)

correctionOnUse

public boolean correctionOnUse(DKSRef sender,
                               ForwardedMsgInterface msg)

findResponsible

public AsyncOperation findResponsible(long identifier)

route

public AsyncOperation route(long identifier,
                            DKSObject payload)

routeAsync

public void routeAsync(long identifier,
                       DKSObject payload)

routeAsync

public void routeAsync(long identifier,
                       DKSObject payload,
                       boolean internal)

routeAsyncFrom

public void routeAsyncFrom(long identifier,
                           DKSObject payload,
                           boolean internal,
                           DKSRef firstNode)

getDKSMarshal

public DKSMarshal getDKSMarshal()

setCallbackHandler

public DKSCallbackInterface setCallbackHandler(DKSAppInterface appHandler)
Description copied from interface: DKSCallbackInterface
Instructs the DKS system to pass on all received messages to the specified DKSAppInterface which contains the proper callbacks. Please look at DKSAppInterface for more information

Specified by:
setCallbackHandler in interface DKSCallbackInterface
Parameters:
appHandler - DKSAppInterface interface to the application for callbacks
Returns:
DKSCallbackInterface an interface for DKS callbacks, which the application will invoke
See Also:
DKSCallBackInterface, DKSAppInterface

search

public void search(long key,
                   javax.swing.JTextField jtvalue,
                   java.lang.String msgId)

lookup

public DKSObject[] lookup(long key)

getNodeInfo

public NodeInfo getNodeInfo()

getDebugInfo

public java.io.Serializable getDebugInfo()

getComInfo

public CommunicationInfo getComInfo()

getMessageInfo

public MessageInfo[] getMessageInfo()

getDKSRef

public DKSRef getDKSRef()

broadCast

public void broadCast(DKSObject message)

broadCastRestricted

public void broadCastRestricted(DKSObject message,
                                long startId,
                                long endId)

broadCastRestrictedCallback

public void broadCastRestrictedCallback(DKSObject message)

failureHandler

public void failureHandler(DKSRef src,
                           FailureMsg fm)

heartbeatH

public void heartbeatH(DKSRef succ,
                       HeartbeatMsg hm)

addMsgHandler

public boolean addMsgHandler(DKSMessage msg,
                             java.lang.Object handlerObject,
                             java.lang.String methodName)

installHandlers

protected void installHandlers()


Copyright © 2010. All Rights Reserved.