All Packages  Class Hierarchy  This Package  Previous  Next  Index

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

java.lang.Object
   |
   +----com.sun.jaw.impl.adaptor.generic.AdaptorServer
           |
           +----com.sun.jaw.impl.adaptor.html.AdaptorServerImpl

public class AdaptorServerImpl
extends AdaptorServer
This class provides an implementation of the server part of an HTML adaptor. When an HTML AdaptorServerImpl is started, it creates a TCP/IP socket and listens for client connections. When a client tries to connect, the AdaptorServerImpl creates a thread which receives and processes all subsequent requests from this client. The number of clients is limited by the maxActiveClientCount property. The default value of the maxActiveClientCount is 10.

When an HTML AdaptorServerImpl is stopped, all current HTTP connections are interrupted (some requests may be terminated abruptly) and the TCP/IP socket is closed.

When an HTML AdaptorServerImpl is registered in the framework, it parses its ObjectName and updates the port number that it uses with the value of the 'port' key. If the ObjectName does not contain a port key, the default port (8082) is used.

For example, if you want to use the port 80, register your HTML AdaptorServerImpl with the following name:

An HTML AdaptorServerImpl can perform authentication. Authentication uses the AuthenticationInfo property. If the AuthenticationInfo property is null, no authentication is performed.

An HTML AdaptorServerImpl 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 'Basic Authentication Scheme' as define in RFC 1945, section 11.1.


Constructor Index

 o AdaptorServerImpl()
Initializes this AdaptorServerImpl using the default port (8082).
 o AdaptorServerImpl(int)
Initializes this AdaptorServerImpl using the specified port.

Method Index

 o addUserAuthenticationInfo(AuthInfo)
Adds the authentication information of the user to be authenticated by this server.
 o checkChallengeResponse(String)
For Java DMK internal use only.
 o getClassVersion()
Returns the version of this class.
 o getFlattenView()
Returns the value of the flatten view flag.
 o getLastConnectedClient()
Returns the name of the last connected client.
 o getPageBodyOption()
Returns the page BODY option.
 o getProtocol()
Returns the protocol of this AdaptorServer.
 o getSortMbeanProperties()
Returns the value of the SortMbeanProperties flag.
 o initCmf(Framework, ObjectName, boolean, ModificationList)
For Java DMK internal use only.
 o isAuthenticationOn()
Returns true if the list of users supported by this server is not empty.
 o performStop()
 o removeUserAuthenticationInfo(AuthInfo)
Removes the authentication information of the given user from the list of users authenticated by this server.
 o setFlattenView(Boolean)
Sets the value of the flatten view flag.
 o setPageBodyOption(String)
Sets the BODY option of all JDMK HTML pages.
 o setPort(Integer)
Sets the port of this AdaptorServerImpl.
 o setSortMbeanProperties(Boolean)
Sets the value of the SortMbeanProperties flag.

Constructors

 o AdaptorServerImpl
 public AdaptorServerImpl()
Initializes this AdaptorServerImpl using the default port (8082).

 o AdaptorServerImpl
 public AdaptorServerImpl(int p)
Initializes this AdaptorServerImpl using the specified port.

Parameters:
p - The port number.

Methods

 o setPort
 public void setPort(Integer p)
Sets the port of this AdaptorServerImpl. If this AdaptorServerImpl is ONLINE, it must be stopped and then restarted to use the new port value.

Parameters:
p - a port number.
 o initCmf
 public void initCmf(Framework f,
                     ObjectName name,
                     boolean db,
                     ModificationList list) throws InstanceAlreadyExistException
For Java DMK internal use only.

Parses the object name and updates the port with the value associated to the 'port' key (if any). Then calls the ancestor initCmf.

Throws: InstanceAlreadyExistException
The m-bean is already registered in the repository.
Overrides:
initCmf in class AdaptorServer
 o getLastConnectedClient
 public String getLastConnectedClient()
Returns the name of the last connected client.

Returns:
The name of the last connected client.
 o getClassVersion
 public String getClassVersion()
Returns the version of this class.

Returns:
The version of this class.
 o getProtocol
 public String getProtocol()
Returns the protocol of this AdaptorServer.

Returns:
The string "html".
Overrides:
getProtocol in class AdaptorServer
 o addUserAuthenticationInfo
 public synchronized void addUserAuthenticationInfo(AuthInfo authinfo)
Adds the authentication information of the user to be authenticated by 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.
 o removeUserAuthenticationInfo
 public synchronized void removeUserAuthenticationInfo(AuthInfo authinfo)
Removes the authentication information of the given user from the list of users authenticated by this server.

Parameters:
authinfo - the user authentication information.
 o 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.
 o getFlattenView
 public Boolean getFlattenView()
Returns the value of the flatten view flag.

When the flatten view flag is true, inherited properties are displayed in the property list HTML page. When the flag is false, only the properties defined by the object are displayed.

Returns:
The value of the flatten view flag.
See Also:
setFlattenView
 o setFlattenView
 public void setFlattenView(Boolean value)
Sets the value of the flatten view flag.

Parameters:
value - The value that the flatten view flag will be set to.
See Also:
getFlattenView
 o getSortMbeanProperties
 public Boolean getSortMbeanProperties()
Returns the value of the SortMbeanProperties flag.

When the SortMbeanProperties flag is true, properties of the M-Bean are displayed in alphabetics order.

Returns:
The value of the SortMbeanProperties flag.
See Also:
setSortMbeanProperties
 o setSortMbeanProperties
 public void setSortMbeanProperties(Boolean value)
Sets the value of the SortMbeanProperties flag.

Parameters:
value - The value that the SortMbeanProperties flag will be set to.
See Also:
getSortMbeanProperties
 o getPageBodyOption
 public String getPageBodyOption()
Returns the page BODY option.

Returns:
a string representation of the BODY option used to build JDMK HTML pages.
See Also:
setPageBodyOption
 o setPageBodyOption
 public void setPageBodyOption(String value)
Sets the BODY option of all JDMK HTML pages. This is the string is part of
 option
 of all JDMK HTML pages.
 

Example:

BGCOLOR=#ffffff
set the background of HTML pages to white

Parameters:
value - The value of the BODY option will be set to.
See Also:
getPageBodyOption
 o checkChallengeResponse
 public synchronized boolean checkChallengeResponse(String response)
For Java DMK internal use only.

Check if the response sent by the client matches any of the login/password pairs stored in the server. If the match is successful then the client has been authenticated and the method returns true. False, otherwise.

 o performStop
 public void performStop()
Overrides:
performStop in class AdaptorServer
See Also:
AdaptorServerImpl

All Packages  Class Hierarchy  This Package  Previous  Next  Index