QuickServer
v1.4.7

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()
          Deprecated. As of 1.4.6 use getClientAuthenticationHandler()
 ClientAuthenticationHandler getClientAuthenticationHandler()
          Returns the ClientAuthenticationHandler 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.
 ClientEventHandler getClientEventHandler()
          Returns the ClientEventHandler object that gets notified of client events.
 ClientExtendedEventHandler getClientExtendedEventHandler()
          Returns the ClientExtendedEventHandler object that gets notified of client events.
 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
 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)
          Deprecated. As of 1.4.6 use setClientAuthenticationHandler(org.quickserver.net.server.ClientAuthenticationHandler)
 void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)
          Sets the ClientAuthenticationHandler 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 setClientEventHandler(ClientEventHandler handler)
          Sets the ClientEventHandler objects class that gets notified of client events.
 void setClientExtendedEventHandler(ClientExtendedEventHandler handler)
          Sets the ClientExtendedEventHandler objects class that gets notified of extended client events.
 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 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.


setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Deprecated. As of 1.4.6 use setClientAuthenticationHandler(org.quickserver.net.server.ClientAuthenticationHandler)

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()
Deprecated. As of 1.4.6 use getClientAuthenticationHandler()

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

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

setClientAuthenticationHandler

public void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)
Sets the ClientAuthenticationHandler class that handles the authentication of a client.

Parameters:
clientAuthenticationHandler - object that implements ClientAuthenticationHandler.
Since:
1.4.6
See Also:
getClientAuthenticationHandler()

getClientAuthenticationHandler

public ClientAuthenticationHandler getClientAuthenticationHandler()
Returns the ClientAuthenticationHandler object that handles the authentication of a client.

Since:
1.4.6
See Also:
setClientAuthenticationHandler(org.quickserver.net.server.ClientAuthenticationHandler)

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.


setClientEventHandler

public void setClientEventHandler(ClientEventHandler handler)
Sets the ClientEventHandler objects class that gets notified of client events.

Parameters:
handler - object that implements ClientEventHandler
Since:
1.4.6
See Also:
getClientEventHandler()

getClientEventHandler

public ClientEventHandler getClientEventHandler()
Returns the ClientEventHandler object that gets notified of client events.

Since:
1.4.6
See Also:
setClientEventHandler(org.quickserver.net.server.ClientEventHandler)

setClientExtendedEventHandler

public void setClientExtendedEventHandler(ClientExtendedEventHandler handler)
Sets the ClientExtendedEventHandler objects class that gets notified of extended client events.

Parameters:
handler - object that implements ClientExtendedEventHandler
Since:
1.4.6
See Also:
getClientExtendedEventHandler()

getClientExtendedEventHandler

public ClientExtendedEventHandler getClientExtendedEventHandler()
Returns the ClientExtendedEventHandler object that gets notified of client events.

Since:
1.4.6
See Also:
setClientExtendedEventHandler(org.quickserver.net.server.ClientExtendedEventHandler)

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.7

Copyright © 2003-2006 QuickServer.org