Java Doc for BasicClientHandler.java in  » Net » QuickServer » org » quickserver » net » server » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » QuickServer » org.quickserver.net.server.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.quickserver.net.server.impl.BasicClientHandler

All known Subclasses:   org.quickserver.net.server.impl.BlockingClientHandler,  org.quickserver.net.server.impl.NonBlockingClientHandler,
BasicClientHandler
abstract public class BasicClientHandler implements ClientHandler(Code)
Basic implementation of ClientHandler that handles clients for QuickServer.

This class is used by QuickServer to handle each new client connected. This class is responsible to handle client sockets. It can operate in both blocking mode and non-blocking mode (java nio).

Contributions By: Martin Benns : BYTE Mode


author:
   Akshathkumar Shetty
author:
   Martin Benns : Added BYTE mode

Inner Class :static class InstanceId

Field Summary
final protected static  StringNEW_LINE
    
final protected static  byteNEW_LINE_BYTES
    
protected  LoggerappLogger
    
protected  Authenticatorauthenticator
    
protected volatile  booleanauthorised
    
protected  BufferedInputStreamb_in
    
protected  BufferedOutputStreamb_out
    
protected  BufferedReaderbufferedReader
    
protected  Stringcharset
    
protected  ClientAuthenticationHandlerclientAuthenticationHandler
    
protected  ClientBinaryHandlerclientBinaryHandler
    
protected  ClientCommandHandlerclientCommandHandler
    
protected  DateclientConnectedTime
    
protected  ClientDataclientData
    
protected  ClientEventHandlerclientEventHandler
    
protected  SetclientEvents
    
protected  ClientExtendedEventHandlerclientExtendedEventHandler
    
protected  ClientObjectHandlerclientObjectHandler
    
protected volatile  booleancloseOrLostNotified
    
protected  booleancommunicationLogging
    
protected volatile  booleanconnection
    
protected  intcounAuthTry
    
protected  DataModedataModeIN
    
protected  DataModedataModeOUT
    
protected  InputStreamin
    
protected  DatelastCommunicationTime
    
protected  ObjectlockObj
    
protected  booleanlost
    
protected  intmaxAuthTry
    
protected  StringmaxAuthTryMsg
     Message to be displayed when max login attempt reaches.
protected  StringmaxConnectionMsg
    
protected  ObjectInputStreamo_in
    
protected  ObjectOutputStreamo_out
    
protected  OutputStreamout
    
protected  QuickServerquickServer
    
protected  booleansecure
    
protected  Socketsocket
    
protected  intsocketTimeout
    
final protected static  ThreadLocalthreadEvent
    
protected  StringtimeoutMsg
    
protected  ListunprocessedClientEvents
    
protected volatile  booleanwillClean
    

Constructor Summary
public  BasicClientHandler(int instanceCount)
    
public  BasicClientHandler()
    

Method Summary
public  voidaddEvent(ClientEvent event)
     Adds the ClientEvent.
protected  voidassertionSystemExit()
    
protected  voidcheckDataModeSet(DataMode dataMode, DataType dataType)
    
public  voidclean()
    
abstract public  voidcloseConnection()
     Closes client socket associated.
protected  voidfinalize()
    
public synchronized  voidforceClose()
     Force the closing of the client by closing the associated socket.
public  LoggergetAppLogger()
     Returns client SelectionKey associated, if any.
public  BufferedInputStreamgetBufferedInputStream()
     Returns the java.io.BufferedInputStream associated with the Client being handled.
public  BufferedOutputStreamgetBufferedOutputStream()
     Returns the java.io.BufferedOutputStream associated with the Client being handled.
abstract public  BufferedReadergetBufferedReader()
     Returns the java.io.BufferedReader associated with the Client being handled.
public  BufferedWritergetBufferedWriter()
     Returns the java.io.BufferedWriter associated with the Client being handled.
public  StringgetCharset()
     Returns Charset to be used for String decoding and encoding..
public  DategetClientConnectedTime()
     Returns the date/time when the client socket was assigned to this ClientHanlder.
public  ClientDatagetClientData()
    
protected static  StringgetClientIdentifiable(ClientHandler foundClientHandler)
    
public  booleangetCommunicationLogging()
     Returns the communication logging flag.
public  java.sql.ConnectiongetConnection(String id)
     Returns the java.sql.Connection object for the DatabaseConnection that is identified by id passed.
public  DataModegetDataMode(DataType dataType)
     Returns the DataMode of the ClientHandler for the DataType.
public  StringgetHostAddress()
     Returns cached socket host ip address.
public  InputStreamgetInputStream()
     Returns the java.io.InputStream associated with the Client being handled.
public  intgetInstanceCount()
    
public  DategetLastCommunicationTime()
     Returns the date/time when the client socket last sent a data to this ClientHanlder.
public  StringgetMaxConnectionMsg()
     Returns message to be displayed to the client when maximum connection reaches.
public  StringgetName()
    
public  ObjectInputStreamgetObjectInputStream()
     Returns the java.io.ObjectInputStream associated with the Client being handled.
public  ObjectOutputStreamgetObjectOutputStream()
     Returns the java.io.ObjectOutputStream associated with the Client being handled.
public  OutputStreamgetOutputStream()
     Returns the java.io.OutputStream associated with the Client being handled.
abstract public  SelectionKeygetSelectionKey()
     Returns client SelectionKey associated, if any.
public  QuickServergetServer()
     Returns the QuickServer object that created it.
public  SocketgetSocket()
     Returns client socket associated.
abstract public  SocketChannelgetSocketChannel()
     Returns client socket channel associated, if any.
protected  ClientEventgetThreadEvent()
     Returns threads current event for this client.
public  intgetTimeout()
     Returns the Client socket timeout in milliseconds.
public  booleangetWillClean()
    
public  voidhandleClient(TheClient theClient)
     Associates the ClientHanlder with the client encapsulated by theClient.
protected  voidhandleTimeout(SocketTimeoutException e)
    
public  booleanhasEvent(ClientEvent event)
     Checks if this client has the event.
public  Stringinfo()
     Returns the ClientHandler detailed information.
public  booleanisClientEventNext(ClientEvent clientEvent)
     Checks if the passed ClientEvent is the one next for processing if a thread is allowed through this object.
public  booleanisClosed()
     Checks if the client is closed.
public  booleanisConected()
     Checks if the client is still connected.
public  booleanisConnected()
     Checks if the client is still connected.
public  booleanisOpen()
     Checks if the client is still connected and if socket is open.
public  booleanisSecure()
     Returns flag indicating if the client is connected in secure mode (SSL or TLS).
public  voidmakeSecure()
     Makes current Client connection to secure protocol based on the secure configuration set to the server.
public  voidmakeSecure(String protocol)
     Makes current Client connection to secure protocol.
public  voidmakeSecure(boolean useClientMode, boolean needClientAuth, boolean autoClose, String protocol)
     Makes current Client connection to secure protocol.
Parameters:
  useClientMode - falg if the socket should start its first handshake in "client" mode.
Parameters:
  needClientAuth - flag if the clients must authenticate themselves.
Parameters:
  autoClose - close the underlying socket when this socket is closed
Parameters:
  protocol - the standard name of the requested protocol.
protected  voidnotifyCloseOrLost()
    
protected  voidprepareForRun()
    
protected  AuthStatusprocessAuthorisation()
    
protected  voidprocessMaxConnection(ClientEvent currentEvent)
    
public  byte[]readBinary()
     Read the binary input.
public  StringreadBytes()
     Read the byte input.
abstract protected  byte[]readInputStream()
     Read the byte input.
protected static  byte[]readInputStream(InputStream _in)
    
abstract public  voidregisterForRead()
     Register OP_READ with the SelectionKey associated with the channel.
abstract public  voidregisterForWrite()
     Register OP_WRITE with the SelectionKey associated with the channel.
public  voidremoveEvent(ClientEvent event)
     Removes the ClientEvent.
protected synchronized  voidreturnClientData()
    
protected  voidreturnClientHandler()
    
abstract public  voidrun()
    
public  voidsendClientBinary(byte data)
     Send a binary data to the connected client.
public  voidsendClientBinary(byte data, int off, int len)
     Send a binary data to the connected client.
public  voidsendClientBytes(String msg)
     Send a String message to the connected client as a string of bytes.
public  voidsendClientMsg(String msg)
     Send a String message to the connected client it adds a new line{\r\n} to the end of the string.
public  voidsendClientObject(Object msg)
     Send a Object message to the connected client.
public  voidsendSystemMsg(String msg)
     Send a String message to the logger associated with QuickServer.getAppLogger with Level.INFO as its level.
public  voidsendSystemMsg(String msg, Level level)
     Send a String message to the logger associated with QuickServer.getAppLogger .
public  voidsendSystemMsg(String msg, boolean newline)
     Send a String message to the system output stream.
protected  voidsetAuthenticator(Authenticator authenticator)
     Sets the Authenticator class that handles the authentication of a client.
public  voidsetCharset(String charset)
     Sets the Charset to be used for String decoding and encoding.
protected  voidsetClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)
     Sets the ClientAuthenticationHandler class that handles the authentication of a client.
protected  voidsetClientBinaryHandler(ClientBinaryHandler handler)
     Sets the ClientBinaryHandler class that interacts with client sockets.
protected  voidsetClientCommandHandler(ClientCommandHandler handler)
     Sets the ClientCommandHandler class that interacts with client sockets.
protected  voidsetClientData(ClientData data)
    
protected  voidsetClientEventHandler(ClientEventHandler handler)
     Sets the ClientEventHandler class that gets notified of client events.
protected  voidsetClientExtendedEventHandler(ClientExtendedEventHandler handler)
     Sets the ClientExtendedEventHandler class that gets notified of extended client events.
protected  voidsetClientObjectHandler(ClientObjectHandler handler)
     Sets the ClientObjectHandler class that interacts with client sockets.
abstract protected  voidsetClientWriteHandler(ClientWriteHandler handler)
     Sets the ClientWriteHandler class that interacts with client sockets.
public  voidsetCommunicationLogging(boolean communicationLogging)
     Sets the communication logging flag.
abstract public  voidsetDataMode(DataMode dataMode, DataType dataType)
     Sets the DataMode for the ClientHandler Note: When mode is DataMode.OBJECT and type is DataType.IN this call will block until the client ObjectOutputStream has written and flushes the header.
abstract protected  voidsetInputStream(InputStream in)
     Sets the java.io.InputStream associated with the Client being handled.
public  voidsetMaxConnectionMsg(String msg)
     Sets message to be displayed when maximum connection reaches.
public  voidsetOutputStream(OutputStream out)
     Set the java.io.OutputStream associated with the Client being handled.
public  voidsetSecure(boolean secure)
     Sets flag indicating if the client is connected in secure mode (SSL or TLS).
abstract public  voidsetSelectionKey(SelectionKey selectionKey)
     Sets client SelectionKey associated, if any.
protected  voidsetServer(QuickServer server)
     Sets the QuickServer object associated with this ClientHandler.
public  voidsetSocket(Socket socket)
     Returns client socket associated.
abstract public  voidsetSocketChannel(SocketChannel socketChannel)
     Sets client socket channel associated, if any.
public  voidsetTimeout(int time)
     Sets the client socket's timeout.
public  StringtoString()
     Returns the ClientHandler information.
abstract public  voidupdateInputOutputStreams()
     Updates the InputStream and OutputStream for the ClientHandler for the set Socket.
public  voidupdateLastCommunicationTime()
    

Field Detail
NEW_LINE
final protected static String NEW_LINE(Code)



NEW_LINE_BYTES
final protected static byte NEW_LINE_BYTES(Code)



appLogger
protected Logger appLogger(Code)



authenticator
protected Authenticator authenticator(Code)



authorised
protected volatile boolean authorised(Code)
Client authorisation status



b_in
protected BufferedInputStream b_in(Code)



b_out
protected BufferedOutputStream b_out(Code)



bufferedReader
protected BufferedReader bufferedReader(Code)



charset
protected String charset(Code)



clientAuthenticationHandler
protected ClientAuthenticationHandler clientAuthenticationHandler(Code)



clientBinaryHandler
protected ClientBinaryHandler clientBinaryHandler(Code)



clientCommandHandler
protected ClientCommandHandler clientCommandHandler(Code)



clientConnectedTime
protected Date clientConnectedTime(Code)



clientData
protected ClientData clientData(Code)



clientEventHandler
protected ClientEventHandler clientEventHandler(Code)



clientEvents
protected Set clientEvents(Code)



clientExtendedEventHandler
protected ClientExtendedEventHandler clientExtendedEventHandler(Code)



clientObjectHandler
protected ClientObjectHandler clientObjectHandler(Code)



closeOrLostNotified
protected volatile boolean closeOrLostNotified(Code)



communicationLogging
protected boolean communicationLogging(Code)



connection
protected volatile boolean connection(Code)



counAuthTry
protected int counAuthTry(Code)
Count of client login attempts



dataModeIN
protected DataMode dataModeIN(Code)



dataModeOUT
protected DataMode dataModeOUT(Code)



in
protected InputStream in(Code)



lastCommunicationTime
protected Date lastCommunicationTime(Code)



lockObj
protected Object lockObj(Code)



lost
protected boolean lost(Code)



maxAuthTry
protected int maxAuthTry(Code)
max allowed login attempts



maxAuthTryMsg
protected String maxAuthTryMsg(Code)
Message to be displayed when max login attempt reaches.



maxConnectionMsg
protected String maxConnectionMsg(Code)



o_in
protected ObjectInputStream o_in(Code)



o_out
protected ObjectOutputStream o_out(Code)



out
protected OutputStream out(Code)



quickServer
protected QuickServer quickServer(Code)



secure
protected boolean secure(Code)



socket
protected Socket socket(Code)
Client socket



socketTimeout
protected int socketTimeout(Code)



threadEvent
final protected static ThreadLocal threadEvent(Code)



timeoutMsg
protected String timeoutMsg(Code)
timeout message



unprocessedClientEvents
protected List unprocessedClientEvents(Code)



willClean
protected volatile boolean willClean(Code)




Constructor Detail
BasicClientHandler
public BasicClientHandler(int instanceCount)(Code)



BasicClientHandler
public BasicClientHandler()(Code)




Method Detail
addEvent
public void addEvent(ClientEvent event)(Code)
Adds the ClientEvent.
since:
   1.4.5



assertionSystemExit
protected void assertionSystemExit()(Code)



checkDataModeSet
protected void checkDataModeSet(DataMode dataMode, DataType dataType)(Code)



clean
public void clean()(Code)



closeConnection
abstract public void closeConnection()(Code)
Closes client socket associated.



finalize
protected void finalize() throws Throwable(Code)



forceClose
public synchronized void forceClose() throws IOException(Code)
Force the closing of the client by closing the associated socket.
since:
   1.3.3



getAppLogger
public Logger getAppLogger()(Code)
Returns client SelectionKey associated, if any.
since:
   1.4.5



getBufferedInputStream
public BufferedInputStream getBufferedInputStream()(Code)
Returns the java.io.BufferedInputStream associated with the Client being handled. Can be null if not available at the time of method call.
See Also:   BasicClientHandler.getBufferedOutputStream
since:
   1.4.6



getBufferedOutputStream
public BufferedOutputStream getBufferedOutputStream()(Code)
Returns the java.io.BufferedOutputStream associated with the Client being handled. Can be null if not available at the time of method call.
See Also:   BasicClientHandler.getBufferedInputStream
since:
   1.4.6



getBufferedReader
abstract public BufferedReader getBufferedReader()(Code)
Returns the java.io.BufferedReader associated with the Client being handled. Note that this is only available under blocking mode.
See Also:   BasicClientHandler.getBufferedWriter



getBufferedWriter
public BufferedWriter getBufferedWriter()(Code)
Returns the java.io.BufferedWriter associated with the Client being handled.



getCharset
public String getCharset()(Code)
Returns Charset to be used for String decoding and encoding..
See Also:   BasicClientHandler.setCharset
since:
   1.4.5



getClientConnectedTime
public Date getClientConnectedTime()(Code)
Returns the date/time when the client socket was assigned to this ClientHanlder. If no client is currently connected it will return null
since:
   1.3.1



getClientData
public ClientData getClientData()(Code)
Returns the ClientData object associated with this ClientHandler, if not set will return null
See Also:   ClientData
See Also:   BasicClientHandler.setClientData



getClientIdentifiable
protected static String getClientIdentifiable(ClientHandler foundClientHandler)(Code)



getCommunicationLogging
public boolean getCommunicationLogging()(Code)
Returns the communication logging flag.
See Also:   BasicClientHandler.setCommunicationLogging
since:
   1.3.2



getConnection
public java.sql.Connection getConnection(String id) throws Exception(Code)
Returns the java.sql.Connection object for the DatabaseConnection that is identified by id passed. If id passed does not match with any connection loaded by this class it will return null. This just calls getServer().getDBPoolUtil().getConnection(id)
since:
   1.3



getDataMode
public DataMode getDataMode(DataType dataType)(Code)
Returns the DataMode of the ClientHandler for the DataType.
since:
   1.2



getHostAddress
public String getHostAddress()(Code)
Returns cached socket host ip address.
since:
   1.4.5



getInputStream
public InputStream getInputStream()(Code)
Returns the java.io.InputStream associated with the Client being handled.
See Also:   BasicClientHandler.setInputStream



getInstanceCount
public int getInstanceCount()(Code)



getLastCommunicationTime
public Date getLastCommunicationTime()(Code)
Returns the date/time when the client socket last sent a data to this ClientHanlder. If no client is currently connected it will return null
since:
   1.3.3



getMaxConnectionMsg
public String getMaxConnectionMsg()(Code)
Returns message to be displayed to the client when maximum connection reaches.
since:
   1.4.5



getName
public String getName()(Code)
Returns the ClientHandler name
since:
   1.4.6



getObjectInputStream
public ObjectInputStream getObjectInputStream()(Code)
Returns the java.io.ObjectInputStream associated with the Client being handled. It will be null if no ClientObjectHandler was set in QuickServer .
See Also:   BasicClientHandler.getObjectOutputStream
since:
   1.2



getObjectOutputStream
public ObjectOutputStream getObjectOutputStream()(Code)
Returns the java.io.ObjectOutputStream associated with the Client being handled. It will be null if no ClientObjectHandler was set in QuickServer .
See Also:   BasicClientHandler.getObjectInputStream
since:
   1.2



getOutputStream
public OutputStream getOutputStream()(Code)
Returns the java.io.OutputStream associated with the Client being handled.
See Also:   BasicClientHandler.setOutputStream



getSelectionKey
abstract public SelectionKey getSelectionKey()(Code)
Returns client SelectionKey associated, if any.
since:
   1.4.5



getServer
public QuickServer getServer()(Code)
Returns the QuickServer object that created it.
See Also:   BasicClientHandler.setServer



getSocket
public Socket getSocket()(Code)
Returns client socket associated.



getSocketChannel
abstract public SocketChannel getSocketChannel()(Code)
Returns client socket channel associated, if any.
since:
   1.4.5



getThreadEvent
protected ClientEvent getThreadEvent()(Code)
Returns threads current event for this client.
since:
   1.4.5



getTimeout
public int getTimeout()(Code)
Returns the Client socket timeout in milliseconds.
See Also:   BasicClientHandler.setTimeout
since:
   1.4.5



getWillClean
public boolean getWillClean()(Code)



handleClient
public void handleClient(TheClient theClient)(Code)
Associates the ClientHanlder with the client encapsulated by theClient.
Parameters:
  theClient - object that encapsulates client socket and its configuration details.



handleTimeout
protected void handleTimeout(SocketTimeoutException e) throws SocketException, IOException(Code)



hasEvent
public boolean hasEvent(ClientEvent event)(Code)
Checks if this client has the event.
since:
   1.4.5



info
public String info()(Code)
Returns the ClientHandler detailed information. If ClientData is present and is ClientIdentifiable will return ClientInfo else it will return Clients InetAddress and port information.



isClientEventNext
public boolean isClientEventNext(ClientEvent clientEvent)(Code)
Checks if the passed ClientEvent is the one next for processing if a thread is allowed through this object.
since:
   1.4.6



isClosed
public boolean isClosed()(Code)
Checks if the client is closed.
since:
   1.4.1



isConected
public boolean isConected() throws SocketException(Code)
Checks if the client is still connected.
exception:
  SocketException - if Socket is not open.BasicClientHandler.isConnected



isConnected
public boolean isConnected() throws SocketException(Code)
Checks if the client is still connected.
exception:
  SocketException - if Socket is not open.
since:
   1.4.5



isOpen
public boolean isOpen()(Code)
Checks if the client is still connected and if socket is open. This is same as isConnected() but does not throw SocketException.
since:
   1.4.6



isSecure
public boolean isSecure()(Code)
Returns flag indicating if the client is connected in secure mode (SSL or TLS). secure flag
since:
   1.4.0



makeSecure
public void makeSecure() throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Makes current Client connection to secure protocol based on the secure configuration set to the server. This method will just call makeSecure(false, false, true, null).
throws:
  IOException -
throws:
  NoSuchAlgorithmException -
throws:
  KeyManagementException -
since:
   1.4.0



makeSecure
public void makeSecure(String protocol) throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Makes current Client connection to secure protocol. This method will just call makeSecure(false, false, true, protocol).
throws:
  IOException -
throws:
  NoSuchAlgorithmException -
throws:
  KeyManagementException -
since:
   1.4.0



makeSecure
public void makeSecure(boolean useClientMode, boolean needClientAuth, boolean autoClose, String protocol) throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Makes current Client connection to secure protocol.
Parameters:
  useClientMode - falg if the socket should start its first handshake in "client" mode.
Parameters:
  needClientAuth - flag if the clients must authenticate themselves.
Parameters:
  autoClose - close the underlying socket when this socket is closed
Parameters:
  protocol - the standard name of the requested protocol. If null will use the protocol set in secure configuration of the server.
throws:
  IOException -
throws:
  NoSuchAlgorithmException -
throws:
  KeyManagementException -
since:
   1.4.0



notifyCloseOrLost
protected void notifyCloseOrLost() throws IOException(Code)



prepareForRun
protected void prepareForRun() throws SocketException, IOException(Code)



processAuthorisation
protected AuthStatus processAuthorisation() throws SocketException, IOException, AppException(Code)



processMaxConnection
protected void processMaxConnection(ClientEvent currentEvent) throws IOException(Code)



readBinary
public byte[] readBinary() throws IOException(Code)
Read the binary input. This will block till some data is received from the stream. Allowed only when DataType.IN is in DataMode.BINARY mode. The data as a String
since:
   1.4



readBytes
public String readBytes() throws IOException(Code)
Read the byte input. This will block till some data is received from the stream. Allowed only when DataType.IN is in DataMode.BYTE mode. The data as a String
since:
   1.3.2



readInputStream
abstract protected byte[] readInputStream() throws IOException(Code)
Read the byte input. This will block till some data is received from the stream. The data as a String
since:
   1.3.1



readInputStream
protected static byte[] readInputStream(InputStream _in) throws IOException(Code)



registerForRead
abstract public void registerForRead() throws IOException, ClosedChannelException(Code)
Register OP_READ with the SelectionKey associated with the channel. If SelectionKey is not set then it registers the channel with the Selector.
since:
   1.4.5



registerForWrite
abstract public void registerForWrite() throws IOException, ClosedChannelException(Code)
Register OP_WRITE with the SelectionKey associated with the channel.
since:
   1.4.5



removeEvent
public void removeEvent(ClientEvent event)(Code)
Removes the ClientEvent.
since:
   1.4.5



returnClientData
protected synchronized void returnClientData()(Code)



returnClientHandler
protected void returnClientHandler()(Code)



run
abstract public void run()(Code)



sendClientBinary
public void sendClientBinary(byte data) throws IOException(Code)
Send a binary data to the connected client. If client is not connected it will just return.
since:
   1.4
exception:
  IOException - if Socket IO Error or Socket was closed by the client.



sendClientBinary
public void sendClientBinary(byte data, int off, int len) throws IOException(Code)
Send a binary data to the connected client. If client is not connected it will just return.
since:
   1.4.5
exception:
  IOException - if Socket IO Error or Socket was closed by the client.



sendClientBytes
public void sendClientBytes(String msg) throws IOException(Code)
Send a String message to the connected client as a string of bytes. If client is not connected it will just return.
since:
   1.3.1
exception:
  IOException - if Socket IO Error or Socket was closed by the client.



sendClientMsg
public void sendClientMsg(String msg) throws IOException(Code)
Send a String message to the connected client it adds a new line{\r\n} to the end of the string. If client is not connected it will just return.
exception:
  IOException - if Socket IO Error or Socket was closed by the client.



sendClientObject
public void sendClientObject(Object msg) throws IOException(Code)
Send a Object message to the connected client. The message Object passed must be serializable. If client is not connected it will just return.
exception:
  IOException - if Socket IO Error or Socket was closed by the client.
exception:
  IllegalStateException - if DataType.OUT is not in DataMode.OBJECT
See Also:   BasicClientHandler.setDataMode
since:
   1.2



sendSystemMsg
public void sendSystemMsg(String msg)(Code)
Send a String message to the logger associated with QuickServer.getAppLogger with Level.INFO as its level.



sendSystemMsg
public void sendSystemMsg(String msg, Level level)(Code)
Send a String message to the logger associated with QuickServer.getAppLogger .
since:
   1.2



sendSystemMsg
public void sendSystemMsg(String msg, boolean newline)(Code)
Send a String message to the system output stream.
Parameters:
  newline - indicates if new line required at the end.BasicClientHandler.sendSystemMsg(java.lang.String)



setAuthenticator
protected void setAuthenticator(Authenticator authenticator)(Code)
Sets the Authenticator class that handles the authentication of a client.
Parameters:
  authenticator - fully qualified name of the class that implements Authenticator.
since:
   1.3



setCharset
public void setCharset(String charset)(Code)
Sets the Charset to be used for String decoding and encoding.
Parameters:
  charset - to be used for String decoding and encoding
See Also:   BasicClientHandler.getCharset
since:
   1.4.5



setClientAuthenticationHandler
protected void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)(Code)
Sets the ClientAuthenticationHandler class that handles the authentication of a client.
Parameters:
  clientAuthenticationHandler - fully qualified name of the class that implements ClientAuthenticationHandler.
since:
   1.4.6



setClientBinaryHandler
protected void setClientBinaryHandler(ClientBinaryHandler handler)(Code)
Sets the ClientBinaryHandler class that interacts with client sockets.
Parameters:
  handler - fully qualified name of the class that implements ClientBinaryHandler
since:
   1.4



setClientCommandHandler
protected void setClientCommandHandler(ClientCommandHandler handler)(Code)
Sets the ClientCommandHandler class that interacts with client sockets.



setClientData
protected void setClientData(ClientData data)(Code)
Sets the ClientData object associated with this ClientHandler
See Also:   ClientData
See Also:   BasicClientHandler.getClientData



setClientEventHandler
protected void setClientEventHandler(ClientEventHandler handler)(Code)
Sets the ClientEventHandler class that gets notified of client events.
since:
   1.4.6



setClientExtendedEventHandler
protected void setClientExtendedEventHandler(ClientExtendedEventHandler handler)(Code)
Sets the ClientExtendedEventHandler class that gets notified of extended client events.
since:
   1.4.6



setClientObjectHandler
protected void setClientObjectHandler(ClientObjectHandler handler)(Code)
Sets the ClientObjectHandler class that interacts with client sockets.
Parameters:
  handler - fully qualified name of the class that implements ClientObjectHandler
since:
   1.2



setClientWriteHandler
abstract protected void setClientWriteHandler(ClientWriteHandler handler)(Code)
Sets the ClientWriteHandler class that interacts with client sockets.
Parameters:
  handler - fully qualified name of the class that implements ClientWriteHandler
since:
   1.4.5



setCommunicationLogging
public void setCommunicationLogging(boolean communicationLogging)(Code)
Sets the communication logging flag.
See Also:   BasicClientHandler.getCommunicationLogging
since:
   1.3.2



setDataMode
abstract public void setDataMode(DataMode dataMode, DataType dataType) throws IOException(Code)
Sets the DataMode for the ClientHandler Note: When mode is DataMode.OBJECT and type is DataType.IN this call will block until the client ObjectOutputStream has written and flushes the header.
since:
   1.2
exception:
  IOException - if mode could not be changed.
Parameters:
  dataMode - mode of data exchange - String or Object.
Parameters:
  dataType - type of data for which mode has to be set.



setInputStream
abstract protected void setInputStream(InputStream in) throws IOException(Code)
Sets the java.io.InputStream associated with the Client being handled.
since:
   1.1
See Also:   BasicClientHandler.getInputStream



setMaxConnectionMsg
public void setMaxConnectionMsg(String msg)(Code)
Sets message to be displayed when maximum connection reaches.
since:
   1.4.5



setOutputStream
public void setOutputStream(OutputStream out) throws IOException(Code)
Set the java.io.OutputStream associated with the Client being handled.
since:
   1.1
See Also:   BasicClientHandler.getOutputStream
exception:
  IOException - if ObjectOutputStream could not be created.



setSecure
public void setSecure(boolean secure)(Code)
Sets flag indicating if the client is connected in secure mode (SSL or TLS).
Parameters:
  secure -
since:
   1.4.0



setSelectionKey
abstract public void setSelectionKey(SelectionKey selectionKey)(Code)
Sets client SelectionKey associated, if any.
since:
   1.4.5



setServer
protected void setServer(QuickServer server)(Code)
Sets the QuickServer object associated with this ClientHandler.
See Also:   BasicClientHandler.getServer



setSocket
public void setSocket(Socket socket)(Code)
Returns client socket associated.
since:
   1.4.0
See Also:   BasicClientHandler.updateInputOutputStreams



setSocketChannel
abstract public void setSocketChannel(SocketChannel socketChannel)(Code)
Sets client socket channel associated, if any.
since:
   1.4.5



setTimeout
public void setTimeout(int time)(Code)
Sets the client socket's timeout.
Parameters:
  time - client socket timeout in milliseconds.
See Also:   BasicClientHandler.getTimeout
since:
   1.4.5



toString
public String toString()(Code)
Returns the ClientHandler information. If ClientData is present and is ClientIdentifiable will return ClientInfo else it will return Clients InetAddress and port information.



updateInputOutputStreams
abstract public void updateInputOutputStreams() throws IOException(Code)
Updates the InputStream and OutputStream for the ClientHandler for the set Socket.
since:
   1.4.0
See Also:   BasicClientHandler.setSocket



updateLastCommunicationTime
public void updateLastCommunicationTime()(Code)
Updates the last communication time for this client
since:
   1.3.3



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.