Method Summary |
|
public void | addEvent(ClientEvent event) Adds the ClientEvent. |
protected void | assertionSystemExit() |
protected void | checkDataModeSet(DataMode dataMode, DataType dataType) |
public void | clean() |
abstract public void | closeConnection() Closes client socket associated. |
protected void | finalize() |
public synchronized void | forceClose() Force the closing of the client by closing the associated socket. |
public Logger | getAppLogger() Returns client SelectionKey associated, if any. |
public BufferedInputStream | getBufferedInputStream() Returns the
java.io.BufferedInputStream associated with
the Client being handled. |
public BufferedOutputStream | getBufferedOutputStream() Returns the
java.io.BufferedOutputStream associated with
the Client being handled. |
abstract public BufferedReader | getBufferedReader() Returns the
java.io.BufferedReader associated with
the Client being handled. |
public BufferedWriter | getBufferedWriter() Returns the
java.io.BufferedWriter associated with
the Client being handled. |
public String | getCharset() Returns Charset to be used for String decoding and encoding.. |
public Date | getClientConnectedTime() Returns the date/time when the client socket was assigned to this
ClientHanlder. |
public ClientData | getClientData() |
protected static String | getClientIdentifiable(ClientHandler foundClientHandler) |
public boolean | getCommunicationLogging() Returns the communication logging flag. |
public java.sql.Connection | getConnection(String id) Returns the
java.sql.Connection object for the
DatabaseConnection that is identified by id passed. |
public DataMode | getDataMode(DataType dataType) Returns the
DataMode of the ClientHandler for the
DataType. |
public String | getHostAddress() Returns cached socket host ip address. |
public InputStream | getInputStream() Returns the
java.io.InputStream associated with
the Client being handled. |
public int | getInstanceCount() |
public Date | getLastCommunicationTime() Returns the date/time when the client socket last sent a data to this
ClientHanlder. |
public String | getMaxConnectionMsg() Returns message to be displayed to the client when maximum
connection reaches. |
public String | getName() |
public ObjectInputStream | getObjectInputStream() Returns the
java.io.ObjectInputStream associated with
the Client being handled. |
public ObjectOutputStream | getObjectOutputStream() Returns the
java.io.ObjectOutputStream associated with
the Client being handled. |
public OutputStream | getOutputStream() Returns the
java.io.OutputStream associated with
the Client being handled. |
abstract public SelectionKey | getSelectionKey() Returns client SelectionKey associated, if any. |
public QuickServer | getServer() Returns the QuickServer object that created it. |
public Socket | getSocket() Returns client socket associated. |
abstract public SocketChannel | getSocketChannel() Returns client socket channel associated, if any. |
protected ClientEvent | getThreadEvent() Returns threads current event for this client. |
public int | getTimeout() Returns the Client socket timeout in milliseconds. |
public boolean | getWillClean() |
public void | handleClient(TheClient theClient) Associates the ClientHanlder with the client encapsulated by
theClient . |
protected void | handleTimeout(SocketTimeoutException e) |
public boolean | hasEvent(ClientEvent event) Checks if this client has the event. |
public String | info() Returns the ClientHandler detailed information. |
public boolean | isClientEventNext(ClientEvent clientEvent) Checks if the passed ClientEvent is the one next for
processing if a thread is allowed through this object. |
public boolean | isClosed() Checks if the client is closed. |
public boolean | isConected() Checks if the client is still connected. |
public boolean | isConnected() Checks if the client is still connected. |
public boolean | isOpen() Checks if the client is still connected and if socket is open. |
public boolean | isSecure() Returns flag indicating if the client is connected in secure mode
(SSL or TLS). |
public void | makeSecure() Makes current Client connection to secure protocol based on the
secure configuration set to the server. |
public void | makeSecure(String protocol) Makes current Client connection to secure protocol. |
public void | makeSecure(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 void | notifyCloseOrLost() |
protected void | prepareForRun() |
protected AuthStatus | processAuthorisation() |
protected void | processMaxConnection(ClientEvent currentEvent) |
public byte[] | readBinary() Read the binary input. |
public String | readBytes() Read the byte input. |
abstract protected byte[] | readInputStream() Read the byte input. |
protected static byte[] | readInputStream(InputStream _in) |
abstract public void | registerForRead() Register OP_READ with the SelectionKey associated with the channel. |
abstract public void | registerForWrite() Register OP_WRITE with the SelectionKey associated with the channel. |
public void | removeEvent(ClientEvent event) Removes the ClientEvent. |
protected synchronized void | returnClientData() |
protected void | returnClientHandler() |
abstract public void | run() |
public void | sendClientBinary(byte data) Send a binary data to the connected client. |
public void | sendClientBinary(byte data, int off, int len) Send a binary data to the connected client. |
public void | sendClientBytes(String msg) Send a String message to the connected client as a string of bytes. |
public void | sendClientMsg(String msg) Send a String message to the connected client
it adds a new line{\r\n} to the end of the string. |
public void | sendClientObject(Object msg) Send a Object message to the connected client. |
public void | sendSystemMsg(String msg) Send a String message to the logger associated with
QuickServer.getAppLogger with Level.INFO as its level. |
public void | sendSystemMsg(String msg, Level level) Send a String message to the logger associated with
QuickServer.getAppLogger . |
public void | sendSystemMsg(String msg, boolean newline) Send a String message to the system output stream. |
protected void | setAuthenticator(Authenticator authenticator) Sets the Authenticator class that handles the
authentication of a client. |
public void | setCharset(String charset) Sets the Charset to be used for String decoding and encoding. |
protected void | setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler) Sets the ClientAuthenticationHandler class that handles the
authentication of a client. |
protected void | setClientBinaryHandler(ClientBinaryHandler handler) Sets the ClientBinaryHandler class that interacts with
client sockets. |
protected void | setClientCommandHandler(ClientCommandHandler handler) Sets the ClientCommandHandler class that interacts with
client sockets. |
protected void | setClientData(ClientData data) |
protected void | setClientEventHandler(ClientEventHandler handler) Sets the ClientEventHandler class that gets notified of client events. |
protected void | setClientExtendedEventHandler(ClientExtendedEventHandler handler) Sets the ClientExtendedEventHandler class that gets notified of extended client events. |
protected void | setClientObjectHandler(ClientObjectHandler handler) Sets the ClientObjectHandler class that interacts with
client sockets. |
abstract protected void | setClientWriteHandler(ClientWriteHandler handler) Sets the ClientWriteHandler class that interacts with
client sockets. |
public void | setCommunicationLogging(boolean communicationLogging) Sets the communication logging flag. |
abstract public void | setDataMode(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 void | setInputStream(InputStream in) Sets the
java.io.InputStream associated with
the Client being handled. |
public void | setMaxConnectionMsg(String msg) Sets message to be displayed when maximum connection reaches. |
public void | setOutputStream(OutputStream out) Set the
java.io.OutputStream associated with
the Client being handled. |
public void | setSecure(boolean secure) Sets flag indicating if the client is connected in secure mode
(SSL or TLS). |
abstract public void | setSelectionKey(SelectionKey selectionKey) Sets client SelectionKey associated, if any. |
protected void | setServer(QuickServer server) Sets the QuickServer object associated with this ClientHandler. |
public void | setSocket(Socket socket) Returns client socket associated. |
abstract public void | setSocketChannel(SocketChannel socketChannel) Sets client socket channel associated, if any. |
public void | setTimeout(int time) Sets the client socket's timeout. |
public String | toString() Returns the ClientHandler information. |
abstract public void | updateInputOutputStreams() Updates the InputStream and OutputStream for the ClientHandler for the
set Socket. |
public void | updateLastCommunicationTime() |