cgl.narada.transport.sslHttpBase
Class LinkFactoryImpl

java.lang.Object
  extended by cgl.narada.transport.sslHttpBase.LinkFactoryImpl
All Implemented Interfaces:
LinkFactory, TransportDataListener
Direct Known Subclasses:
HTTPLinkFactory, HTTPSLinkFactory, SSLLinkFactory

public abstract class LinkFactoryImpl
extends Object
implements LinkFactory, TransportDataListener

A utility link factory implementation from which SSL/HTTP transport derive. All the common code such as link management, link acceptor, ... are in this class.

Version:
1.0

Field Summary
protected  TransportFactory m_factory
           
protected  Hashtable m_key2transport
           
protected  LinkManager m_linkManager
           
protected  long m_statusInterval
           
protected  Hashtable m_transport2key
           
protected  cgl.narada.transport.sslHttpBase.LinkFactoryImpl.TransportAcceptor m_transportAcceptor
           
protected  TransportHandler m_transportHandler
           
 
Constructor Summary
LinkFactoryImpl(TransportFactory factory, String type)
          -------------------------------------------------------------------
 
Method Summary
 Link createLink(Properties connectionProperties)
          -------------------------------------------------------------------
 void dataReceived(Transport transport, byte[] message)
          ------------------------------------------------------------------- Handles incoming message from transports initiated from this factory.
 void dispose()
          -------------------------------------------------------------------
 LinkManager getLinkManager()
          -------------------------------------------------------------------
 Enumeration getLinks()
          -------------------------------------------------------------------
 boolean handlePerfMessage(LinkMessage m)
          ------------------------------------------------------------------- Handle performance message types
 boolean loadLinkFactoryServices()
          ------------------------------------------------------------------- Create the physical SSL connection to the destination end point.
 void setLinkFactoryProperties(Properties factoryProperties)
          ------------------------------------------------------------------- Set the factory creation parameters.
 void setLinkStatusInterval(long interval)
          ------------------------------------------------------------------- By default the status interval is 1 second.
 void setTransportHandler(TransportHandler transportHandler)
          -------------------------------------------------------------------
 void transportClosed(Transport transport)
          ------------------------------------------------------------------- Handles transport closed from transports initiated from this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cgl.narada.transport.LinkFactory
canManageLinkMigrationOfType, getManagedLinksType, manageLinkMigration
 

Field Detail

m_key2transport

protected Hashtable m_key2transport

m_transport2key

protected Hashtable m_transport2key

m_linkManager

protected LinkManager m_linkManager

m_factory

protected TransportFactory m_factory

m_transportAcceptor

protected cgl.narada.transport.sslHttpBase.LinkFactoryImpl.TransportAcceptor m_transportAcceptor

m_statusInterval

protected long m_statusInterval

m_transportHandler

protected TransportHandler m_transportHandler
Constructor Detail

LinkFactoryImpl

public LinkFactoryImpl(TransportFactory factory,
                       String type)
-------------------------------------------------------------------

Method Detail

getLinks

public Enumeration getLinks()
-------------------------------------------------------------------


getLinkManager

public LinkManager getLinkManager()
-------------------------------------------------------------------


setLinkFactoryProperties

public void setLinkFactoryProperties(Properties factoryProperties)
------------------------------------------------------------------- Set the factory creation parameters. Pass through to set the transport factory's properties. listenerport - The port to listen on truststore - Location of the trusted authorities database keystore - Location of the public/private key database truststorePassword - Password to the truststore keystorePassword - Password to the keystore username - Proxy authenticated user name. password - Proxy authenticated password. https.proxyHost - The location of the HTTPS proxy. Will try to auto detect from System properties if this does not exist. https.proxyPort - The location of the HTTPS proxy port. Will try to auto detec from System properties if this does not exist. secure - true | false. If false, will not do any real SSL.

Specified by:
setLinkFactoryProperties in interface LinkFactory

loadLinkFactoryServices

public boolean loadLinkFactoryServices()
                                throws TransportException
------------------------------------------------------------------- Create the physical SSL connection to the destination end point. Also start the listening SSL acceptor.

Specified by:
loadLinkFactoryServices in interface LinkFactory
Throws:
TransportException

createLink

public Link createLink(Properties connectionProperties)
                throws TransportException
-------------------------------------------------------------------

Specified by:
createLink in interface LinkFactory
Parameters:
connectionProperties - Link properties.
  • host - The transport's end point's host name or ip address.
  • port - The transport's end point's port number.

Throws:
TransportException - If unable to create a link due to IO errors.
AccessDeniedException - If during transport creation, some form of authentication is required (user authentation for proxies)

setLinkStatusInterval

public void setLinkStatusInterval(long interval)
------------------------------------------------------------------- By default the status interval is 1 second.

Specified by:
setLinkStatusInterval in interface LinkFactory
Parameters:
interval - The interval to check keep alive.

setTransportHandler

public void setTransportHandler(TransportHandler transportHandler)
-------------------------------------------------------------------

Specified by:
setTransportHandler in interface LinkFactory

dispose

public void dispose()
-------------------------------------------------------------------

Specified by:
dispose in interface LinkFactory

handlePerfMessage

public boolean handlePerfMessage(LinkMessage m)
------------------------------------------------------------------- Handle performance message types

Returns:
If the message was related to performance.

dataReceived

public void dataReceived(Transport transport,
                         byte[] message)
------------------------------------------------------------------- Handles incoming message from transports initiated from this factory.

Specified by:
dataReceived in interface TransportDataListener

transportClosed

public void transportClosed(Transport transport)
------------------------------------------------------------------- Handles transport closed from transports initiated from this factory.

Specified by:
transportClosed in interface TransportDataListener


For comments and suggestions please send e-mail to The NaradaBrokering Project