QuickServer
v1.4.5

org.quickserver.net.server
Class TheClient

java.lang.Object
  extended byorg.quickserver.net.server.TheClient

public class TheClient
extends java.lang.Object

Encapsulates client socket and its configuration details. Used by QuickServer and ClientHandler classes.

Author:
Akshathkumar Shetty

Constructor Summary
TheClient()
           
 
Method Summary
 Authenticator getAuthenticator()
          Returns the Authenticator object that handles the authentication of a client.
 ClientBinaryHandler getClientBinaryHandler()
          Returns the ClientBinaryHandler object that interacts with client sockets.
 ClientCommandHandler getClientCommandHandler()
          Returns the ClientCommandHandler object that interacts with client sockets.
 ClientData getClientData()
          Returns the ClientData object that carries client data.
 ClientEvent getClientEvent()
          Returns ClientEvent.
 ClientObjectHandler getClientObjectHandler()
          Returns the ClientObjectHandler object that interacts with client sockets.
 ClientWriteHandler getClientWriteHandler()
          Returns the ClientWriteHandler object that interacts with client sockets.
 boolean getCommunicationLogging()
          Returns the communication logging flag.
 int getMaxAuthTry()
          Returns maximum allowed login attempts.
 java.lang.String getMaxAuthTryMsg()
          Returns message to be displayed to the client when maximum allowed login attempts reaches.
 java.lang.String getMaxConnectionMsg()
          Returns message to be displayed to the client when maximum connection reaches.
 QuickServer getServer()
          Gets the QuickServer object associated with this Client
 Authenticator getServerAuthenticator()
          Deprecated. use getAuthenticator()
 java.net.Socket getSocket()
          Returns client socket associated.
 java.nio.channels.SocketChannel getSocketChannel()
          Returns client socket channel associated, if any.
 int getTimeout()
          Returns the Client socket timeout in milliseconds.
 java.lang.String getTimeoutMsg()
          Returns timeout message.
 boolean getTrusted()
          Returns flag to skip timeout setting and authentication of this client.
 void setAuthenticator(Authenticator authenticator)
          Sets the Authenticator class that handles the authentication of a client.
 void setClientBinaryHandler(ClientBinaryHandler handler)
          Sets the ClientBinaryHandler object that interacts with client sockets.
 void setClientCommandHandler(ClientCommandHandler handler)
          Sets the ClientCommandHandler objects that interacts with client sockets.
 void setClientData(ClientData data)
          Sets the ClientData object that carries client data.
 void setClientEvent(ClientEvent event)
          Sets ClientEvent.
 void setClientObjectHandler(ClientObjectHandler handler)
          Sets the ClientObjectHandler object that interacts with client sockets.
 void setClientWriteHandler(ClientWriteHandler handler)
          Sets the ClientWriteHandler object that interacts with client sockets.
 void setCommunicationLogging(boolean communicationLogging)
          Sets the communication logging flag.
 void setMaxAuthTry(int authTry)
          Sets maximum allowed login attempts.
 void setMaxAuthTryMsg(java.lang.String msg)
          Sets message to be displayed when max login attempt reaches.
 void setMaxConnectionMsg(java.lang.String msg)
          Sets message to be displayed when maximum connection reaches.
 void setServer(QuickServer server)
          Sets the QuickServer object associated with this Client
 void setServerAuthenticator(Authenticator authenticator)
          Deprecated. use setAuthenticator(org.quickserver.net.server.Authenticator)
 void setSocket(java.net.Socket socket)
          Sets client socket associated.
 void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
          Sets client socket channel associated, if any.
 void setTimeout(int time)
          Sets the client socket's timeout.
 void setTimeoutMsg(java.lang.String msg)
          Sets timeout message.
 void setTrusted(boolean flag)
          Sets flag to skip timeout setting and authentication of this client.
 java.lang.String toString()
          Returns client info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TheClient

public TheClient()
Method Detail

setServer

public void setServer(QuickServer server)
Sets the QuickServer object associated with this Client

See Also:
getServer()

getServer

public QuickServer getServer()
Gets the QuickServer object associated with this Client

See Also:
getServer()

setSocket

public void setSocket(java.net.Socket socket)
Sets client socket associated.


getSocket

public java.net.Socket getSocket()
Returns client socket associated.


setServerAuthenticator

public void setServerAuthenticator(Authenticator authenticator)
Deprecated. use setAuthenticator(org.quickserver.net.server.Authenticator)

Sets the Authenticator class that handles the authentication of a client.

Parameters:
authenticator - object that implements Authenticator.
See Also:
getServerAuthenticator()

getServerAuthenticator

public Authenticator getServerAuthenticator()
Deprecated. use getAuthenticator()

Returns the Authenticator object that handles the authentication of a client.

See Also:
setServerAuthenticator(org.quickserver.net.server.Authenticator)

setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Sets the Authenticator class that handles the authentication of a client.

Parameters:
authenticator - object that implements Authenticator.
Since:
1.3
See Also:
getAuthenticator()

getAuthenticator

public Authenticator getAuthenticator()
Returns the Authenticator object that handles the authentication of a client.

Since:
1.3
See Also:
setAuthenticator(org.quickserver.net.server.Authenticator)

setClientData

public void setClientData(ClientData data)
Sets the ClientData object that carries client data.

Parameters:
data - object of the class that extends ClientData.
See Also:
getClientData()

getClientData

public ClientData getClientData()
Returns the ClientData object that carries client data.

Returns:
object of the class that implements ClientData.
See Also:
setClientData(org.quickserver.net.server.ClientData)

setMaxAuthTry

public void setMaxAuthTry(int authTry)
Sets maximum allowed login attempts.

Since:
1.2

getMaxAuthTry

public int getMaxAuthTry()
Returns maximum allowed login attempts.

Since:
1.2

setMaxAuthTryMsg

public void setMaxAuthTryMsg(java.lang.String msg)
Sets message to be displayed when max login attempt reaches.


getMaxAuthTryMsg

public java.lang.String getMaxAuthTryMsg()
Returns message to be displayed to the client when maximum allowed login attempts reaches.


setTimeoutMsg

public void setTimeoutMsg(java.lang.String msg)
Sets timeout message.


getTimeoutMsg

public java.lang.String getTimeoutMsg()
Returns timeout message.


setClientCommandHandler

public void setClientCommandHandler(ClientCommandHandler handler)
Sets the ClientCommandHandler objects that interacts with client sockets.

Parameters:
handler - object that implements ClientCommandHandler
See Also:
getClientCommandHandler()

getClientCommandHandler

public ClientCommandHandler getClientCommandHandler()
Returns the ClientCommandHandler object that interacts with client sockets.

See Also:
setClientCommandHandler(org.quickserver.net.server.ClientCommandHandler)

setClientObjectHandler

public void setClientObjectHandler(ClientObjectHandler handler)
Sets the ClientObjectHandler object that interacts with client sockets.

Parameters:
handler - object that implements ClientObjectHandler
Since:
1.2
See Also:
getClientObjectHandler()

getClientObjectHandler

public ClientObjectHandler getClientObjectHandler()
Returns the ClientObjectHandler object that interacts with client sockets.

Since:
1.2
See Also:
setClientObjectHandler(org.quickserver.net.server.ClientObjectHandler)

getTrusted

public boolean getTrusted()
Returns flag to skip timeout setting and authentication of this client.

Since:
1.3.2

setTrusted

public void setTrusted(boolean flag)
Sets flag to skip timeout setting and authentication of this client.

Since:
1.3.2

setCommunicationLogging

public void setCommunicationLogging(boolean communicationLogging)
Sets the communication logging flag.

Since:
1.3.2
See Also:
getCommunicationLogging()

getCommunicationLogging

public boolean getCommunicationLogging()
Returns the communication logging flag.

Since:
1.3.2
See Also:
setCommunicationLogging(boolean)

setClientBinaryHandler

public void setClientBinaryHandler(ClientBinaryHandler handler)
Sets the ClientBinaryHandler object that interacts with client sockets.

Parameters:
handler - object that implements ClientBinaryHandler
Since:
1.4
See Also:
getClientBinaryHandler()

getClientBinaryHandler

public ClientBinaryHandler getClientBinaryHandler()
Returns the ClientBinaryHandler object that interacts with client sockets.

Since:
1.4
See Also:
setClientBinaryHandler(org.quickserver.net.server.ClientBinaryHandler)

setTimeout

public void setTimeout(int time)
Sets the client socket's timeout.

Parameters:
time - client socket timeout in milliseconds.
Since:
1.4.5
See Also:
getTimeout()

getTimeout

public int getTimeout()
Returns the Client socket timeout in milliseconds.

Since:
1.4.5
See Also:
setTimeout(int)

setClientEvent

public void setClientEvent(ClientEvent event)
Sets ClientEvent.

Since:
1.4.5

getClientEvent

public ClientEvent getClientEvent()
Returns ClientEvent.

Since:
1.4.5

setMaxConnectionMsg

public void setMaxConnectionMsg(java.lang.String msg)
Sets message to be displayed when maximum connection reaches.

Since:
1.4.5

getMaxConnectionMsg

public java.lang.String getMaxConnectionMsg()
Returns message to be displayed to the client when maximum connection reaches.

Since:
1.4.5

setSocketChannel

public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
Sets client socket channel associated, if any.

Since:
1.4.5

getSocketChannel

public java.nio.channels.SocketChannel getSocketChannel()
Returns client socket channel associated, if any.

Since:
1.4.5

setClientWriteHandler

public void setClientWriteHandler(ClientWriteHandler handler)
Sets the ClientWriteHandler object that interacts with client sockets.

Parameters:
handler - object that implements ClientWriteHandler
Since:
1.4.5
See Also:
getClientWriteHandler()

getClientWriteHandler

public ClientWriteHandler getClientWriteHandler()
Returns the ClientWriteHandler object that interacts with client sockets.

Since:
1.4.5
See Also:
setClientWriteHandler(org.quickserver.net.server.ClientWriteHandler)

toString

public java.lang.String toString()
Returns client info.

Since:
1.4.5

QuickServer
v1.4.5

Copyright © 2003-2005 QuickServer.org