| java.lang.Object java.lang.Thread server.LlamaChatServer
Inner Class :public class ShutdownThread extends Thread | |
Method Summary | |
public synchronized void | broadcast(SocketData sd, String from) | public synchronized void | broadcast(SocketData sd, String from, String c) | public synchronized boolean | channelExists(String name) | public synchronized boolean | chatLog(ClientConnection cc, boolean start) manages the chat log
do something about channels
Parameters: cc - the client attempting to change the log status. | public synchronized void | chatLog(ClientConnection cc, String message) | public synchronized void | delete(ClientConnection cc) | public synchronized boolean | finalizeUser(String uname, ClientConnection cc) | public static String | getTimestamp() | public synchronized void | kill(ClientConnection cc) | public void | log(ClientConnection cc, String s) | public static void | main(String args) | public synchronized String | newChannel(String name, String pass, ClientConnection cc) | public synchronized void | newUser(SSLSocket s) called when a new user has connected. | public void | run() | public synchronized boolean | sendTo(SocketData sd, String to) | public synchronized void | sendUserList(ClientConnection cc) | public static synchronized boolean | updateUserExport() |
PORT | public static int PORT(Code) | | |
allowAdmin | public static boolean allowAdmin(Code) | | |
running | public static boolean running(Code) | | |
LlamaChatServer | LlamaChatServer()(Code) | | a useless constructor
|
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 |
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 |
|
|