Java Doc for Server.java in  » Chat » freecs » freecs » 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 » Chat » freecs » freecs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   freecs.Server

Server
public class Server implements IReloadable(Code)

author:
   Manfred Andres


Field Summary
public  booleanALLOW_EXTERNALDEBUG_TEMPLATESETUSE_HTTP11USE_IP_BANTHREAD_PER_READUSE_TOKENSTOREMD5_PASSWORDSUSE_MESSAGE_RENDER_CACHEUSE_TRAFFIC_MONITORUSE_CENTRAL_REQUESTQUEUESTRICT_HOST_BINDING
    
public static  StringBASE_PATH
    
public static  booleanDEBUG
    
public  StringDEFAULT_CHARSETCOOKIE_DOMAINSERVER_NAMETIMEZONEADMIN_HTTP_ALLOWEDADMIN_HTTP_USERNAMEADMIN_HTTP_PASSWORDADMIN_XMLRPC_ALLOWED
    
public  shortFN_DEFAULT_MODE_FALSE
    
public  shortFN_DEFAULT_MODE_TRUE
    
public  longKEEP_ALIVE_TIMEOUT
    
public static  String[]LOGFILE
     LOGGING (will be moved to an extra object...
public static  ShortLOG_MASK
    
final public static  shortLVL_HALT
    
final public static  shortLVL_MAJOR
    
final public static  shortLVL_MINOR
    
final public static  shortLVL_VERBOSE
    
final public static  shortLVL_VERY_VERBOSE
    
final public static  shortMSG_AUTH
    
final public static  shortMSG_CONFIG
    
final public static  shortMSG_ERROR
    
final public static  shortMSG_STATE
    
final public static  shortMSG_TRAFFIC
    
public  intREADER_MAX_QUEUEREADER_MAX_QUEUE_USAGEMAX_READERSMAX_BAN_DURATIONDEFAULT_BAN_DURATIONFLOOD_PROTECT_TOLERANCFLOOD_BAN_DURATIONREADBUFFER_SIZEMAX_USERSCOLOR_CHANGE_INTERVALMAX_USERNAME_LENGTHMAX_DIE_NUMBERMAX_DIE_EYESTCP_RECEIVE_BUFFER_WINDOWLOG_QUEUE_SIZEMAX_REQUESTS_PER_PROXY_IPMAX_REQUESTS_PER_IPMAX_SUUSERS_PER_STARTGROUPINITIAL_RESPONSE_QUEUEMAX_RESPONSE_QUEUEMAX_GROUPNAME_LENGTHMAX_GROUPTHEME_LENGTHADMIN_XMLRPC_PORTTOOL_PROTECT_COUNTERTOOL_PROTECT_TOLERANCTOOL_BAN_DURATIONTOOL_PROTECT_MINMILLSTOOL_PROTECT_MINCOUNTERJOIN_PUNISHED_COUNTER
    
final public static  intREQUEST_TYPE_HTTP
    
public  longTOUCH_USER_DELAYREADER_MAX_IDLETIMEFILE_CHECK_INTERVALFLOOD_PROTECT_MILLISUSER_TIMEOUTUSER_AWAY_TIMEOUTUSER_REMOVE_SCHEDULE_TIMEHOST_BAN_DURATIONVIP_TIMEOUTREADER_TIMEOUTLOGIN_TIMEOUT
    
public static  booleanTRACE_CREATE_AND_FINALIZE
    
public  StringUNAME_PREFIX_GODUNAME_PREFIX_GUESTUNAME_PREFIX_MODERATORUNAME_PREFIX_PUNISHEDUNAME_PREFIX_SUUNAME_PREFIX_VIPUNAME_SUFFIX_GODUNAME_SUFFIX_GUESTUNAME_SUFFIX_MODERATORUNAME_SUFFIX_PUNISHEDUNAME_SUFFIX_SUUNAME_SUFFIX_VIP
    
public  VectorallowedLoginHosts
    
public  AuthManagerauth
    
public static  Calendarcal
    
public  CharsetdefaultCs
    
public  CharsetEncoderdefaultCsEnc
    
public static  SimpleDateFormatdefaultDateFormat
    
public static  SimpleDateFormathourSDF
    
public  InetAddresslh
    
public static  SimpleDateFormatminuteSDF
    
public  Propertiesprops
    
public static  Serversrv
    
final public static  longstartupTime
    
public  TemplateManagertemplatemanager
    

Constructor Summary
public  Server()
    

Method Summary
public  voidaddToken(String token, String cookie)
    
public  voidbanHost(InetAddress ia, long millis, String msg)
    
public  voidbanUser(User u, String msgTemplate, String message, long millis, String bannedBy)
     Used to ban a user from the server.
public  voidbanUser(Vector v, String message, long millis, String bannedBy)
    
public  voidbanUser(User u, String message, long millis, String bannedBy)
    
public  voidchanged()
    
public static  booleancheckLogLvl(short type, short lvl)
    
public  voidcreated()
    
public static  voiddebug(Object o, String prefix, Throwable t, short type, short lvl)
    
public  booleanfilePresent()
    
public static  StringformatDefaultTimeStamp(long ts)
    
public  StringformatTimeStamp(long ts, String pattern)
    
public static  StringformatTimeStamp(long ts, SimpleDateFormat sdf)
    
public  BanObject[]getBanList()
    
public  FilegetConfigDir()
     returns the directory of the main server config.
public  FilegetFile()
    
public  StringgetFormatedTime(String pattern)
    
public  InetAddressgetLocalHost()
    
public  StringgetProperty(String key)
    
public  StringgetUrl()
    
public static  StringgetVersion()
    
public  voidinitServer()
    
public  booleanisAdminHost(InetAddress ia)
    
public  booleanisBanned(Object o)
    
public  booleanisRunning()
    
public  booleanisTokenValid(String token, String cookie)
    
public  longlastModified()
    
public static  voidlog(Object o, String msg, short type, short lvl)
    
public static  voidmain(String args)
     the main-method of server is responsible for: .) reading in the configuration .) initializing the server .) starting the neccessary threads If this task's are completed this main-thread will be used to remove bans which are not valid anymore
Parameters:
  args - the base-path may be given @commandline.
public  voidreadConfig()
    
public  booleanremoveBan(String key)
    
public  voidremoveToken(String cookie)
    
public  voidremoved()
    
public  voidstartShutdown()
    
public  StringtoString()
    

Field Detail
ALLOW_EXTERNALDEBUG_TEMPLATESETUSE_HTTP11USE_IP_BANTHREAD_PER_READUSE_TOKENSTOREMD5_PASSWORDSUSE_MESSAGE_RENDER_CACHEUSE_TRAFFIC_MONITORUSE_CENTRAL_REQUESTQUEUESTRICT_HOST_BINDING
public boolean ALLOW_EXTERNALDEBUG_TEMPLATESETUSE_HTTP11USE_IP_BANTHREAD_PER_READUSE_TOKENSTOREMD5_PASSWORDSUSE_MESSAGE_RENDER_CACHEUSE_TRAFFIC_MONITORUSE_CENTRAL_REQUESTQUEUESTRICT_HOST_BINDING(Code)



BASE_PATH
public static String BASE_PATH(Code)



DEBUG
public static boolean DEBUG(Code)



DEFAULT_CHARSETCOOKIE_DOMAINSERVER_NAMETIMEZONEADMIN_HTTP_ALLOWEDADMIN_HTTP_USERNAMEADMIN_HTTP_PASSWORDADMIN_XMLRPC_ALLOWED
public String DEFAULT_CHARSETCOOKIE_DOMAINSERVER_NAMETIMEZONEADMIN_HTTP_ALLOWEDADMIN_HTTP_USERNAMEADMIN_HTTP_PASSWORDADMIN_XMLRPC_ALLOWED(Code)



FN_DEFAULT_MODE_FALSE
public short FN_DEFAULT_MODE_FALSE(Code)



FN_DEFAULT_MODE_TRUE
public short FN_DEFAULT_MODE_TRUE(Code)



KEEP_ALIVE_TIMEOUT
public long KEEP_ALIVE_TIMEOUT(Code)



LOGFILE
public static String[] LOGFILE(Code)
LOGGING (will be moved to an extra object...



LOG_MASK
public static Short LOG_MASK(Code)



LVL_HALT
final public static short LVL_HALT(Code)



LVL_MAJOR
final public static short LVL_MAJOR(Code)



LVL_MINOR
final public static short LVL_MINOR(Code)



LVL_VERBOSE
final public static short LVL_VERBOSE(Code)



LVL_VERY_VERBOSE
final public static short LVL_VERY_VERBOSE(Code)



MSG_AUTH
final public static short MSG_AUTH(Code)



MSG_CONFIG
final public static short MSG_CONFIG(Code)



MSG_ERROR
final public static short MSG_ERROR(Code)



MSG_STATE
final public static short MSG_STATE(Code)



MSG_TRAFFIC
final public static short MSG_TRAFFIC(Code)



READER_MAX_QUEUEREADER_MAX_QUEUE_USAGEMAX_READERSMAX_BAN_DURATIONDEFAULT_BAN_DURATIONFLOOD_PROTECT_TOLERANCFLOOD_BAN_DURATIONREADBUFFER_SIZEMAX_USERSCOLOR_CHANGE_INTERVALMAX_USERNAME_LENGTHMAX_DIE_NUMBERMAX_DIE_EYESTCP_RECEIVE_BUFFER_WINDOWLOG_QUEUE_SIZEMAX_REQUESTS_PER_PROXY_IPMAX_REQUESTS_PER_IPMAX_SUUSERS_PER_STARTGROUPINITIAL_RESPONSE_QUEUEMAX_RESPONSE_QUEUEMAX_GROUPNAME_LENGTHMAX_GROUPTHEME_LENGTHADMIN_XMLRPC_PORTTOOL_PROTECT_COUNTERTOOL_PROTECT_TOLERANCTOOL_BAN_DURATIONTOOL_PROTECT_MINMILLSTOOL_PROTECT_MINCOUNTERJOIN_PUNISHED_COUNTER
public int READER_MAX_QUEUEREADER_MAX_QUEUE_USAGEMAX_READERSMAX_BAN_DURATIONDEFAULT_BAN_DURATIONFLOOD_PROTECT_TOLERANCFLOOD_BAN_DURATIONREADBUFFER_SIZEMAX_USERSCOLOR_CHANGE_INTERVALMAX_USERNAME_LENGTHMAX_DIE_NUMBERMAX_DIE_EYESTCP_RECEIVE_BUFFER_WINDOWLOG_QUEUE_SIZEMAX_REQUESTS_PER_PROXY_IPMAX_REQUESTS_PER_IPMAX_SUUSERS_PER_STARTGROUPINITIAL_RESPONSE_QUEUEMAX_RESPONSE_QUEUEMAX_GROUPNAME_LENGTHMAX_GROUPTHEME_LENGTHADMIN_XMLRPC_PORTTOOL_PROTECT_COUNTERTOOL_PROTECT_TOLERANCTOOL_BAN_DURATIONTOOL_PROTECT_MINMILLSTOOL_PROTECT_MINCOUNTERJOIN_PUNISHED_COUNTER(Code)



REQUEST_TYPE_HTTP
final public static int REQUEST_TYPE_HTTP(Code)



TOUCH_USER_DELAYREADER_MAX_IDLETIMEFILE_CHECK_INTERVALFLOOD_PROTECT_MILLISUSER_TIMEOUTUSER_AWAY_TIMEOUTUSER_REMOVE_SCHEDULE_TIMEHOST_BAN_DURATIONVIP_TIMEOUTREADER_TIMEOUTLOGIN_TIMEOUT
public long TOUCH_USER_DELAYREADER_MAX_IDLETIMEFILE_CHECK_INTERVALFLOOD_PROTECT_MILLISUSER_TIMEOUTUSER_AWAY_TIMEOUTUSER_REMOVE_SCHEDULE_TIMEHOST_BAN_DURATIONVIP_TIMEOUTREADER_TIMEOUTLOGIN_TIMEOUT(Code)



TRACE_CREATE_AND_FINALIZE
public static boolean TRACE_CREATE_AND_FINALIZE(Code)



UNAME_PREFIX_GODUNAME_PREFIX_GUESTUNAME_PREFIX_MODERATORUNAME_PREFIX_PUNISHEDUNAME_PREFIX_SUUNAME_PREFIX_VIPUNAME_SUFFIX_GODUNAME_SUFFIX_GUESTUNAME_SUFFIX_MODERATORUNAME_SUFFIX_PUNISHEDUNAME_SUFFIX_SUUNAME_SUFFIX_VIP
public String UNAME_PREFIX_GODUNAME_PREFIX_GUESTUNAME_PREFIX_MODERATORUNAME_PREFIX_PUNISHEDUNAME_PREFIX_SUUNAME_PREFIX_VIPUNAME_SUFFIX_GODUNAME_SUFFIX_GUESTUNAME_SUFFIX_MODERATORUNAME_SUFFIX_PUNISHEDUNAME_SUFFIX_SUUNAME_SUFFIX_VIP(Code)



allowedLoginHosts
public Vector allowedLoginHosts(Code)



auth
public AuthManager auth(Code)



cal
public static Calendar cal(Code)



defaultCs
public Charset defaultCs(Code)



defaultCsEnc
public CharsetEncoder defaultCsEnc(Code)



defaultDateFormat
public static SimpleDateFormat defaultDateFormat(Code)



hourSDF
public static SimpleDateFormat hourSDF(Code)



lh
public InetAddress lh(Code)



minuteSDF
public static SimpleDateFormat minuteSDF(Code)



props
public Properties props(Code)



srv
public static Server srv(Code)



startupTime
final public static long startupTime(Code)



templatemanager
public TemplateManager templatemanager(Code)




Constructor Detail
Server
public Server()(Code)




Method Detail
addToken
public void addToken(String token, String cookie)(Code)



banHost
public void banHost(InetAddress ia, long millis, String msg)(Code)



banUser
public void banUser(User u, String msgTemplate, String message, long millis, String bannedBy)(Code)
Used to ban a user from the server. Name and cookie are baned If the ban-duration is reached, this ban will be removed by the main-thread
Parameters:
  u - the user object
Parameters:
  msgTemplate - the message template to use for this ban (eg. user.flood)
Parameters:
  millis - how long this user will be banned



banUser
public void banUser(Vector v, String message, long millis, String bannedBy)(Code)
ban all users contained in given vector
Parameters:
  v - vector containing users
Parameters:
  message - reason for the kick
Parameters:
  millis - milliseconds this user will be banned
Parameters:
  bannedBy - name of the banner (may be Server in case of floodprotection



banUser
public void banUser(User u, String message, long millis, String bannedBy)(Code)



changed
public void changed()(Code)



checkLogLvl
public static boolean checkLogLvl(short type, short lvl)(Code)
allows to check for logability of a message in advance of performance critical messages



created
public void created()(Code)



debug
public static void debug(Object o, String prefix, Throwable t, short type, short lvl)(Code)
Debuging method configured by the loglevel mechanism
Parameters:
  prefix - to write before other stuff
Parameters:
  t - is the throwable to print the stacktrace from
Parameters:
  type - the type of message, konstants with MSG_ prefix are used here
Parameters:
  lvl - the level of atention to use here, konstants with LVL_ prefix are used here



filePresent
public boolean filePresent()(Code)



formatDefaultTimeStamp
public static String formatDefaultTimeStamp(long ts)(Code)



formatTimeStamp
public String formatTimeStamp(long ts, String pattern)(Code)



formatTimeStamp
public static String formatTimeStamp(long ts, SimpleDateFormat sdf)(Code)



getBanList
public BanObject[] getBanList()(Code)



getConfigDir
public File getConfigDir()(Code)
returns the directory of the main server config. other classes can fetch their configs from there (e.g. the Authenticator-classes.



getFile
public File getFile()(Code)



getFormatedTime
public String getFormatedTime(String pattern)(Code)



getLocalHost
public InetAddress getLocalHost()(Code)



getProperty
public String getProperty(String key)(Code)



getUrl
public String getUrl()(Code)
returns http-url to this server the http-url to this server



getVersion
public static String getVersion()(Code)
returns the version of this server version of server



initServer
public void initServer()(Code)



isAdminHost
public boolean isAdminHost(InetAddress ia)(Code)



isBanned
public boolean isBanned(Object o)(Code)
checks if this Object is associated to a ban
Parameters:
  o - the Object to check boolean true if this Object is associated with a ban



isRunning
public boolean isRunning()(Code)



isTokenValid
public boolean isTokenValid(String token, String cookie)(Code)



lastModified
public long lastModified()(Code)



log
public static void log(Object o, String msg, short type, short lvl)(Code)
Logging method configured by the loglevel mechanism
Parameters:
  msg - the message to log
Parameters:
  type - the type of message (MSG_ prefixed konstants are used here)
Parameters:
  lvl - the level of attention to use here (LVL_ prefixed konstants are used here)



main
public static void main(String args)(Code)
the main-method of server is responsible for: .) reading in the configuration .) initializing the server .) starting the neccessary threads If this task's are completed this main-thread will be used to remove bans which are not valid anymore
Parameters:
  args - the base-path may be given @commandline. Usage: freecs.Server -b=[path to mainfolder]



readConfig
public void readConfig()(Code)



removeBan
public boolean removeBan(String key)(Code)



removeToken
public void removeToken(String cookie)(Code)



removed
public void removed()(Code)



startShutdown
public void startShutdown()(Code)
QUERY-METHODS (used for retriefing values...)



toString
public String toString()(Code)



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.