com.sun.jaw.impl.adaptor.comm
Class AdaptorServerImpl

java.lang.Object
  |
  +--com.sun.jaw.impl.adaptor.generic.AdaptorServer
        |
        +--com.sun.jaw.impl.adaptor.comm.AdaptorServerImpl
Direct Known Subclasses:
AdaptorServerImpl, AdaptorServerImpl, AdaptorServerImpl

public abstract class AdaptorServerImpl
extends AdaptorServer

This class implements the common behaviour for the server part of the HTTP-based adaptors. HTTP/TCP, HTTP/UDP and HTTP/SSL adaptors extend this class and inherit this behaviour.

HTTP/TCP, HTTP/UDP and HTTP/SSL adaptors differ by the socket type they use to communicate between the server and the client:

However the features and the behaviour of these adaptors are the same. They are implemented in this class and described below.

The data transmitted between the client and server parts is the same in both adaptors: these are serialized Java objects encoded as HTTP requests and responses.

The three adaptors can perform user authentication. The add/remove user authentication info methods are used to add/remove users and their corresponding authentication information. If this server carries out client authentication then clients connecting to this server are authenticated using the 'CRAM-MD5 Access Authentication Scheme' as defined in RFCs 2104 and 2195.

The three adaptors use the same default value (10) for the maxActiveClientCount property. When an adaptor is stopped, the active requests are interrupted and an error result is sent to the clients.

See Also:
AdaptorClient, Serialized Form

Fields inherited from class com.sun.jaw.impl.adaptor.generic.AdaptorServer
cmf, maxActiveClientCount, objectName, OFFLINE, ONLINE, port, STARTING, state, STOPPING
 
Constructor Summary
AdaptorServerImpl()
          Initializes this AdaptorServerImpl with the default port.
AdaptorServerImpl(int p)
          Initializes this AdaptorServerImpl with the specified port.
 
Method Summary
 void addUserAuthenticationInfo(AuthInfo authinfo)
          Adds user authentification information to this server.
 java.lang.String getClassVersion()
          Gets the version of this class.
 java.lang.String getLastConnectedClient()
          Gets the IP address of the last connected client.
 void initCmf(Framework f, ObjectName name, boolean db, ModificationList list)
          Starts the adaptor server after registration.
 boolean isAuthenticationOn()
          Returns true if the list of users supported by this server is not empty.
 void performStop()
          Stops this server.
 void removeUserAuthenticationInfo(AuthInfo authinfo)
          Removes user authentication information from this server.
 
Methods inherited from class com.sun.jaw.impl.adaptor.generic.AdaptorServer
addAdaptorListener, deleteCmf, getActiveClientCount, getMaxActiveClientCount, getPort, getProtocol, getServedClientCount, getState, getStateString, isActive, performStart, performWaitState, removeAdaptorListener, setMaxActiveClientCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptorServerImpl

public AdaptorServerImpl()
Initializes this AdaptorServerImpl with the default port. The default port is protocol-specific: its value is defined by the derived classes.

AdaptorServerImpl

public AdaptorServerImpl(int p)
Initializes this AdaptorServerImpl with the specified port.
Parameters:
p - The port number.
Method Detail

initCmf

public void initCmf(Framework f,
                    ObjectName name,
                    boolean db,
                    ModificationList list)
             throws InstanceAlreadyExistException
Starts the adaptor server after registration. This method is not intent to be called directly by the user.
Throws:
InstanceAlreadyExistException - The m-bean is already registered in the repository.
Overrides:
initCmf in class AdaptorServer

getLastConnectedClient

public java.lang.String getLastConnectedClient()
Gets the IP address of the last connected client. This function uses the string representation of java.net.InetAddress.
Returns:
The IP address of the last connected client.
See Also:
InetAddress

addUserAuthenticationInfo

public void addUserAuthenticationInfo(AuthInfo authinfo)
Adds user authentification information to this server. In order to populate the list of users supported by this server, invoke this method for each user you want to add.
Parameters:
authinfo - The user authentication information.

removeUserAuthenticationInfo

public void removeUserAuthenticationInfo(AuthInfo authinfo)
Removes user authentication information from this server.
Parameters:
authinfo - The user authentication information.
See Also:
addUserAuthenticationInfo(com.sun.jaw.impl.adaptor.security.AuthInfo)

isAuthenticationOn

public boolean isAuthenticationOn()
Returns true if the list of users supported by this server is not empty.
Returns:
True, if the list of users supported by this server is not empty. False, if the list of supported users is empty so no authentication is performed by this server.

getClassVersion

public java.lang.String getClassVersion()
Gets the version of this class.
Returns:
The version of this class.

performStop

public void performStop()
Stops this server.
Overrides:
performStop in class AdaptorServer
See Also:
AdaptorServer