|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kth.dks.dks_dht.DKSMCastDHTImpl
public class DKSMCastDHTImpl
| Constructor Summary | |
|---|---|
DKSMCastDHTImpl(ConnectionManager cm,
DKSOverlayAddress over,
DKSDHTCallback cb)
cb is the callback object |
|
| Method Summary | |
|---|---|
boolean |
addMsgHandler(DKSMessage msg,
java.lang.Object handlerObject,
java.lang.String methodName)
Registers a handler for a DKSMessage. |
boolean |
addMsgHandler(java.lang.String messageClassZ,
java.lang.String handlerClassZ,
java.lang.String handlerMethodZ,
java.lang.Object handlerObject)
Install a message message handler, @see ObjectAdapter.addMsgHandler() |
void |
addToBinding(long key,
DKSObject value)
Value is added to the list of bindings associated with key. |
void |
broadcast(DKSObject message)
Broadcast a message to all nodes |
void |
broadcastRestricted(DKSObject message,
long startId,
long endId)
Broadcasts to nodes with identifiers within the rand startId and endId [] |
void |
changeBinding(long key,
DKSObject oldValue,
DKSObject newValue)
All ocurrences of oldValue in the bindings associated with key are replaced by newValue. |
void |
create()
Called by the first node in a ring, this will create a new DKS network containing one node only |
DKSMCastDHTInterface |
createGroup(long gid,
DKSDHTCallback cb)
Create a new multicast group with a specific group id. |
void |
dhtBroadcastCallback(DKSObject value)
Receive a broadcast message |
DKSMessage |
dhtRouteCallback(long identifier,
DKSMessage value)
The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer. |
void |
dhtRouteCallbackAsync(long identifier,
DKSMessage payload)
The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer. |
DKSRef |
findResponsible(long identifier)
Will find the DKS node that is responsible for the given identifier |
DKSDHTImpl |
getDHT()
Return a reference to the underlying DKSDHT |
DKSRef |
getDKSRef()
Returns the DKSRef associated to this DKS node |
java.lang.String |
getDKSURL()
Returns the DKSURL (stringified DKSRef) used by this DKS node |
DKSRef[] |
getGroupInfo(long gid)
Return the members of the group. |
void |
join(DKSRef existingnodeAddress)
Adds a new node to the network managed by the local DKS implementation. |
DKSMCastDHTInterface |
joinGroup(long gid,
DKSDHTCallback cb)
Join an existing multicast group with a specific group id. |
void |
leave()
Disconnect the local node from the network. |
void |
logLevel(int level)
Set the logging level |
DKSObject[] |
lookupBinding(long key)
Returns a vector of DKSObjects associated with key
in the DHT |
DKSObject[] |
lookupBinding(long minKey,
long maxKey)
Returns an array of all bindings associated with keys greater than or equal to minKey, and less than or equal to maxKey. |
void |
removeFromBinding(long key,
DKSObject value)
Value is removed from the list of bindings associated with key. |
DKSObject |
route(long identifier,
DKSObject payload)
Will route a message the DKS node that is responsible for the given identifier, and call routeCallback() at that node and give it the payload, upon which the responsible node will respond with a payload which is returned to the caller |
void |
routeAsync(long identifier,
DKSObject payload)
Will route a message the DKS node that is responsible for the given identifier, and call routeCallbackAsync() at that node and give it the payload, upon which the responsible node will respond with a payload which is returned to the caller |
void |
routeAsyncFrom(long identifier,
DKSObject payload,
DKSRef fromNode)
Will route a message from fromNode to the DKS node that is responsible for the given identifier, and call routeCallbackAsync() at that node and give it the payload, upon which the responsible node will respond with a payload which is returned to the caller |
void |
send(DKSRef target,
DKSMessage message)
Sends a DKSMessage to a DKS node |
void |
unregisterNode()
Every object implementing this interface gets registered in a ConnectionManager, this method this method unregisters the object in the ConnectionManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DKSMCastDHTImpl(ConnectionManager cm,
DKSOverlayAddress over,
DKSDHTCallback cb)
| Method Detail |
|---|
public DKSMCastDHTInterface createGroup(long gid,
DKSDHTCallback cb)
throws DKSIdentifierAlreadyTaken,
DKSTooManyRestartJoins
createGroup in interface DKSMCastDHTInterfaceDKSIdentifierAlreadyTaken
DKSTooManyRestartJoins
public DKSMCastDHTInterface joinGroup(long gid,
DKSDHTCallback cb)
throws DKSMCastNoSouchGroup,
DKSIdentifierAlreadyTaken,
DKSRefNoResponse
joinGroup in interface DKSMCastDHTInterfaceDKSMCastNoSouchGroup
DKSIdentifierAlreadyTaken
DKSRefNoResponse
public DKSRef[] getGroupInfo(long gid)
throws DKSMCastNoSouchGroup
getGroupInfo in interface DKSMCastDHTInterfaceDKSMCastNoSouchGroup
public void addToBinding(long key,
DKSObject value)
addToBinding in interface DKSDHTInterface
public void removeFromBinding(long key,
DKSObject value)
removeFromBinding in interface DKSDHTInterface
public void changeBinding(long key,
DKSObject oldValue,
DKSObject newValue)
changeBinding in interface DKSDHTInterfacepublic DKSObject[] lookupBinding(long key)
key
in the DHT
lookupBinding in interface DKSDHTInterfacekey - long specifying the key to be looked up
DKSObject[] with values associated to
key
public DKSObject[] lookupBinding(long minKey,
long maxKey)
lookupBinding in interface DKSDHTInterfacepublic void broadcast(DKSObject message)
broadcast in interface DKSDHTInterfacebroadcast in interface DKSInterface
public void broadcastRestricted(DKSObject message,
long startId,
long endId)
broadcastRestricted in interface DKSInterfacemessage - DKSObject message to be sentstartId - long beginning of the intervalendId - long end of the interval
public void join(DKSRef existingnodeAddress)
throws DKSIdentifierAlreadyTaken,
DKSTooManyRestartJoins,
DKSRefNoResponse
join in interface DKSInterfacenodeId - The unique DKS node identifier (key) for the new node.nodeAddress - The location of the new node on the physical
underlying network.
DKSIdentifierAlreadyTaken
DKSTooManyRestartJoins
DKSRefNoResponsepublic void create()
create in interface DKSInterfaceexistingnodeAddress - DKSOverlayAddresspublic void logLevel(int level)
logLevel in interface DKSInterfacelevel - int, 0 means no logging, 1 means debug prints, 2
means XML dumpspublic void leave()
leave in interface DKSInterfacepublic DKSRef findResponsible(long identifier)
findResponsible in interface DKSInterfaceidentifier - whose responsible node is being queried for
public DKSObject route(long identifier,
DKSObject payload)
route in interface DKSInterfaceidentifier - whose responsible node being routed topayload - to be sent to the responsible node
DKSAppInterface
public void routeAsync(long identifier,
DKSObject payload)
routeAsync in interface DKSInterfaceidentifier - whose responsible node being routed topayload - to be sent to the responsible nodeDKSAppInterface
public void routeAsyncFrom(long identifier,
DKSObject payload,
DKSRef fromNode)
routeAsyncFrom in interface DKSInterfaceidentifier - whose responsible node being routed topayload - to be sent to the responsible nodefromNode - DKSRefDKSAppInterfacepublic java.lang.String getDKSURL()
getDKSURL in interface DKSInterfaceDKSRefpublic void unregisterNode()
unregisterNode in interface DKSInterfacepublic void dhtBroadcastCallback(DKSObject value)
dhtBroadcastCallback in interface DKSDHTCallback
public DKSMessage dhtRouteCallback(long identifier,
DKSMessage value)
dhtRouteCallback in interface DKSDHTCallbackidentifier - long, the identifier searched for in route,
maybe not interesting for the app in many cases.payload - DKSObject, the actual payload sent by the source
public void dhtRouteCallbackAsync(long identifier,
DKSMessage payload)
dhtRouteCallbackAsync in interface DKSDHTCallbackidentifier - long, the identifier searched for in route,
maybe not interesting for the app in many cases.payload - DKSObject, the actual payload sent by the sourcepublic DKSDHTImpl getDHT()
getDHT in interface DKSDHTVisualizationInterface
public void send(DKSRef target,
DKSMessage message)
DKSInterface
send in interface DKSInterfacetarget - a DKSRef to a node in the systemmessage - a DKSMessagepublic DKSRef getDKSRef()
DKSInterface
getDKSRef in interface DKSInterfaceDKSRef
public boolean addMsgHandler(DKSMessage msg,
java.lang.Object handlerObject,
java.lang.String methodName)
DKSInterface
addMsgHandler in interface DKSInterfacemsg - Some object which is a subclass of DKSMessagehandlerObject - Object whose method will be invoked upon receipt of a message of type DKSMessagemethodName - full case sensitive of the method to be invoked(without paranthesis). The method has a predefined signature
as described in the following example.
Example: if the method name is "handleStore", there should a method in handlerObject with the signature
public void handleStore(DKSRef sender, msgClass msg)msg.
DKSInterface.addMsgHandler()
public boolean addMsgHandler(java.lang.String messageClassZ,
java.lang.String handlerClassZ,
java.lang.String handlerMethodZ,
java.lang.Object handlerObject)
addMsgHandler in interface DKSMCastDHTInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||