|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.impl.adaptor.generic.AdaptorServer | +--com.sun.jaw.impl.adaptor.html.AdaptorServerImpl
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 8099, register your HTML
AdaptorServerImpl
with the following name:
domain:com.sun.jaw.reference.adaptor.AdaptorMO.protocol=html,port=8099
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.
Limitations of the HTML adaptor:
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 using the default port (8082). |
|
AdaptorServerImpl(int p)
Initializes this AdaptorServerImpl using the specified port. |
Method Summary | |
void |
addUserAuthenticationInfo(AuthInfo authinfo)
Adds the authentication information of the user to be authenticated by this server. |
boolean |
checkChallengeResponse(java.lang.String response)
For Java DMK internal use only. |
protected void |
doBind()
|
protected void |
doProcess()
|
protected void |
doReceive()
|
protected void |
doUnbind()
|
java.lang.String |
getClassVersion()
Returns the version of this class. |
java.lang.Boolean |
getFlattenView()
Returns the value of the flatten view flag. |
java.lang.String |
getLastConnectedClient()
Returns the name of the last connected client. |
java.lang.String |
getPageBodyOption()
Returns the page BODY option. |
java.lang.String |
getProtocol()
Returns the protocol of this AdaptorServer . |
void |
initCmf(Framework f,
ObjectName name,
boolean db,
ModificationList list)
For Java DMK internal use only. |
boolean |
isAuthenticationOn()
Returns true if the list of users supported by this server is not empty. |
void |
performStop()
|
void |
removeUserAuthenticationInfo(AuthInfo authinfo)
Removes the authentication information of the given user from the list of users authenticated by this server. |
void |
setFlattenView(java.lang.Boolean value)
Sets the value of the flatten view flag. |
void |
setPageBodyOption(java.lang.String value)
Sets the BODY option of all JDMK HTML pages. |
void |
setPort(java.lang.Integer p)
Sets the port of this AdaptorServerImpl . |
Methods inherited from class com.sun.jaw.impl.adaptor.generic.AdaptorServer |
addAdaptorListener,
deleteCmf,
getActiveClientCount,
getMaxActiveClientCount,
getPort,
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 |
public AdaptorServerImpl()
AdaptorServerImpl
using the default port (8082).public AdaptorServerImpl(int p)
AdaptorServerImpl
using the specified port.p
- The port number.Method Detail |
public void setPort(java.lang.Integer p)
AdaptorServerImpl
.
If this AdaptorServerImpl
is ONLINE
,
it must be stopped and then restarted to use the new port value.p
- a port number.protected void doBind() throws CommunicationException, java.lang.InterruptedException
protected void doUnbind() throws CommunicationException, java.lang.InterruptedException
protected void doReceive() throws CommunicationException, java.lang.InterruptedException
protected void doProcess() throws CommunicationException, java.lang.InterruptedException
public void initCmf(Framework f, ObjectName name, boolean db, ModificationList list) throws InstanceAlreadyExistException
Parses the object name and updates the port with the value associated to
the 'port' key (if any).
Then calls the ancestor initCmf
.
public java.lang.String getLastConnectedClient()
public java.lang.String getClassVersion()
public java.lang.String getProtocol()
AdaptorServer
.public void addUserAuthenticationInfo(AuthInfo authinfo)
authinfo
- the user authentication information.public void removeUserAuthenticationInfo(AuthInfo authinfo)
authinfo
- the user authentication information.public boolean isAuthenticationOn()
public java.lang.Boolean getFlattenView()
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.
setFlattenView(java.lang.Boolean)
public void setFlattenView(java.lang.Boolean value)
value
- The value that the flatten view flag will be set to.getFlattenView()
public java.lang.String getPageBodyOption()
setPageBodyOption(java.lang.String)
public void setPageBodyOption(java.lang.String value)
Example:
BGCOLOR=#ffffff
set the background of HTML pages to white
value
- The value of the BODY option will be set to.getPageBodyOption()
public boolean checkChallengeResponse(java.lang.String response)
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.
public void performStop()
AdaptorServerImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |