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


java.lang.Object
   java.lang.Thread
      server.LlamaChatServer

LlamaChatServer
final public class LlamaChatServer extends Thread (Code)
The main class for the LlamaChat server
author:
   Joseph Monti countjoe@users.sourceforge.net
version:
   0.8

Inner Class :public class ShutdownThread extends Thread

Field Summary
public static  intPORT
    
public static  StringadminPass
    
public static  booleanallowAdmin
    
public static  ChannelManagerchannels
    
public static  StringchatLogPath
    
public static  HashtableconnectedUsers
    
public static  LinkedListconnectingUsers
    
public static  booleanrunning
    
public static  StringserverConfigFile
    
public static  StringsysLogFile
    
public static  StringuserExportFile
    
public static  StringwelcomeMessage
    

Constructor Summary
 LlamaChatServer()
    

Method Summary
public synchronized  voidbroadcast(SocketData sd, String from)
    
public synchronized  voidbroadcast(SocketData sd, String from, String c)
    
public synchronized  booleanchannelExists(String name)
    
public synchronized  booleanchatLog(ClientConnection cc, boolean start)
     manages the chat log

do something about channels
Parameters:
  cc - the client attempting to change the log status.
public synchronized  voidchatLog(ClientConnection cc, String message)
    
public synchronized  voiddelete(ClientConnection cc)
    
public synchronized  booleanfinalizeUser(String uname, ClientConnection cc)
    
public static  StringgetTimestamp()
    
public synchronized  voidkill(ClientConnection cc)
    
public  voidlog(ClientConnection cc, String s)
    
public static  voidmain(String args)
    
public synchronized  StringnewChannel(String name, String pass, ClientConnection cc)
    
public synchronized  voidnewUser(SSLSocket s)
     called when a new user has connected.
public  voidrun()
    
public synchronized  booleansendTo(SocketData sd, String to)
    
public synchronized  voidsendUserList(ClientConnection cc)
    
public static synchronized  booleanupdateUserExport()
    

Field Detail
PORT
public static int PORT(Code)



adminPass
public static String adminPass(Code)



allowAdmin
public static boolean allowAdmin(Code)



channels
public static ChannelManager channels(Code)



chatLogPath
public static String chatLogPath(Code)



connectedUsers
public static Hashtable connectedUsers(Code)



connectingUsers
public static LinkedList connectingUsers(Code)



running
public static boolean running(Code)



serverConfigFile
public static String serverConfigFile(Code)



sysLogFile
public static String sysLogFile(Code)



userExportFile
public static String userExportFile(Code)



welcomeMessage
public static String welcomeMessage(Code)




Constructor Detail
LlamaChatServer
LlamaChatServer()(Code)
a useless constructor




Method Detail
broadcast
public synchronized void broadcast(SocketData sd, String from)(Code)
broadcases a message to all connected user except from
Parameters:
  sd - the SocketData object to be sent
Parameters:
  from - the user to be avoided when sending data(usually the user sending the data)



broadcast
public synchronized void broadcast(SocketData sd, String from, String c)(Code)
broadcases a message to all connected user except from and is a member of c
Parameters:
  sd - the SocketData object to be sent
Parameters:
  from - the user to be avoided when sending data(usually the user sending the data)
Parameters:
  c - the channel the user is connected to



channelExists
public synchronized boolean channelExists(String name)(Code)
checks to see if the specified channel exists
Parameters:
  name - the name of the channel true if name exists exists



chatLog
public synchronized boolean chatLog(ClientConnection cc, boolean start)(Code)
manages the chat log

do something about channels
Parameters:
  cc - the client attempting to change the log status. used todetermine what channel to work with, if null close all
Parameters:
  start - enables chat logging when true, stops otherwise true on succes



chatLog
public synchronized void chatLog(ClientConnection cc, String message)(Code)
logs the specified chat message
Parameters:
  cc - the client chatting
Parameters:
  message - the message to be sent



delete
public synchronized void delete(ClientConnection cc)(Code)
sends a SD_UserDel object to all users announcing that un has left the building
Parameters:
  cc - the user leaving



finalizeUser
public synchronized boolean finalizeUser(String uname, ClientConnection cc)(Code)
finalizes the connection to the client by setting its username and updating all lists of users by sending the new user to all the connected users and sending the user list to the new user, also checks the validity of the username
Parameters:
  uname - the desired user name for the new user
Parameters:
  cc - the object representing the connecting user true on success, false otherwise



getTimestamp
public static String getTimestamp()(Code)
gets the current date/time of the form MM/DD/YY HH:MM:SS used for loggin purposes a string specifying the current date/time



kill
public synchronized void kill(ClientConnection cc)(Code)
Removes a user from the list of connected users and calls delete
Parameters:
  cc - the associated ClientConnection.
See Also:   LlamaChatServer.delete(ClientConnection cc)



log
public void log(ClientConnection cc, String s)(Code)
a public method used by clients to send log data
Parameters:
  cc - the client sending the log, used to identifythe logger in the log
Parameters:
  s - the string to be logged



main
public static void main(String args)(Code)
main method for class; initializes lists and system log file
Parameters:
  args - the command line arguments



newChannel
public synchronized String newChannel(String name, String pass, ClientConnection cc)(Code)
creates a new channel, assuming the channel can be created
Parameters:
  name - the name of the channel to be craeted
Parameters:
  pass - the password for the channel
Parameters:
  cc - the client requesting the channel true if created



newUser
public synchronized void newUser(SSLSocket s)(Code)
called when a new user has connected.
Parameters:
  s - the secure socket that the user connected on



run
public void run()(Code)
the main loop to recieving incoming clients listens on a secure server socket creates a shutdown hook to catch a server kill and exit gracefully



sendTo
public synchronized boolean sendTo(SocketData sd, String to)(Code)
sends the specified SocketData to the client, to
Parameters:
  sd - the SocketData object to be sent
Parameters:
  to - the user to be sent the data status of the sendTo



sendUserList
public synchronized void sendUserList(ClientConnection cc)(Code)
sends the current user listing to the specified user
Parameters:
  cc - the user requesting the list



updateUserExport
public static synchronized boolean updateUserExport()(Code)
allows for the user listing (newline separated) to be exported to the filesystem, should be called whenever users are added or removed or renamed true on succes, false otherwise



Fields inherited from java.lang.Thread
final public static int MAX_PRIORITY(Code)(Java Doc)
final public static int MIN_PRIORITY(Code)(Java Doc)
final public static int NORM_PRIORITY(Code)(Java Doc)

Methods inherited from java.lang.Thread
public static int activeCount()(Code)(Java Doc)
final public void checkAccess()(Code)(Java Doc)
native public int countStackFrames()(Code)(Java Doc)
native public static Thread currentThread()(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
public static void dumpStack()(Code)(Java Doc)
public static int enumerate(Thread tarray)(Code)(Java Doc)
public static Map<Thread, StackTraceElement[]> getAllStackTraces()(Code)(Java Doc)
public ClassLoader getContextClassLoader()(Code)(Java Doc)
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler()(Code)(Java Doc)
public long getId()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public int getPriority()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public State getState()(Code)(Java Doc)
final public ThreadGroup getThreadGroup()(Code)(Java Doc)
public UncaughtExceptionHandler getUncaughtExceptionHandler()(Code)(Java Doc)
native public static boolean holdsLock(Object obj)(Code)(Java Doc)
public void interrupt()(Code)(Java Doc)
public static boolean interrupted()(Code)(Java Doc)
final native public boolean isAlive()(Code)(Java Doc)
final public boolean isDaemon()(Code)(Java Doc)
public boolean isInterrupted()(Code)(Java Doc)
final public synchronized void join(long millis) throws InterruptedException(Code)(Java Doc)
final public synchronized void join(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void join() throws InterruptedException(Code)(Java Doc)
final public void resume()(Code)(Java Doc)
public void run()(Code)(Java Doc)
public void setContextClassLoader(ClassLoader cl)(Code)(Java Doc)
final public void setDaemon(boolean on)(Code)(Java Doc)
public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
final public void setName(String name)(Code)(Java Doc)
final public void setPriority(int newPriority)(Code)(Java Doc)
public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
native public static void sleep(long millis) throws InterruptedException(Code)(Java Doc)
public static void sleep(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
public synchronized void start()(Code)(Java Doc)
final public void stop()(Code)(Java Doc)
final public synchronized void stop(Throwable obj)(Code)(Java Doc)
final public void suspend()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
native public static void yield()(Code)(Java Doc)

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.