Java Doc for QuickServer.java in  » Net » QuickServer » org » quickserver » net » server » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.quickserver.net.server.QuickServer

QuickServer
public class QuickServer implements Runnable,Service,Cloneable,Serializable(Code)
Main class of QuickServer library. This class is used to create multi client servers quickly.

Ones a client is connected, it creates ClientHandler object, which is run using any thread available from the pool of threads maintained by org.quickserver.util.pool.thread.ClientPool , which handles the client.
QuickServer divides the application logic of its developer over eight class,

  • ClientEventHandler
     Handles client events [Optional Class].
  • ClientCommandHandler [#]
     Handles client character/string commands.
  • ClientObjectHandler [#]
     Handles client interaction - Object commands.
  • ClientBinaryHandler [#]
     Handles client interaction - binary data.
  • ClientWriteHandler [Optional Class]
     Handles client interaction - writing data (Only used in non-blocking mode).
  • ClientAuthenticationHandler [Optional Class]
     Used to Authencatet a client.
  • ClientData [Optional Class]
     Client data carrier (support class)
  • ClientExtendedEventHandler [Optional Class]
     Handles extended client events.
[#] = Any one of these have to be set based on default DataMode for input. The default DataMode for input is String so if not changes you will have to set ClientCommandHandler.

Eg:

 package echoserver;
 import org.quickserver.net.*;
 import org.quickserver.net.server.*;
 import java.io.*;
 public class EchoServer {
 public static void main(String args[])	{
 String cmdHandle = "echoserver.EchoCommandHandler";
 QuickServer myServer = new QuickServer();
 myServer.setClientCommandHandler(cmdHandle);
 myServer.setPort(4123);
 myServer.setName(Echo Server v1.0");
 try {
 myServer.startServer();
 } catch(AppException e) {
 System.err.println("Error in server : "+e);
 e.printStackTrace();
 }
 }
 }
 


version:
   1.4.7
author:
   Akshathkumar Shetty


Field Summary
protected  ClassclientDataClass
    

Constructor Summary
public  QuickServer()
     Creates a new server without any configuration.
public  QuickServer(String commandHandler)
     Creates a new server with the specified commandHandler has it ClientCommandHandler .
public  QuickServer(String commandHandler, int port)
     Creates a new server at port with the specified commandHandler has it ClientCommandHandler .

Method Summary
public  voidclearAllPools()
    
public  Objectclone()
     Creates and returns a copy of this object.
public  voidcloseAllPools()
    
public  voidconfigQuickServer(QuickServerConfig config)
     Configures QuickServer based on the passed QuickServerConfig object.
public  voidconfigQuickServer(QSAdminServerConfig config)
     Configures QSAdminServer based on the passed QuickServerConfig object.
public  voidconfigQuickServer()
     Configures QSAdminServer and QuickServer based on the internal QuickServerConfig object.
public  IteratorfindAllClient()
     Returns an iterator containing all the org.quickserver.net.server.ClientHandler that are currently handling clients.
public  IteratorfindAllClientById(String pattern)
     Tries to find the Client by the matching pattern passed to the Id.

Note: This command is an expensive so do use it limitedly and cache the returned object.

public  IteratorfindAllClientByKey(String pattern)
     Tries to find the Client by the matching pattern passed to the key.

Note: This command is an expensive so do use it limitedly and cache the returned object.

public  ClientHandlerfindClientByKey(String key)
     Tries to find the Client by the Key passed.

Note: This command is an expensive so do use it limitedly and cache the returned object.

public  ClientHandlerfindFirstClientById(String id)
     Tries to find the Client by the Id passed.

Note: This command is an expensive so do use it limitedly and cache the returned object.

public  AccessConstraintConfiggetAccessConstraintConfig()
     Returns Access constraints if present else null.
public  LoggergetAppLogger()
     Returns the application logger associated with QuickServer.
public  StringgetApplicationJarPath()
     Returns the applications jar/s path.
public  StringgetAuthenticator()
     Returns the Authenticator class that handles the authentication of a client.
public  BasicServerConfiggetBasicConfig()
     Returns the basic confiuration of the QuickServer.
public  InetAddressgetBindAddr()
     Returns the IP address binding to.
public  booleangetBlockingMode()
     Returns the current blocking mode of the server.
public  ObjectPoolgetByteBufferPool()
     Returns ObjectPool of java.nio.ByteBuffer class.
public  ClassgetClass(String name, boolean reload)
    
public  ClassLoadergetClassLoader()
     Gets the classloader used to load the dynamicaly resolved classes.
public  StringgetClientAuthenticationHandler()
     Returns the ClientAuthenticationHandler class that handles the authentication of a client.
public  StringgetClientBinaryHandler()
     Returns the ClientBinaryHandler class that interacts with client sockets.
public  StringgetClientCommandHandler()
     Returns the ClientCommandHandler class that interacts with client sockets.
public  longgetClientCount()
     Returns number of clients connected.
public  StringgetClientData()
    
public  ObjectPoolgetClientDataPool()
     Returns ObjectPool of org.quickserver.net.server.ClientData class.
public  StringgetClientEventHandler()
     Returns the ClientEventHandler class that gets notified of client events.
public  StringgetClientExtendedEventHandler()
     Returns the ClientExtendedEventHandler class that gets notified of extended client events.
public  ObjectPoolgetClientHandlerPool()
     Returns ObjectPool of org.quickserver.net.server.ClientHandler class.
public  ClientIdentifiergetClientIdentifier()
     Returns the implementation that is used to do Client Identification.
public  StringgetClientObjectHandler()
     Returns the ClientObjectHandler class that interacts with client sockets.
public  ClientPoolgetClientPool()
     Returns org.quickserver.util.pool.thread.ClientPool class that managing the pool of threads for handling clients.
public  StringgetClientWriteHandler()
     Returns the ClientWriteHandler class that interacts with client sockets (only used in non-blocking mode).
public  booleangetCommunicationLogging()
     Returns the communication logging flag.
public  QuickServerConfiggetConfig()
     Returns the confiuration of the QuickServer.
public  StringgetConsoleLoggingFormatter()
     Gets the console log handler formatter.
public  StringgetConsoleLoggingLevel()
     Gets the console log handler level.
public  DBPoolUtilgetDBPoolUtil()
     Returns org.quickserver.sql.DBPoolUtil object if org.quickserver.util.xmlreader.DBObjectPoolConfig was set.
public  DataModegetDefaultDataMode(DataType dataType)
    
public  java.util.DategetLastStartTime()
     Returns the date/time when the server was last started. last started time.
public  intgetMaxAuthTry()
     Returns max allowed login attempts.
public  StringgetMaxAuthTryMsg()
     Returns message to be displayed when maximum allowed login attempts has reached.
public  longgetMaxConnection()
     Returns the maximum number of client connection allowed.
public  StringgetMaxConnectionMsg()
     Returns the message to be sent to any new client connected after maximum client connection has reached.
public  StringgetName()
     Returns the name of the QuickServer.
public static  StringgetNewLine()
     Returns the new line string used by QuickServer.
public  intgetPort()
     Returns the port for the QuickServer.
public  QSAdminServergetQSAdminServer()
    
public  StringgetQSAdminServerAuthenticator()
     Returns the Authenticator or ClientAuthenticationHandler class of QSAdminServer that handles the authentication of a client.
public  intgetQSAdminServerPort()
     Returns the port to run QSAdminServer on.
public  SSLContextgetSSLContext()
     Returns the SSLContext from Secure configuring.
public  SSLContextgetSSLContext(String protocol)
     Returns the SSLContext object that implements the specified secure socket protocol from Secure configuring.
See Also:   QuickServer.loadSSLContext
Parameters:
  protocol - the standard name of the requested protocol.
public  SSLSocketFactorygetSSLSocketFactory()
     Returns a SSLSocketFactory object to be used for creating SSLSockets.
public  SSLSocketFactorygetSSLSocketFactory(String protocol)
     Returns a SSLSocketFactory object to be used for creating SSLSockets.
public  SecuregetSecure()
    
public  SecurityManagergetSecurityManager()
    
public  StringgetSecurityManagerClass()
    
public  SelectorgetSelector()
     Returns the Selector (NIO),if any.
public  StringgetServerBanner()
    
public  ServerHooksgetServerHooks()
     Returns ServerHooks if present else null.
public  ThrowablegetServiceError()
     Returns service error if any.
public  intgetServiceState()
     Returns the state of the process As any constant of Service interface.
public  Object[]getStoreObjects()
     Returns store of objects from QuickServer, if nothing was set will return null.
public  intgetTimeout()
     Returns the Client socket timeout in milliseconds.
public  StringgetTimeoutMsg()
     Returns timeout message.
final public static  StringgetVersion()
     Returns the version of the library.
final public static  floatgetVersionNo()
     Returns the numerical version of the library.
final public static  floatgetVersionNo(String ver)
     Returns the numerical version of the library.
public  Stringinfo()
     Information about the service.
public  voidinitAllPools()
     Initialise all Object and Thread pools.
public synchronized  voidinitServer(Object param)
     Initialise and create the server.
public synchronized  voidinitServer(QuickServerConfig qsConfig)
     Initialise and create the service.
public synchronized  booleaninitService(Object param)
     Initialise and create the service.
public synchronized  booleaninitService(QuickServerConfig qsConfig)
     Initialise and create the service.
public  booleanisClosed()
     Returns the closed state of the QuickServer Socket.
public  booleanisRunningSecure()
    
public static  QuickServerload(String xml)
     Loads the server from the xml file name passed.
protected  voidloadBusinessLogic()
    
public  voidloadSSLContext()
     Loads the SSLContext from Secure configuring if set.
public static  voidmain(String args)
     Usage: QuickServer [-options]
Where options include:
-about Opens About Dialogbox
-load [options] Loads the server from xml file.
protected  voidmakeServerSocket()
     Returns a ServerSocket object to be used for listening.
public  voidnextClientIsTrusted()
     Sets next client has a trusted client.
public  booleanregisterChannel(SocketChannel channel, int ops, Object att)
     Register the given channel for the given operations.
public  voidrestartServer()
     Restarts the QuickServer.
public  booleanresumeService()
     Resume the service.
public  voidrun()
    
public  voidsetAccessConstraintConfig(AccessConstraintConfig accessConstraintConfig)
    
public  voidsetAppLogger(Logger appLogger)
    
protected  voidsetApplicationJarPath(String applicationJarPath)
     Sets the applications jar/s path.
public  voidsetAuthenticator(String authenticator)
     Sets the Authenticator class that handles the authentication of a client.
public  voidsetBasicConfig(BasicServerConfig basicConfig)
     Sets the basic confiuration of the QuickServer.
public  voidsetBindAddr(String bindAddr)
     Sets the Ip address to bind to.
public  voidsetClassLoader(ClassLoader classLoader)
    
public  voidsetClientAuthenticationHandler(String authenticator)
     Sets the ClientAuthenticationHandler class that handles the authentication of a client.
public  voidsetClientBinaryHandler(String handler)
     Sets the ClientBinaryHandler class that interacts with client sockets to handle binary data.
public  voidsetClientCommandHandler(String handler)
     Sets the ClientCommandHandler class that interacts with client sockets.
public  voidsetClientData(String data)
     Sets the ClientData class that carries client data.
public  voidsetClientEventHandler(String handler)
     Sets the ClientEventHandler class that gets notified of client events.
public  voidsetClientExtendedEventHandler(String handler)
     Sets the ClientExtendedEventHandler class that gets notified of extended client events.
public  voidsetClientObjectHandler(String handler)
     Sets the ClientObjectHandler class that interacts with client sockets to handle java objects.
public  voidsetClientWriteHandler(String handler)
     Sets the ClientWriteHandler class that interacts with client sockets to handle data write (only used in non-blocking mode).
public  voidsetCommunicationLogging(boolean communicationLogging)
     Sets the communication logging flag.
public  voidsetConfig(QuickServerConfig config)
     Sets the confiuration of the QuickServer.
public  voidsetConsoleLoggingFormatter(String formatter)
     Sets the console log handler formatter.
public  voidsetConsoleLoggingLevel(Level level)
     Sets the console log handler level.
public  voidsetConsoleLoggingToMicro()
    
public  voidsetConsoleLoggingToMini()
    
public  voidsetDBObjectPoolConfig(DBObjectPoolConfig dBObjectPoolConfig)
    
public static  voidsetDebugNonBlockingMode(boolean flag)
    
public  voidsetDefaultDataMode(DataMode dataMode, DataType dataType)
    
public  voidsetDefaultDataMode(DefaultDataMode defaultDataMode)
    
public  voidsetLoggingLevel(Level level)
     Sets the level for all log handlers.
public  voidsetMaxAuthTry(int authTry)
     Sets max allowed login attempts.
public  voidsetMaxAuthTryMsg(String msg)
     Sets message to be displayed when maximum allowed login attempts has reached.
public  voidsetMaxConnection(long maxConnection)
     Sets the maximum number of client connection allowed.
public  voidsetMaxConnectionMsg(String maxConnectionMsg)
     Sets the message to be sent to any new client connected after maximum client connection has reached.
public  voidsetName(String name)
    
public  voidsetPort(int port)
     Sets the port for the QuickServer to listen on.
public  voidsetQSAdminServer(QSAdminServer adminServer)
    
public  voidsetQSAdminServerAuthenticator(String authenticator)
     Set the ClientAuthenticationHandler class of QSAdminServer that handles the authentication of a client.
public  voidsetQSAdminServerPort(int port)
     Set the port to run QSAdminServer on.
public  voidsetRunningSecure(boolean runningSecure)
    
public  voidsetSecure(Secure secure)
    
public  voidsetSecurityManagerClass(String securityManagerClass)
    
public  voidsetSelector(Selector selector)
     Sets the Selector (NIO).
public  voidsetServerBanner(String banner)
     Sets the serverBanner for the QuickServer that will be displayed on the standard output [console] when server starts.
public  voidsetServerHooks(ServerHooks serverHooks)
    
public  voidsetServiceState(int state)
     Sets the state of the process As any constant of Service interface.
public  voidsetStoreObjects(Object[] storeObjects)
     Sets the store of objects to QuickServer, it is an array of objects that main program or the class that created QuickServer passes to the QuickServer.
public  voidsetTimeout(int time)
     Sets the client socket's timeout.
public  voidsetTimeoutMsg(String msg)
     Sets timeout message.
public  voidstartQSAdminServer(int port, String authenticator)
     Starts QSAdminServer for this QuickServer.
public  voidstartQSAdminServer()
     Starts QSAdminServer for this QuickServer.
public  voidstartServer()
     Starts the QuickServer.
public  booleanstartService()
     Start the service.
public  voidstopServer()
     Stops the QuickServer.
public  booleanstopService()
     Stop the service.
public  booleansuspendService()
     Suspends the service.
public  StringtoString()
     Returns the Server name : port of the QuickServer.

Field Detail
clientDataClass
protected Class clientDataClass(Code)




Constructor Detail
QuickServer
public QuickServer()(Code)
Creates a new server without any configuration. Make sure you configure the QuickServer, before calling startServer()
See Also:   org.quickserver.net.server.ClientEventHandler
See Also:   org.quickserver.net.server.ClientCommandHandler
See Also:   org.quickserver.net.server.ClientObjectHandler
See Also:   org.quickserver.net.server.ClientBinaryHandler
See Also:   org.quickserver.net.server.ClientWriteHandler
See Also:   org.quickserver.net.server.ClientAuthenticationHandler
See Also:   org.quickserver.net.server.ClientHandler
See Also:   QuickServer.configQuickServer
See Also:   QuickServer.initService
See Also:   QuickServer.setPort
See Also:   QuickServer.setClientCommandHandler
since:
   1.2



QuickServer
public QuickServer(String commandHandler)(Code)
Creates a new server with the specified commandHandler has it ClientCommandHandler .
Parameters:
  commandHandler - the fully qualified name of the desired class that implements ClientCommandHandler
See Also:   org.quickserver.net.server.ClientCommandHandler
See Also:   org.quickserver.net.server.ClientAuthenticationHandler
See Also:   org.quickserver.net.server.ClientHandler
See Also:   QuickServer.setPort



QuickServer
public QuickServer(String commandHandler, int port)(Code)
Creates a new server at port with the specified commandHandler has it ClientCommandHandler .
Parameters:
  commandHandler - fully qualified name of the class thatimplements ClientCommandHandler
Parameters:
  port - to listen on.
See Also:   org.quickserver.net.server.ClientCommandHandler
See Also:   org.quickserver.net.server.ClientAuthenticationHandler
See Also:   org.quickserver.net.server.ClientHandler




Method Detail
clearAllPools
public void clearAllPools() throws Exception(Code)
Cleans all Object and Thread pools
since:
   1.3



clone
public Object clone()(Code)
Creates and returns a copy of this object.
since:
   1.3.3



closeAllPools
public void closeAllPools() throws Exception(Code)
Closes all Object and Thread pools
since:
   1.3



configQuickServer
public void configQuickServer(QuickServerConfig config) throws Exception(Code)
Configures QuickServer based on the passed QuickServerConfig object.
since:
   1.2



configQuickServer
public void configQuickServer(QSAdminServerConfig config) throws Exception(Code)
Configures QSAdminServer based on the passed QuickServerConfig object.
since:
   1.2



configQuickServer
public void configQuickServer() throws Exception(Code)
Configures QSAdminServer and QuickServer based on the internal QuickServerConfig object.
since:
   1.3



findAllClient
public Iterator findAllClient()(Code)
Returns an iterator containing all the org.quickserver.net.server.ClientHandler that are currently handling clients. It is recommended not to change the collection under an iterator. It is imperative that the user manually synchronize on the returned collection when iterating over it:
 Eg:
 ClientData foundClientData = null;
 Object syncObj = quickserver.getClientIdentifier().getObjectToSynchronize();
 synchronized(syncObj) {	
 Iterator iterator = quickserver.findAllClient();
 while(iterator.hasNext()) {
 foundClientHandler = (ClientHandler) iterator.next();
 ....
 }
 }
 //OR
 ClientData foundClientData = null;
 ClientIdentifier clientIdentifier = quickserver.getClientIdentifier();
 synchronized(clientIdentifier.getObjectToSynchronize()) {	
 Iterator iterator = clientIdentifier.findAllClient();
 while(iterator.hasNext()) {
 foundClientHandler = (ClientHandler) iterator.next();
 ....
 }
 }
 

since:
   1.3.1



findAllClientById
public Iterator findAllClientById(String pattern)(Code)
Tries to find the Client by the matching pattern passed to the Id.

Note: This command is an expensive so do use it limitedly and cache the returned object. But before you start sending message to the cached object do validate that ClientHandler with you is currently connected and is pointing to the same clinet has it was before. This can be done as follows.

 foundClientHandler.isConnected(); //this method will through SocketException if not connected
 Date newTime = foundClientHandler.getClientConnectedTime();
 if(oldCachedTime!=newTime) {
 //Client had disconnected and ClientHandler was reused for
 //someother client, so write code to again find ur client
 foundClientHandler = handler.getServer().findFirstClientById("friendsid");
 ...
 }


See Also:   ClientIdentifiable ClientHandler object if client was found else null
since:
   1.3.2



findAllClientByKey
public Iterator findAllClientByKey(String pattern)(Code)
Tries to find the Client by the matching pattern passed to the key.

Note: This command is an expensive so do use it limitedly and cache the returned object. But before you start sending message to the cached object do validate that ClientHandler with you is currently connected and is pointing to the same clinet has it was before. This can be done as follows.

 foundClientHandler.isConnected(); //this method will through SocketException if not connected
 Date newTime = foundClientHandler.getClientConnectedTime();
 if(oldCachedTime!=newTime) {
 //Client had disconnected and ClientHandler was reused for
 //some other client, so write code to again find ur client
 foundClientHandler = handler.getServer().findFirstClientByKey("friendsid");
 ...
 }


See Also:   ClientIdentifiable ClientHandler object if client was found else null
since:
   1.4



findClientByKey
public ClientHandler findClientByKey(String key)(Code)
Tries to find the Client by the Key passed.

Note: This command is an expensive so do use it limitedly and cache the returned object. But before you start sending message to the cached object do validate that ClientHandler with you is currently connected and is pointing to the same clinet has it was before. This can be done as follows.

 foundClientHandler.isConnected(); //this method will through SocketException if not connected
 Date newTime = foundClientHandler.getClientConnectedTime();
 if(oldCachedTime!=newTime) {
 //Client had disconnected and ClientHandler was reused for
 //someother client, so write code to again find ur client
 foundClientHandler = handler.getServer().findClientByKey("friendskey");
 ...
 }


See Also:   ClientIdentifiable ClientHandler object if client was found else null
since:
   1.3.1



findFirstClientById
public ClientHandler findFirstClientById(String id)(Code)
Tries to find the Client by the Id passed.

Note: This command is an expensive so do use it limitedly and cache the returned object. But before you start sending message to the cached object do validate that ClientHandler with you is currently connected and is pointing to the same clinet has it was before. This can be done as follows.

 foundClientHandler.isConnected(); //this method will through SocketException if not connected
 Date newTime = foundClientHandler.getClientConnectedTime();
 if(oldCachedTime!=newTime) {
 //Client had disconnected and ClientHandler was reused for
 //someother client, so write code to again find ur client
 foundClientHandler = handler.getServer().findFirstClientById("friendsid");
 ...
 }


See Also:   ClientIdentifiable ClientHandler object if client was found else null
since:
   1.3.1



getAccessConstraintConfig
public AccessConstraintConfig getAccessConstraintConfig()(Code)
Returns Access constraints if present else null.
since:
   1.3.3



getAppLogger
public Logger getAppLogger()(Code)
Returns the application logger associated with QuickServer. If it was not set will return QuickServer's own logger.
since:
   1.2



getApplicationJarPath
public String getApplicationJarPath()(Code)
Returns the applications jar/s path. This can be either absolute or relative(to config file) path to the jar file or the directory containing the jars needed by the application.
See Also:   QuickServer.setApplicationJarPath
since:
   1.3.3



getAuthenticator
public String getAuthenticator()(Code)
Returns the Authenticator class that handles the authentication of a client.
See Also:   QuickServer.setAuthenticator
since:
   1.3



getBasicConfig
public BasicServerConfig getBasicConfig()(Code)
Returns the basic confiuration of the QuickServer.
since:
   1.4.0



getBindAddr
public InetAddress getBindAddr()(Code)
Returns the IP address binding to.
since:
   1.1
See Also:   QuickServer.setBindAddr



getBlockingMode
public boolean getBlockingMode()(Code)
Returns the current blocking mode of the server.
since:
   1.4.6



getByteBufferPool
public ObjectPool getByteBufferPool()(Code)
Returns ObjectPool of java.nio.ByteBuffer class.
since:
   1.4.5



getClass
public Class getClass(String name, boolean reload) throws ClassNotFoundException(Code)
Utility method to load a class
since:
   1.3.3



getClassLoader
public ClassLoader getClassLoader()(Code)
Gets the classloader used to load the dynamicaly resolved classes.
since:
   1.4.6



getClientAuthenticationHandler
public String getClientAuthenticationHandler()(Code)
Returns the ClientAuthenticationHandler class that handles the authentication of a client.
See Also:   QuickServer.setClientAuthenticationHandler
since:
   1.4.6



getClientBinaryHandler
public String getClientBinaryHandler()(Code)
Returns the ClientBinaryHandler class that interacts with client sockets.
See Also:   QuickServer.setClientBinaryHandler
since:
   1.4



getClientCommandHandler
public String getClientCommandHandler()(Code)
Returns the ClientCommandHandler class that interacts with client sockets.
See Also:   QuickServer.setClientCommandHandler
since:
   1.1



getClientCount
public long getClientCount()(Code)
Returns number of clients connected.
since:
   1.1



getClientData
public String getClientData()(Code)
Returns the ClientData class string that carries client data the fully qualified name of the class that implements ClientData.
See Also:   QuickServer.setClientData



getClientDataPool
public ObjectPool getClientDataPool()(Code)
Returns ObjectPool of org.quickserver.net.server.ClientData class. If ClientData was not poolable will return null.
since:
   1.3



getClientEventHandler
public String getClientEventHandler()(Code)
Returns the ClientEventHandler class that gets notified of client events.
See Also:   QuickServer.setClientEventHandler
since:
   1.4.6



getClientExtendedEventHandler
public String getClientExtendedEventHandler()(Code)
Returns the ClientExtendedEventHandler class that gets notified of extended client events.
See Also:   QuickServer.setClientExtendedEventHandler
since:
   1.4.6



getClientHandlerPool
public ObjectPool getClientHandlerPool()(Code)
Returns ObjectPool of org.quickserver.net.server.ClientHandler class.
exception:
  IllegalStateException - if pool is not created yet.
since:
   1.3



getClientIdentifier
public ClientIdentifier getClientIdentifier()(Code)
Returns the implementation that is used to do Client Identification.
since:
   1.4.5



getClientObjectHandler
public String getClientObjectHandler()(Code)
Returns the ClientObjectHandler class that interacts with client sockets.
See Also:   QuickServer.setClientObjectHandler
since:
   1.2



getClientPool
public ClientPool getClientPool()(Code)
Returns org.quickserver.util.pool.thread.ClientPool class that managing the pool of threads for handling clients.
exception:
  IllegalStateException - if pool is not created yet.
since:
   1.3



getClientWriteHandler
public String getClientWriteHandler()(Code)
Returns the ClientWriteHandler class that interacts with client sockets (only used in non-blocking mode).
See Also:   QuickServer.setClientWriteHandler
since:
   1.4.5



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



getConfig
public QuickServerConfig getConfig()(Code)
Returns the confiuration of the QuickServer.
since:
   1.3



getConsoleLoggingFormatter
public String getConsoleLoggingFormatter()(Code)
Gets the console log handler formatter.
since:
   1.3



getConsoleLoggingLevel
public String getConsoleLoggingLevel()(Code)
Gets the console log handler level.
since:
   1.3



getDBPoolUtil
public DBPoolUtil getDBPoolUtil()(Code)
Returns org.quickserver.sql.DBPoolUtil object if org.quickserver.util.xmlreader.DBObjectPoolConfig was set. DBPoolUtil object if object could be loaded, else will return null
since:
   1.3



getDefaultDataMode
public DataMode getDefaultDataMode(DataType dataType)(Code)
Returns the default DataMode for the ClientHandler
since:
   1.4.6



getLastStartTime
public java.util.Date getLastStartTime()(Code)
Returns the date/time when the server was last started. last started time. Will be null if never started.
since:
   1.4.5



getMaxAuthTry
public int getMaxAuthTry()(Code)
Returns max allowed login attempts. Default is 5.
since:
   1.2
See Also:   QuickServer.setMaxAuthTry



getMaxAuthTryMsg
public String getMaxAuthTryMsg()(Code)
Returns message to be displayed when maximum allowed login attempts has reached.
See Also:   QuickServer.getMaxAuthTryMsg



getMaxConnection
public long getMaxConnection()(Code)
Returns the maximum number of client connection allowed.
since:
   1.1
See Also:   QuickServer.setMaxConnection



getMaxConnectionMsg
public String getMaxConnectionMsg()(Code)
Returns the message to be sent to any new client connected after maximum client connection has reached.
since:
   1.1
See Also:   QuickServer.setMaxConnectionMsg



getName
public String getName()(Code)
Returns the name of the QuickServer. Default is 'QuickServer'.
See Also:   QuickServer.setName



getNewLine
public static String getNewLine()(Code)
Returns the new line string used by QuickServer.
since:
   1.2



getPort
public int getPort()(Code)
Returns the port for the QuickServer.
See Also:   QuickServer.setPort



getQSAdminServer
public QSAdminServer getQSAdminServer()(Code)
Returns QSAdminServer associated with this QuickServer
since:
   1.1



getQSAdminServerAuthenticator
public String getQSAdminServerAuthenticator()(Code)
Returns the Authenticator or ClientAuthenticationHandler class of QSAdminServer that handles the authentication of a client.
since:
   1.2



getQSAdminServerPort
public int getQSAdminServerPort()(Code)
Returns the port to run QSAdminServer on.
since:
   1.2



getSSLContext
public SSLContext getSSLContext() throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Returns the SSLContext from Secure configuring.
See Also:   QuickServer.loadSSLContext
since:
   1.4.0



getSSLContext
public SSLContext getSSLContext(String protocol) throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Returns the SSLContext object that implements the specified secure socket protocol from Secure configuring.
See Also:   QuickServer.loadSSLContext
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



getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory() throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Returns a SSLSocketFactory object to be used for creating SSLSockets. Secure socket protocol will be picked from the Secure configuring.
See Also:   QuickServer.setSecure
throws:
  IOException -
throws:
  NoSuchAlgorithmException -
throws:
  KeyManagementException -
since:
   1.4.0



getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory(String protocol) throws IOException, NoSuchAlgorithmException, KeyManagementException(Code)
Returns a SSLSocketFactory object to be used for creating SSLSockets.
See Also:   QuickServer.setSecure
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



getSecure
public Secure getSecure()(Code)
Returns Secure setting for QuickServer
since:
   1.4.0



getSecurityManager
public SecurityManager getSecurityManager() throws AppException(Code)



getSecurityManagerClass
public String getSecurityManagerClass()(Code)
Returns the SecurityManager class
See Also:   QuickServer.setSecurityManagerClass
since:
   1.3.3



getSelector
public Selector getSelector()(Code)
Returns the Selector (NIO),if any.
since:
   1.4.5



getServerBanner
public String getServerBanner()(Code)
Returns the Server Banner of the QuickServer
See Also:   QuickServer.setServerBanner



getServerHooks
public ServerHooks getServerHooks()(Code)
Returns ServerHooks if present else null.
since:
   1.3.3



getServiceError
public Throwable getServiceError()(Code)
Returns service error if any.
since:
   1.4.7



getServiceState
public int getServiceState()(Code)
Returns the state of the process As any constant of Service interface.
since:
   1.2



getStoreObjects
public Object[] getStoreObjects()(Code)
Returns store of objects from QuickServer, if nothing was set will return null.
See Also:   QuickServer.setStoreObjects
since:
   1.1



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



getTimeoutMsg
public String getTimeoutMsg()(Code)
Returns timeout message.
See Also:   QuickServer.setTimeoutMsg



getVersion
final public static String getVersion()(Code)
Returns the version of the library.



getVersionNo
final public static float getVersionNo()(Code)
Returns the numerical version of the library.
since:
   1.2



getVersionNo
final public static float getVersionNo(String ver)(Code)
Returns the numerical version of the library.
since:
   1.4.5



info
public String info()(Code)
Information about the service.
since:
   1.2



initAllPools
public void initAllPools() throws Exception(Code)
Initialise all Object and Thread pools.
since:
   1.3



initServer
public synchronized void initServer(Object param) throws AppException(Code)
Initialise and create the server.
Parameters:
  param - of the xml configuration file.
exception:
  AppException - if QuickServerConfig creation failed from the xml config file.
since:
   1.4.7



initServer
public synchronized void initServer(QuickServerConfig qsConfig) throws AppException(Code)
Initialise and create the service.
Parameters:
  qsConfig - QuickServerConfig object.
since:
   1.4.7



initService
public synchronized boolean initService(Object param)(Code)
Initialise and create the service.
Parameters:
  param - of the xml configuration file.
since:
   1.2



initService
public synchronized boolean initService(QuickServerConfig qsConfig)(Code)
Initialise and create the service.
Parameters:
  qsConfig - QuickServerConfig object.
since:
   1.4.6



isClosed
public boolean isClosed()(Code)
Returns the closed state of the QuickServer Socket.
since:
   1.1



isRunningSecure
public boolean isRunningSecure()(Code)

Returns if the server is running in Secure mode [SSL or TLS].


since:
   1.4.0



load
public static QuickServer load(String xml) throws AppException(Code)
Loads the server from the xml file name passed.
since:
   1.4.7



loadBusinessLogic
protected void loadBusinessLogic() throws Exception(Code)
Loads all the Business Logic class
since:
   1.4.6



loadSSLContext
public void loadSSLContext() throws IOException(Code)
Loads the SSLContext from Secure configuring if set.
See Also:   QuickServer.setSecure
since:
   1.4.0



main
public static void main(String args)(Code)
Usage: QuickServer [-options]
Where options include:
-about Opens About Dialogbox
-load [options] Loads the server from xml file. where options include: -fullXML2File



makeServerSocket
protected void makeServerSocket() throws BindException, IOException(Code)
Returns a ServerSocket object to be used for listening.
since:
   1.4.0



nextClientIsTrusted
public void nextClientIsTrusted()(Code)
Sets next client has a trusted client.

This will skip any authentication and will not set any timout.


since:
   1.3.2



registerChannel
public boolean registerChannel(SocketChannel channel, int ops, Object att) throws IOException, ClosedChannelException(Code)
Register the given channel for the given operations. This adds the request to a list and will be processed after selector select wakes up. boolean flag to indicate if new entry was added to the list to register.
since:
   1.4.5



restartServer
public void restartServer() throws AppException(Code)
Restarts the QuickServer.
exception:
  org.quickserver.net.AppException - if could not stop server or if it could not start the server.
since:
   1.2



resumeService
public boolean resumeService()(Code)
Resume the service. true if service was resumed from suspended state.
since:
   1.2



run
public void run()(Code)



setAccessConstraintConfig
public void setAccessConstraintConfig(AccessConstraintConfig accessConstraintConfig)(Code)
Sets the Access constraints
since:
   1.3.3



setAppLogger
public void setAppLogger(Logger appLogger)(Code)
Sets the application logger associated with QuickServer
since:
   1.2



setApplicationJarPath
protected void setApplicationJarPath(String applicationJarPath)(Code)
Sets the applications jar/s path. This can be either absolute or relative(to config file) path to the jar file or the directory containing the jars needed by the application.
See Also:   QuickServer.getApplicationJarPath
since:
   1.3.3



setAuthenticator
public void setAuthenticator(String authenticator)(Code)
Sets the Authenticator class that handles the authentication of a client.
Parameters:
  authenticator - the fully qualified name of the class that implements Authenticator or ClientAuthenticationHandler.
See Also:   QuickServer.getAuthenticator
since:
   1.3



setBasicConfig
public void setBasicConfig(BasicServerConfig basicConfig) throws Exception(Code)
Sets the basic confiuration of the QuickServer.
since:
   1.4.0



setBindAddr
public void setBindAddr(String bindAddr) throws UnknownHostException(Code)
Sets the Ip address to bind to.
Parameters:
  bindAddr - argument can be used on a multi-homed host for a QuickServer that will only accept connect requests to one of its addresses. If not set, it will default accepting connections on any/all local addresses.
exception:
  java.net.UnknownHostException - if no IP address for the host could be found
since:
   1.1
See Also:   QuickServer.getBindAddr



setClassLoader
public void setClassLoader(ClassLoader classLoader)(Code)
Sets the classloader to be used to load the dynamicaly resolved classes
since:
   1.3.3



setClientAuthenticationHandler
public void setClientAuthenticationHandler(String authenticator)(Code)
Sets the ClientAuthenticationHandler class that handles the authentication of a client.
Parameters:
  authenticator - the fully qualified name of the class that implements ClientAuthenticationHandler.
See Also:   QuickServer.getClientAuthenticationHandler
since:
   1.4.6



setClientBinaryHandler
public void setClientBinaryHandler(String handler)(Code)
Sets the ClientBinaryHandler class that interacts with client sockets to handle binary data.
Parameters:
  handler - object the fully qualified name of the class that implements ClientBinaryHandler
See Also:   QuickServer.getClientBinaryHandler
since:
   1.4



setClientCommandHandler
public void setClientCommandHandler(String handler)(Code)
Sets the ClientCommandHandler class that interacts with client sockets.
Parameters:
  handler - the fully qualified name of the class that implements ClientCommandHandler
See Also:   QuickServer.getClientCommandHandler



setClientData
public void setClientData(String data)(Code)
Sets the ClientData class that carries client data.
Parameters:
  data - the fully qualified name of the class that extends ClientData.
See Also:   QuickServer.getClientData



setClientEventHandler
public void setClientEventHandler(String handler)(Code)
Sets the ClientEventHandler class that gets notified of client events.
Parameters:
  handler - the fully qualified name of the class that implements ClientEventHandler
See Also:   QuickServer.getClientEventHandler
since:
   1.4.6



setClientExtendedEventHandler
public void setClientExtendedEventHandler(String handler)(Code)
Sets the ClientExtendedEventHandler class that gets notified of extended client events.
Parameters:
  handler - the fully qualified name of the class that implements ClientExtendedEventHandler
See Also:   QuickServer.getClientExtendedEventHandler
since:
   1.4.6



setClientObjectHandler
public void setClientObjectHandler(String handler)(Code)
Sets the ClientObjectHandler class that interacts with client sockets to handle java objects.
Parameters:
  handler - object the fully qualified name of the class that implements ClientObjectHandler
See Also:   QuickServer.getClientObjectHandler
since:
   1.2



setClientWriteHandler
public void setClientWriteHandler(String handler)(Code)
Sets the ClientWriteHandler class that interacts with client sockets to handle data write (only used in non-blocking mode).
Parameters:
  handler - object the fully qualified name of the class that implements ClientWriteHandler
See Also:   QuickServer.getClientWriteHandler
since:
   1.4.5



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



setConfig
public void setConfig(QuickServerConfig config)(Code)
Sets the confiuration of the QuickServer.
since:
   1.3



setConsoleLoggingFormatter
public void setConsoleLoggingFormatter(String formatter) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code)
Sets the console log handler formatter.
Parameters:
  formatter - fully qualified name of the class that implements java.util.logging.Formatter
since:
   1.2



setConsoleLoggingLevel
public void setConsoleLoggingLevel(Level level)(Code)
Sets the console log handler level.
since:
   1.2



setConsoleLoggingToMicro
public void setConsoleLoggingToMicro()(Code)
Sets the console log handler formater to org.quickserver.util.logging.MicroFormatter
since:
   1.2



setConsoleLoggingToMini
public void setConsoleLoggingToMini()(Code)
Sets the console log handler formater to org.quickserver.util.logging.MiniFormatter
since:
   1.2



setDBObjectPoolConfig
public void setDBObjectPoolConfig(DBObjectPoolConfig dBObjectPoolConfig)(Code)
Sets org.quickserver.util.xmlreader.DBObjectPoolConfig
since:
   1.3



setDebugNonBlockingMode
public static void setDebugNonBlockingMode(boolean flag)(Code)
Sets the debug flag to ByteBufferOutputStream and ByteBufferInputStream class that are used in non-blcking mode
since:
   1.4.5



setDefaultDataMode
public void setDefaultDataMode(DataMode dataMode, DataType dataType) throws IOException(Code)
Sets the default DataMode for the ClientHandler
since:
   1.4.6



setDefaultDataMode
public void setDefaultDataMode(DefaultDataMode defaultDataMode) throws IOException(Code)
Sets the default DataMode for the ClientHandler
since:
   1.4.6



setLoggingLevel
public void setLoggingLevel(Level level)(Code)
Sets the level for all log handlers.
since:
   1.3.1



setMaxAuthTry
public void setMaxAuthTry(int authTry)(Code)
Sets max allowed login attempts.
since:
   1.2
See Also:   QuickServer.getMaxAuthTry



setMaxAuthTryMsg
public void setMaxAuthTryMsg(String msg)(Code)
Sets message to be displayed when maximum allowed login attempts has reached. Default is : -ERR Max Auth Try Reached
See Also:   QuickServer.getMaxAuthTryMsg



setMaxConnection
public void setMaxConnection(long maxConnection)(Code)
Sets the maximum number of client connection allowed.
since:
   1.1
See Also:   QuickServer.getMaxConnection



setMaxConnectionMsg
public void setMaxConnectionMsg(String maxConnectionMsg)(Code)
Sets the message to be sent to any new client connected after maximum client connection has reached. Default is : -ERR Server Busy. Max Connection Reached
since:
   1.1
See Also:   QuickServer.getMaxConnectionMsg



setName
public void setName(String name)(Code)
Sets the name for the QuickServer
Parameters:
  name - for the QuickServer
See Also:   QuickServer.getName



setPort
public void setPort(int port)(Code)
Sets the port for the QuickServer to listen on. If not set, it will run on Port 9876
Parameters:
  port - to listen on.
See Also:   QuickServer.getPort



setQSAdminServer
public void setQSAdminServer(QSAdminServer adminServer)(Code)
Sets QSAdminServer associated with this QuickServer
since:
   1.3.3



setQSAdminServerAuthenticator
public void setQSAdminServerAuthenticator(String authenticator)(Code)
Set the ClientAuthenticationHandler class of QSAdminServer that handles the authentication of a client.
since:
   1.2



setQSAdminServerPort
public void setQSAdminServerPort(int port)(Code)
Set the port to run QSAdminServer on.
since:
   1.2



setRunningSecure
public void setRunningSecure(boolean runningSecure)(Code)

Sets the server mode if its running in Secure mode [SSL or TLS].


since:
   1.4.0



setSecure
public void setSecure(Secure secure)(Code)
Sets the Secure setting for QuickServer
since:
   1.4.0



setSecurityManagerClass
public void setSecurityManagerClass(String securityManagerClass)(Code)
Sets the SecurityManager class
Parameters:
  securityManagerClass - the fully qualified name of the class that extends java.lang.SecurityManager.
See Also:   QuickServer.getSecurityManagerClass
since:
   1.3.3



setSelector
public void setSelector(Selector selector)(Code)
Sets the Selector (NIO).
since:
   1.4.5



setServerBanner
public void setServerBanner(String banner)(Code)
Sets the serverBanner for the QuickServer that will be displayed on the standard output [console] when server starts.
 
To set welcome message to your client ClientEventHandler.gotConnected
Parameters:
  banner - for the QuickServer
See Also:   QuickServer.getServerBanner



setServerHooks
public void setServerHooks(ServerHooks serverHooks)(Code)
Sets the ServerHooks
since:
   1.3.3



setServiceState
public void setServiceState(int state)(Code)
Sets the state of the process As any constant of Service interface.
since:
   1.2



setStoreObjects
public void setStoreObjects(Object[] storeObjects)(Code)
Sets the store of objects to QuickServer, it is an array of objects that main program or the class that created QuickServer passes to the QuickServer.
Parameters:
  storeObjects - array of objects
See Also:   QuickServer.getStoreObjects
since:
   1.1



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



setTimeoutMsg
public void setTimeoutMsg(String msg)(Code)
Sets timeout message. Default is : -ERR Timeout
See Also:   QuickServer.getTimeoutMsg



startQSAdminServer
public void startQSAdminServer(int port, String authenticator) throws AppException(Code)
Starts QSAdminServer for this QuickServer.
See Also:   org.quickserver.net.qsadmin.QSAdminServer
Parameters:
  authenticator - sets the ClientAuthenticationHandler class that handles the authentication of a client, if null uses org.quickserver.net.qsadmin.Authenticator.
Parameters:
  port - to run QSAdminServer on
exception:
  org.quickserver.net.AppException - if Server already running or if it could not load the classes[ClientCommandHandler, ClientAuthenticationHandler, ClientData].
since:
   1.1



startQSAdminServer
public void startQSAdminServer() throws AppException(Code)
Starts QSAdminServer for this QuickServer.
See Also:   org.quickserver.net.qsadmin.QSAdminServer
since:
   1.2



startServer
public void startServer() throws AppException(Code)
Starts the QuickServer.
exception:
  org.quickserver.net.AppException - if Server already running or if it could not load the classes[ClientCommandHandler, ClientAuthenticationHandler, ClientData].
See Also:   QuickServer.startService



startService
public boolean startService()(Code)
Start the service. true if serivce was stopped from Running state.
since:
   1.2



stopServer
public void stopServer() throws AppException(Code)
Stops the QuickServer.
exception:
  org.quickserver.net.AppException - if could not stop server
since:
   1.1
See Also:   QuickServer.stopService



stopService
public boolean stopService()(Code)
Stop the service. true if serivce was stopped from Running state.
since:
   1.2



suspendService
public boolean suspendService()(Code)
Suspends the service. true if service was suspended from resumed state.
since:
   1.2



toString
public String toString()(Code)
Returns the Server name : port of the QuickServer.



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.