Project JXTA

net.jxta.impl.endpoint.tls
Class TlsTransport

java.lang.Object
  extended by net.jxta.impl.endpoint.tls.TlsTransport
All Implemented Interfaces:
MessageReceiver, MessageSender, MessageTransport, Module

public class TlsTransport
extends Object
implements Module, MessageSender, MessageReceiver

A JXTA MessageTransport implementation which uses TLS sockets.


Nested Class Summary
(package private)  class TlsTransport.credentialPCL
          Listener for Property Changed Events on our credential
(package private)  class TlsTransport.membershipPCL
          Listener for Property Changed Events on membership service
(package private)  class TlsTransport.TlsLoopbackMessenger
          Extends LoopbackMessenger to add a message property to passed messages so that TLS pipes and other users can be sure that the message originate with the local TLS transport.
 
Field Summary
(package private) static boolean ACT_AS_SERVER
          If true then we can accept incoming connections.
(package private)  ID assignedID
           
(package private)  long CONNECTION_IDLE_TIMEOUT
          Amount of time after which a connection is considered idle and may be scavenged.
(package private)  PSECredential credential
           
(package private)  EndpointService endpoint
           
(package private)  ModuleImplAdvertisement implAdvertisement
           
(package private)  EndpointAddress localPeerAddr
           
(package private)  PeerID localPeerId
          local peerID
(package private)  EndpointAddress localTlsPeerAddr
           
(package private)  PSEMembershipService membership
           
(package private)  long MIN_IDLE_RECONNECT
          Amount of a connection must be idle before a reconnection attempt will be considered.
(package private)  ThreadGroup myThreadGroup
          This is the thread group into which we will place all of the threads we create.
(package private)  long RETRMAXAGE
          Amount if time which retries may remain queued for retrasmission.
(package private)  X509Certificate[] serviceCert
           
 
Fields inherited from interface net.jxta.platform.Module
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK
 
Constructor Summary
TlsTransport()
          Default constructor
 
Method Summary
 boolean allowsRouting()
          
 boolean equals(Object target)
          
 EndpointService getEndpointService()
          
 Messenger getMessenger(EndpointAddress addr, Object hintIgnored)
           XXX bondolo 20040522 The hint could be used in request for the underlying messenger.
(package private)  PeerGroup getPeerGroup()
          
 String getProtocolName()
          
 EndpointAddress getPublicAddress()
          
 Iterator getPublicAddresses()
          
 void init(PeerGroup group, ID assignedID, Advertisement impl)
          
 boolean isConnectionOriented()
          
 boolean isPropagateEnabled()
          (@inheritdoc}
 boolean isPropagationSupported()
          (@inheritdoc}
 boolean ping(EndpointAddress addr)
          
(package private)  void processReceivedMessage(Message msg)
          processReceivedMessage is invoked by the TLS Manager when a message has been completely received and is ready to be delivered to the service/application
 void propagate(Message srcMsg, String pName, String pParam, String prunePeer)
          

TLS provides a point to point secure channel.

 int startApp(String[] args)
          
 void stopApp()
          
 Object transportControl(Object operation, Object Value)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACT_AS_SERVER

static final boolean ACT_AS_SERVER
If true then we can accept incoming connections. Eventually this should be coming out of the transport advertisement.

See Also:
Constant Field Values

assignedID

ID assignedID

implAdvertisement

ModuleImplAdvertisement implAdvertisement

endpoint

EndpointService endpoint

membership

PSEMembershipService membership

serviceCert

X509Certificate[] serviceCert

credential

PSECredential credential

localPeerAddr

EndpointAddress localPeerAddr

localTlsPeerAddr

EndpointAddress localTlsPeerAddr

localPeerId

PeerID localPeerId
local peerID


MIN_IDLE_RECONNECT

long MIN_IDLE_RECONNECT
Amount of a connection must be idle before a reconnection attempt will be considered.


CONNECTION_IDLE_TIMEOUT

long CONNECTION_IDLE_TIMEOUT
Amount of time after which a connection is considered idle and may be scavenged.


RETRMAXAGE

long RETRMAXAGE
Amount if time which retries may remain queued for retrasmission. If still unACKed after this amount of time then the connection is considered dead.


myThreadGroup

ThreadGroup myThreadGroup
This is the thread group into which we will place all of the threads we create. THIS HAS NO EFFECT ON SCHEDULING. Java thread groups are only for organization and naming.

Constructor Detail

TlsTransport

public TlsTransport()
Default constructor

Method Detail

equals

public boolean equals(Object target)

Overrides:
equals in class Object

getPeerGroup

PeerGroup getPeerGroup()


init

public void init(PeerGroup group,
                 ID assignedID,
                 Advertisement impl)
          throws PeerGroupException

Specified by:
init in interface Module
Throws:
PeerGroupException

startApp

public int startApp(String[] args)

Specified by:
startApp in interface Module

stopApp

public void stopApp()

Specified by:
stopApp in interface Module

isConnectionOriented

public boolean isConnectionOriented()

Specified by:
isConnectionOriented in interface MessageSender

allowsRouting

public boolean allowsRouting()

Specified by:
allowsRouting in interface MessageSender

transportControl

public Object transportControl(Object operation,
                               Object Value)

Specified by:
transportControl in interface MessageTransport

getPublicAddress

public EndpointAddress getPublicAddress()

Specified by:
getPublicAddress in interface MessageSender

getEndpointService

public EndpointService getEndpointService()

Specified by:
getEndpointService in interface MessageTransport

getPublicAddresses

public Iterator getPublicAddresses()

Specified by:
getPublicAddresses in interface MessageReceiver

getProtocolName

public String getProtocolName()

Specified by:
getProtocolName in interface MessageTransport

isPropagateEnabled

public boolean isPropagateEnabled()
(@inheritdoc}

Specified by:
isPropagateEnabled in interface MessageSender

isPropagationSupported

public boolean isPropagationSupported()
(@inheritdoc}

Specified by:
isPropagationSupported in interface MessageSender

propagate

public void propagate(Message srcMsg,
                      String pName,
                      String pParam,
                      String prunePeer)
               throws IOException

TLS provides a point to point secure channel. It is not intended to provide a one to many secure channel, therefore propagation is not possible on TlsTransport.

All messages are lost in the ether

Specified by:
propagate in interface MessageSender
Throws:
IOException

ping

public boolean ping(EndpointAddress addr)

Specified by:
ping in interface MessageSender

getMessenger

public Messenger getMessenger(EndpointAddress addr,
                              Object hintIgnored)
XXX bondolo 20040522 The hint could be used in request for the underlying messenger.

Specified by:
getMessenger in interface MessageSender

processReceivedMessage

void processReceivedMessage(Message msg)
processReceivedMessage is invoked by the TLS Manager when a message has been completely received and is ready to be delivered to the service/application


JXTA J2SE