rice.pastry.socket
Class SocketPastrySecurityManager

java.lang.Object
  |
  +--rice.pastry.socket.SocketPastrySecurityManager
All Implemented Interfaces:
rice.pastry.security.PastrySecurityManager

public class SocketPastrySecurityManager
extends java.lang.Object
implements rice.pastry.security.PastrySecurityManager

Security manager for socket connections between nodes.

Version:
$Id: SocketPastrySecurityManager.java,v 1.2 2003/09/22 19:53:06 glchen Exp $
Author:
Guanling Chen, Alan Mislove

Field Summary
private  SocketNodeHandle localhandle
           
private  rice.pastry.PastryNode localnode
           
private  SocketNodeHandlePool pool
           
 
Constructor Summary
SocketPastrySecurityManager(SocketNodeHandle snh, SocketNodeHandlePool snhp)
          Constructor.
 
Method Summary
 java.util.Date getTimestamp()
          Gets the current time for a timestamp.
 void setLocalPastryNode(rice.pastry.PastryNode pn)
          Sets the local Pastry node after it is fully constructed.
 boolean verifyAddressBinding(rice.pastry.security.Credentials cred, rice.pastry.messaging.Address addr)
          Checks to see if these credentials can be associated with the address.
 boolean verifyMessage(rice.pastry.messaging.Message msg)
          This method takes a message and returns true if the message is safe and false otherwise.
 rice.pastry.NodeHandle verifyNodeHandle(rice.pastry.NodeHandle handle)
          Verify node handle safety.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localnode

private rice.pastry.PastryNode localnode

localhandle

private SocketNodeHandle localhandle

pool

private SocketNodeHandlePool pool
Constructor Detail

SocketPastrySecurityManager

public SocketPastrySecurityManager(SocketNodeHandle snh,
                                   SocketNodeHandlePool snhp)
Constructor.

Method Detail

setLocalPastryNode

public void setLocalPastryNode(rice.pastry.PastryNode pn)
Sets the local Pastry node after it is fully constructed.

Parameters:
pn - local Pastry node.

verifyMessage

public boolean verifyMessage(rice.pastry.messaging.Message msg)
This method takes a message and returns true if the message is safe and false otherwise.

Specified by:
verifyMessage in interface rice.pastry.security.PastrySecurityManager
Parameters:
msg - a message.
Returns:
if the message is safe, false otherwise.

verifyAddressBinding

public boolean verifyAddressBinding(rice.pastry.security.Credentials cred,
                                    rice.pastry.messaging.Address addr)
Checks to see if these credentials can be associated with the address.

Specified by:
verifyAddressBinding in interface rice.pastry.security.PastrySecurityManager
Parameters:
cred - some credentials.
addr - an address.
Returns:
true if the credentials match the address, false otherwise.

verifyNodeHandle

public rice.pastry.NodeHandle verifyNodeHandle(rice.pastry.NodeHandle handle)
Verify node handle safety.

Specified by:
verifyNodeHandle in interface rice.pastry.security.PastrySecurityManager
Parameters:
handle - the handle to check.
Returns:
the verified node handle

getTimestamp

public java.util.Date getTimestamp()
Gets the current time for a timestamp.

Specified by:
getTimestamp in interface rice.pastry.security.PastrySecurityManager
Returns:
the timestamp.