public class ClientController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Connection |
connection |
private boolean |
keepRunning |
private java.util.HashMap<Group,GroupInformation> |
knownTeamMap |
private UserLogin |
loggedInUser |
private ClientView |
view |
Modifier | Constructor and Description |
---|---|
private |
ClientController(java.lang.String targetIp,
int portToListenTo)
delivers targetIp and portToListenTo to the constructor
builds a new array, LinkedList, connection, ioLoop and socket
starts the ioLoop and sends the client the information that the client started successfully.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
this method is for closing the process
|
Group |
getGroupByName(java.lang.String groupName) |
UserLogin |
getSendingUser() |
boolean |
keepRunning()
for (endless) loop (the code has to keep running..)
|
private void |
listenToMessages() |
static void |
main(java.lang.String[] args) |
void |
processMessage(Message message)
if the message is in an expected class, the message will be displayed
|
void |
sendMessage(Message m)
message will forwarded to the class ioLoop and handled there.
|
void |
shutDown(int status)
will exit the process (shut down the process: the keepRunning method will be quit)
|
private Connection connection
private ClientView view
private volatile boolean keepRunning
private volatile UserLogin loggedInUser
private volatile java.util.HashMap<Group,GroupInformation> knownTeamMap
private ClientController(java.lang.String targetIp, int portToListenTo)
targetIp
- portToListenTo
- public boolean keepRunning()
public Group getGroupByName(java.lang.String groupName)
public UserLogin getSendingUser()
public void close()
public void shutDown(int status)
status
- public void processMessage(Message message)
message
- public void sendMessage(Message m)
m
- private void listenToMessages()
public static void main(java.lang.String[] args)