|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.ssl.SSLTransportLayerImpl<Identifier,MessageType>
Identifier
- public class SSLTransportLayerImpl<Identifier,MessageType>
Does not encrypt UDP messages The server authenticates to the client via a CACert
Field Summary | |
---|---|
protected TransportLayerCallback<Identifier,MessageType> |
callback
|
protected javax.net.ssl.SSLContext |
context
|
protected Environment |
environment
|
protected ErrorHandler<Identifier> |
errorHandler
|
protected Logger |
logger
|
protected TransportLayer<Identifier,MessageType> |
tl
|
Fields inherited from interface org.mpisws.p2p.transport.ssl.SSLTransportLayer |
---|
CLIENT_AUTH_NONE, CLIENT_AUTH_OPTIONAL, CLIENT_AUTH_REQUIRED, NO, OPTION_AUTHENTICATION, OPTION_CERT_SUBJECT, OPTION_ENCRYPTION, YES |
Constructor Summary | |
---|---|
SSLTransportLayerImpl(TransportLayer<Identifier,MessageType> tl,
java.security.KeyStore keyStore,
java.security.KeyStore trustStore,
Environment env)
|
|
SSLTransportLayerImpl(TransportLayer<Identifier,MessageType> tl,
java.security.KeyStore keyStore,
java.security.KeyStore trustStore,
int clientAuth,
Environment env)
|
Method Summary | |
---|---|
void |
acceptMessages(boolean b)
Toggle accepting incoming messages. |
void |
acceptSockets(boolean b)
Toggle accepting new sockets. |
void |
destroy()
|
Identifier |
getLocalIdentifier()
The local node. |
protected SSLSocketManager<Identifier> |
getSocketManager(SSLTransportLayerImpl<Identifier,?> sslTL,
P2PSocket<Identifier> s,
Continuation<SSLSocketManager<Identifier>,java.lang.Exception> c,
boolean server,
boolean useClientAuth)
|
void |
incomingSocket(P2PSocket<Identifier> s)
TODO: support resuming |
void |
messageReceived(Identifier i,
MessageType m,
java.util.Map<java.lang.String,java.lang.Object> options)
Called when a new message is received. |
SocketRequestHandle<Identifier> |
openSocket(Identifier i,
SocketCallback<Identifier> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Open a socket to the Identifier |
MessageRequestHandle<Identifier,MessageType> |
sendMessage(Identifier i,
MessageType m,
MessageCallback<Identifier,MessageType> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Send the message to the identifier |
void |
setCallback(TransportLayerCallback<Identifier,MessageType> callback)
Set the callback for incoming sockets/messages |
void |
setErrorHandler(ErrorHandler<Identifier> handler)
To be notified of problems not related to an outgoing messaage/socket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TransportLayer<Identifier,MessageType> tl
protected TransportLayerCallback<Identifier,MessageType> callback
protected ErrorHandler<Identifier> errorHandler
protected Logger logger
protected Environment environment
protected javax.net.ssl.SSLContext context
Constructor Detail |
---|
public SSLTransportLayerImpl(TransportLayer<Identifier,MessageType> tl, java.security.KeyStore keyStore, java.security.KeyStore trustStore, Environment env) throws java.io.IOException
java.io.IOException
public SSLTransportLayerImpl(TransportLayer<Identifier,MessageType> tl, java.security.KeyStore keyStore, java.security.KeyStore trustStore, int clientAuth, Environment env) throws java.io.IOException
tl
- ks
- set a cert on the client, and optionally a keypair (if want clientauth), on the server, need a keypair, cert if want clientauthclientAuth
- NO, OPTIONAL, REQUIRED // on the server sideenv
-
java.lang.Exception
java.io.IOException
Method Detail |
---|
public SocketRequestHandle<Identifier> openSocket(Identifier i, SocketCallback<Identifier> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
openSocket
in interface TransportLayer<Identifier,MessageType>
i
- who to open the socket todeliverSocketToMe
- the callback when the socket is openedoptions
- options on how to open the socket (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
public void incomingSocket(P2PSocket<Identifier> s) throws java.io.IOException
incomingSocket
in interface TransportLayerCallback<Identifier,MessageType>
s
- the incoming socket
java.io.IOException
public void setCallback(TransportLayerCallback<Identifier,MessageType> callback)
TransportLayer
setCallback
in interface TransportLayer<Identifier,MessageType>
callback
- the callback for incoming sockets/messagespublic void acceptMessages(boolean b)
TransportLayer
acceptMessages
in interface TransportLayer<Identifier,MessageType>
public void acceptSockets(boolean b)
TransportLayer
acceptSockets
in interface TransportLayer<Identifier,MessageType>
public void destroy()
destroy
in interface Destructable
public Identifier getLocalIdentifier()
TransportLayer
getLocalIdentifier
in interface TransportLayer<Identifier,MessageType>
public MessageRequestHandle<Identifier,MessageType> sendMessage(Identifier i, MessageType m, MessageCallback<Identifier,MessageType> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
TransportLayer
sendMessage
in interface TransportLayer<Identifier,MessageType>
i
- the destinationm
- the messagedeliverAckToMe
- layer dependent notification when the message is sent (can indicate placed on the wire, point-to-point acknowledgment, or end-to-end acknowledgement)options
- delivery options (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
public void setErrorHandler(ErrorHandler<Identifier> handler)
TransportLayer
setErrorHandler
in interface TransportLayer<Identifier,MessageType>
handler
- to be notified of problems not related to a specific messaage/socket.public void messageReceived(Identifier i, MessageType m, java.util.Map<java.lang.String,java.lang.Object> options) throws java.io.IOException
TransportLayerCallback
messageReceived
in interface TransportLayerCallback<Identifier,MessageType>
i
- The node it is coming fromm
- the messageoptions
- describe how the message arrived (udp/tcp, encrypted etc)
java.io.IOException
- if there is a problem decoding the messageprotected SSLSocketManager<Identifier> getSocketManager(SSLTransportLayerImpl<Identifier,?> sslTL, P2PSocket<Identifier> s, Continuation<SSLSocketManager<Identifier>,java.lang.Exception> c, boolean server, boolean useClientAuth)
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |