com.sun.sgs.impl.service.nodemap
Interface NodeMappingServer

All Superinterfaces:
Remote
All Known Implementing Classes:
NodeMappingServerImpl

interface NodeMappingServer
extends Remote

Defines the service interface for the global portion of the NodeMappingService.


Method Summary
 boolean assertValid(Identity identity)
          Check the validity of the data store for a particular identity.
 long assignNode(Class service, Identity id, long requestingNode)
          Assigns the identity to a node and indicates that the service class believes this identity is active.
 void canMove(Identity id)
          All IdentityRelocationListeners have completed their work, so it's safe to move the identity.
 void canRemove(Identity id)
          The identity's reference count has gone to zero, so it can be removed.
 void registerNodeListener(NotifyClient client, long nodeId)
          Register a NotifyClient object to be called when changes occur on a particular node.
 void unregisterNodeListener(long nodeId)
          Unregister the NotifyClient object for a node if one is registered.
 

Method Detail

assignNode

long assignNode(Class service,
                Identity id,
                long requestingNode)
                throws IOException
Assigns the identity to a node and indicates that the service class believes this identity is active. If the id has already been assigned to a node, simply return that assignment. If the id is assigned to a node that's not alive, reassign it.

Parameters:
service - the class of the calling service
id - the identity to assign should this be a set?
requestingNode - the id of the node requesting assignment
Returns:
the ID of the node that the identity was assigned to, or -1 if the assignment failed
Throws:
IOException - if a communication problem occurs while invoking this method

canRemove

void canRemove(Identity id)
               throws IOException
The identity's reference count has gone to zero, so it can be removed.

Parameters:
id - the identity which can be removed from the map
Throws:
IOException - if a communication problem occurs while invoking this method

canMove

void canMove(Identity id)
             throws IOException
All IdentityRelocationListeners have completed their work, so it's safe to move the identity.

Parameters:
id - the identity which can now be moved
Throws:
IOException - if a communication problem occurs while invoking this method

registerNodeListener

void registerNodeListener(NotifyClient client,
                          long nodeId)
                          throws IOException
Register a NotifyClient object to be called when changes occur on a particular node. Only one listener object can be registered per nodeId, and registering a listener will clear any previously registered listener for that nodeId.

Registration must only be made during service startup.

Parameters:
client - the callback client
nodeId - the node which client is interested in changes to
Throws:
IOException - if a communication problem occurs while invoking this method

unregisterNodeListener

void unregisterNodeListener(long nodeId)
                            throws IOException
Unregister the NotifyClient object for a node if one is registered.

Parameters:
nodeId - the node
Throws:
IOException - if a communication problem occurs while invoking this method

assertValid

boolean assertValid(Identity identity)
                    throws Exception
Check the validity of the data store for a particular identity. Used for testing.

Parameters:
identity - the identity
Returns:
true if all is well, false if there is a problem
Throws:
Exception - if any error occurs

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved