org.norther.tammi.core.net
Class AbstractCommonSecureFactory

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.base.DefaultObjectFactory
          extended by org.norther.tammi.core.net.AbstractCommonFactory
              extended by org.norther.tammi.core.net.AbstractCommonSecureFactory
All Implemented Interfaces:
Serializable, EventListener, NotificationBroadcaster, NotificationEmitter, NotificationListener, Manageable, MBeanDelegate, ObjectFactory, CommonFactory, CommonSecureFactory
Direct Known Subclasses:
AbstractSecureSocketFactory, DefaultSecureServerChannelFactory

public abstract class AbstractCommonSecureFactory
extends AbstractCommonFactory
implements CommonSecureFactory, NotificationListener

An abstract implementation of network resource CommonSecureFactory.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.net.AbstractCommonFactory
socketBacklog
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.net.CommonSecureFactory
DEFAULT_SSL_PROTOCOL
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
protected AbstractCommonSecureFactory()
          Constructs an SSL base socket factory.
 
Method Summary
protected  void clearContextObjects()
          Clears context dependent objects after modified configuration.
 String getDefaultAlias()
          Gets the default key store alias.
 String getKeyManagerAlgorithm()
          Gets the key manager algorithm.
 String getKeyManagerProvider()
          Gets the key manager provider.
 ObjectName getKeyStoreLoaderName()
          Gets the key store loader.
 String getSecureSocketProtocol()
          Gets the protocol.
 String getSecureSocketProvider()
          Gets the socket provider.
protected  SSLContext getSSLContext(String alias, String pswd, boolean create)
          Gets the SSL context.
 String getTrustManagerAlgorithm()
          Gets the trust manager algorithm.
 String getTrustManagerProvider()
          Gets the trust manager provider.
 ObjectName getTrustStoreLoaderName()
          Gets the trust store loader.
 void handleNotification(Notification notif, Object handback)
          Handles notifications from the loader.
 boolean isSecure()
          Checks whether sockets produced are secure.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void setDefaultAlias(String alias)
          Sets the default key store alias.
 void setDefaultPassword(String pswd)
          Sets the password of the default key store alias.
 void setKeyManagerAlgorithm(String algorithm)
          Sets the key manager algorithm.
 void setKeyManagerProvider(String provider)
          Sets the key manager provider.
 void setKeyStoreLoaderName(ObjectName name)
          Sets the key store loader.
 void setSecureSocketProtocol(String protocol)
          Sets the protocol.
 void setSecureSocketProvider(String provider)
          Sets the socket provider.
 void setTrustManagerAlgorithm(String algorithm)
          Sets the trust manager algorithm.
 void setTrustManagerProvider(String provider)
          Sets the trust manager provider.
 void setTrustStoreLoaderName(ObjectName name)
          Sets the trust store loader.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 
Methods inherited from class org.norther.tammi.core.net.AbstractCommonFactory
createServerSocket, createSocket, getBacklog, getServerSocketFactory, getSocketFactory, getSoTimeout, isLoaderSupported, isReuseAddress, setBacklog, setReuseAddress, setSoTimeout
 
Methods inherited from class org.norther.tammi.core.base.DefaultObjectFactory
getInstance, getInstance, getInstance, getInstance
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.net.CommonSecureFactory
getEnabledCipherSuites, getSupportedCipherSuites
 
Methods inherited from interface org.norther.tammi.core.net.CommonFactory
getSoTimeout, isReuseAddress, setReuseAddress, setSoTimeout
 
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory
getInstance, getInstance, getInstance, getInstance, isLoaderSupported
 

Constructor Detail

AbstractCommonSecureFactory

protected AbstractCommonSecureFactory()
Constructs an SSL base socket factory.

Method Detail

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class Adaptee

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class Adaptee
Throws:
Exception - if the adaptee refused to be unmanaged.

isSecure

public boolean isSecure()
Description copied from interface: CommonFactory
Checks whether sockets produced are secure.

Specified by:
isSecure in interface CommonFactory
Overrides:
isSecure in class AbstractCommonFactory
Returns:
true for secure sockets.

getDefaultAlias

public String getDefaultAlias()
Description copied from interface: CommonSecureFactory
Gets the default key store alias.

Specified by:
getDefaultAlias in interface CommonSecureFactory
Returns:
the alias or null.

setDefaultAlias

public void setDefaultAlias(String alias)
Description copied from interface: CommonSecureFactory
Sets the default key store alias.

Specified by:
setDefaultAlias in interface CommonSecureFactory
Parameters:
alias - the alias.

setDefaultPassword

public void setDefaultPassword(String pswd)
Description copied from interface: CommonSecureFactory
Sets the password of the default key store alias.

Specified by:
setDefaultPassword in interface CommonSecureFactory
Parameters:
pswd - the password.

getKeyStoreLoaderName

public ObjectName getKeyStoreLoaderName()
Description copied from interface: CommonSecureFactory
Gets the key store loader.

Specified by:
getKeyStoreLoaderName in interface CommonSecureFactory
Returns:
the name of the loader or a query.

setKeyStoreLoaderName

public void setKeyStoreLoaderName(ObjectName name)
Description copied from interface: CommonSecureFactory
Sets the key store loader.

Specified by:
setKeyStoreLoaderName in interface CommonSecureFactory
Parameters:
name - the name of the loader or a query.

getKeyManagerAlgorithm

public String getKeyManagerAlgorithm()
Description copied from interface: CommonSecureFactory
Gets the key manager algorithm.

Specified by:
getKeyManagerAlgorithm in interface CommonSecureFactory
Returns:
the algorithm.

setKeyManagerAlgorithm

public void setKeyManagerAlgorithm(String algorithm)
Description copied from interface: CommonSecureFactory
Sets the key manager algorithm.

Specified by:
setKeyManagerAlgorithm in interface CommonSecureFactory
Parameters:
algorithm - the algorithm.

getKeyManagerProvider

public String getKeyManagerProvider()
Description copied from interface: CommonSecureFactory
Gets the key manager provider.

Specified by:
getKeyManagerProvider in interface CommonSecureFactory
Returns:
the provider.

setKeyManagerProvider

public void setKeyManagerProvider(String provider)
Description copied from interface: CommonSecureFactory
Sets the key manager provider.

Specified by:
setKeyManagerProvider in interface CommonSecureFactory
Parameters:
provider - the provider.

getTrustStoreLoaderName

public ObjectName getTrustStoreLoaderName()
Description copied from interface: CommonSecureFactory
Gets the trust store loader.

Specified by:
getTrustStoreLoaderName in interface CommonSecureFactory
Returns:
the name of the loader or a query.

setTrustStoreLoaderName

public void setTrustStoreLoaderName(ObjectName name)
Description copied from interface: CommonSecureFactory
Sets the trust store loader.

Specified by:
setTrustStoreLoaderName in interface CommonSecureFactory
Parameters:
name - the name of the loader or a query.

getTrustManagerAlgorithm

public String getTrustManagerAlgorithm()
Description copied from interface: CommonSecureFactory
Gets the trust manager algorithm.

Specified by:
getTrustManagerAlgorithm in interface CommonSecureFactory
Returns:
the algorithm.

setTrustManagerAlgorithm

public void setTrustManagerAlgorithm(String algorithm)
Description copied from interface: CommonSecureFactory
Sets the trust manager algorithm.

Specified by:
setTrustManagerAlgorithm in interface CommonSecureFactory
Parameters:
algorithm - the algorithm.

getTrustManagerProvider

public String getTrustManagerProvider()
Description copied from interface: CommonSecureFactory
Gets the trust manager provider.

Specified by:
getTrustManagerProvider in interface CommonSecureFactory
Returns:
the provider.

setTrustManagerProvider

public void setTrustManagerProvider(String provider)
Description copied from interface: CommonSecureFactory
Sets the trust manager provider.

Specified by:
setTrustManagerProvider in interface CommonSecureFactory
Parameters:
provider - the provider.

getSecureSocketProtocol

public String getSecureSocketProtocol()
Description copied from interface: CommonSecureFactory
Gets the protocol.

Specified by:
getSecureSocketProtocol in interface CommonSecureFactory
Returns:
the protocol.

setSecureSocketProtocol

public void setSecureSocketProtocol(String protocol)
Description copied from interface: CommonSecureFactory
Sets the protocol.

Specified by:
setSecureSocketProtocol in interface CommonSecureFactory
Parameters:
protocol - the protocol.

getSecureSocketProvider

public String getSecureSocketProvider()
Description copied from interface: CommonSecureFactory
Gets the socket provider.

Specified by:
getSecureSocketProvider in interface CommonSecureFactory
Returns:
the socket provider.

setSecureSocketProvider

public void setSecureSocketProvider(String provider)
Description copied from interface: CommonSecureFactory
Sets the socket provider.

Specified by:
setSecureSocketProvider in interface CommonSecureFactory
Parameters:
provider - the socket provider.

handleNotification

public void handleNotification(Notification notif,
                               Object handback)
Handles notifications from the loader.

Specified by:
handleNotification in interface NotificationListener
Parameters:
notif - the notification.
handback - not used.

getSSLContext

protected SSLContext getSSLContext(String alias,
                                   String pswd,
                                   boolean create)
                            throws ConstructionException
Gets the SSL context.

Parameters:
alias - the alias.
pswd - the password.
create - true to create a missing context.
Returns:
the SSL context or null.
Throws:
ConstructionException - on erros.

clearContextObjects

protected void clearContextObjects()
Clears context dependent objects after modified configuration.



Copyright © 2004 The Norther Organization. All rights reserved.