|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.tls.TlsTransport
public class TlsTransport
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 retransmission. |
(package private) X509Certificate[] |
serviceCert
|
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
TlsTransport()
Default constructor |
Method Summary | |
---|---|
boolean |
allowsRouting()
Returns true if the Message Transport can be used by the EndpointRouter. |
boolean |
equals(Object target)
|
EndpointService |
getEndpointService()
Returns the endpoint service with which this MessageTransport is registered. |
Messenger |
getMessenger(EndpointAddress addr,
Object hintIgnored)
Return a Messenger for sending messages to the specified
destination EndpointAddress . |
(package private) PeerGroup |
getPeerGroup()
|
String |
getProtocolName()
Returns a String containing the name of the protocol used by this MessageTransport. |
EndpointAddress |
getPublicAddress()
Returns the EndpointAddress which will be used as the source
address for all messages sent by this message sender. |
Iterator |
getPublicAddresses()
Returns an Iterator of all of the EndpointAddresses by which this
MessageReceiver is reachable. |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
boolean |
isConnectionOriented()
Returns true if the Message Transport is connection oriented
(like TCP/IP). |
boolean |
ping(EndpointAddress addr)
Returns true if the specified destination address is reachable
via this Message Transport otherwise returns false . |
(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 |
int |
startApp(String[] args)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
Object |
transportControl(Object operation,
Object Value)
Pass a transport control object to a message transport. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean ACT_AS_SERVER
ID assignedID
ModuleImplAdvertisement implAdvertisement
EndpointService endpoint
PSEMembershipService membership
X509Certificate[] serviceCert
PSECredential credential
EndpointAddress localPeerAddr
EndpointAddress localTlsPeerAddr
PeerID localPeerId
long MIN_IDLE_RECONNECT
long CONNECTION_IDLE_TIMEOUT
long RETRMAXAGE
ThreadGroup myThreadGroup
Constructor Detail |
---|
public TlsTransport()
Method Detail |
---|
public boolean equals(Object target)
equals
in class Object
PeerGroup getPeerGroup()
public void init(PeerGroup group, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.impl
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.
PeerGroupException
- This module failed to initialize.public int startApp(String[] args)
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
args
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
stopApp
in interface Module
public boolean isConnectionOriented()
true
if the Message Transport is connection oriented
(like TCP/IP). Indicates that the Message Transport can provide
efficient transport of a series of messages to the same destination.
isConnectionOriented
in interface MessageSender
true
if the Message Transport is connection oriented.public boolean allowsRouting()
getReachableEndpointAddresses
.
allowsRouting
in interface MessageSender
public Object transportControl(Object operation, Object Value)
transportControl
in interface MessageTransport
operation
- Object that specifies the type of control operation
to be performedValue
- Object that specifies a value object associated
with the control operation
public EndpointAddress getPublicAddress()
EndpointAddress
which will be used as the source
address for all messages sent by this message sender. This is the
"preferred" address to which replies should be sent. This address is not
necessarily the best or only address by which the peer may be reached.
The public address may also be for a different message transport.
getPublicAddress
in interface MessageSender
public EndpointService getEndpointService()
getEndpointService
in interface MessageTransport
public Iterator getPublicAddresses()
EndpointAddresses
by which this
MessageReceiver is reachable. The list is in order of
"preference" with the most "preferred" EndpointAddress being at the
beginning of the list.
getPublicAddresses
in interface MessageReceiver
public String getProtocolName()
EndpointAddress
.
getProtocolName
in interface MessageTransport
public boolean ping(EndpointAddress addr)
true
if the specified destination address is reachable
via this Message Transport otherwise returns false
.
ping
in interface MessageSender
addr
- Address to ping
true
if the specified destination address is reachable
via this Message Transport otherwise returns false
.public Messenger getMessenger(EndpointAddress addr, Object hintIgnored)
Messenger
for sending messages to the specified
destination EndpointAddress
.
XXX bondolo 20040522 The hint could be used in request for the
underlying messenger.
getMessenger
in interface MessageSender
addr
- The destination address for which a messenger is requested.hintIgnored
- An optional hint for the transport to use when creating the
messenger. The format of the hint is specific to each Message Transport
and may be null
if no hint is provided.
null
if the destination is not reachable.void processReceivedMessage(Message msg)
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |