bass.crawler
Class ClientRegistration

java.lang.Object
  extended by bass.crawler.ClientRegistration

public class ClientRegistration
extends java.lang.Object

ServerSide Object to register working clients, so we're able to restart timed out clients

Version:
0.1
Author:
Thomas Klein

Field Summary
private  java.util.LinkedList<DTO_Client> clients
           
private static int timeOutTime
           
 
Constructor Summary
ClientRegistration()
          generates an empty client registration object
 
Method Summary
 void addClient(java.lang.String clientIp)
          adds a client with the specified ip to the registry, lastSeen time is set to current time
 java.util.LinkedList<DTO_Client> getRegisteredClients()
           
 java.lang.String[] getTimedOutClients()
          generates a list of timed out clients
static int getTimeOutTime()
           
 void seenClient(java.lang.String clientIp)
          updates the lastSeen time of the specified client with the current time if client is not in list it will be automaticly added
 void unregisterClient(java.lang.String clientIP)
          removes a client from the registered clients list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeOutTime

private static final int timeOutTime
See Also:
Constant Field Values

clients

private java.util.LinkedList<DTO_Client> clients
Constructor Detail

ClientRegistration

public ClientRegistration()
generates an empty client registration object

Method Detail

addClient

public void addClient(java.lang.String clientIp)
adds a client with the specified ip to the registry, lastSeen time is set to current time

Parameters:
clientIp - the clients ip

seenClient

public void seenClient(java.lang.String clientIp)
updates the lastSeen time of the specified client with the current time if client is not in list it will be automaticly added

Parameters:
clientIp - the clients ip

getTimedOutClients

public java.lang.String[] getTimedOutClients()
generates a list of timed out clients

Returns:
string[] with the client ips

getRegisteredClients

public java.util.LinkedList<DTO_Client> getRegisteredClients()
Returns:
a LinkedList with the registered clients

unregisterClient

public void unregisterClient(java.lang.String clientIP)
removes a client from the registered clients list

Parameters:
clientIP - the clients ip

getTimeOutTime

public static int getTimeOutTime()
Returns:
the timeOutTime