roomba.roombanetwork.server
Class RNCTable

java.lang.Object
  extended by roomba.roombanetwork.server.RNCTable

public class RNCTable
extends java.lang.Object

Stores information about the stored RNCs

Author:
Drew Housten

Constructor Summary
RNCTable()
           
 
Method Summary
 void addRNCDefinition(RNCDefinition rncDefinition)
          Adds an RNC Definition to the table
 void disconnectRNC(int id)
          Disconnected an RNC that is contained in the table
 java.util.Vector getConnectedRNCs(int idFilter, java.lang.String serviceNameFilter, java.lang.String serviceTypeFilter)
          Returns a list of RNC Definitions from the table that match the specified filters
 java.util.Vector getDisconnectedRNCs()
          Returns a list of disconnected RNC Definitions from the table
 java.lang.String getServiceName(int id)
          Returns the name of an RNC stored in the table
 java.lang.String getServiceType(int id)
          Returns the type of an RNC stored in the table
 boolean isConnected(int id)
          Indicates if an RNC contained in the table is still connected to the RNS.
 void lock(int lockedId, int lockingId)
          Locks an RNC contained in the table.
 void removeRNCDefinition(int id)
          Removes an RNC Definition from the table
 void removeRNCDefinition(RNCDefinition rncDefinition)
          Removes an RNC Definition from the table
 void resetDisconnectTimer(int id)
          Resets the disconnect timer of an RNC that is contained in the table.
 boolean serviceSubscribed(int id, java.lang.String serviceName, java.lang.String serviceType)
          Checks if a service matches the filters contained in the RNC Definitions in this table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RNCTable

public RNCTable()
Method Detail

addRNCDefinition

public void addRNCDefinition(RNCDefinition rncDefinition)
Adds an RNC Definition to the table

Parameters:
rncDefinition - The RNC Definition to add

removeRNCDefinition

public void removeRNCDefinition(int id)
Removes an RNC Definition from the table

Parameters:
id - The ID of the RNC to remove

removeRNCDefinition

public void removeRNCDefinition(RNCDefinition rncDefinition)
Removes an RNC Definition from the table

Parameters:
rncDefinition - The RNC Definition to remove

disconnectRNC

public void disconnectRNC(int id)
Disconnected an RNC that is contained in the table

Parameters:
id - The ID of the RNC to disconnect

resetDisconnectTimer

public void resetDisconnectTimer(int id)
Resets the disconnect timer of an RNC that is contained in the table. The RNC will disconnect if the timer is not reset for 30 seconds

Parameters:
id - The ID of the RNC to reset

isConnected

public boolean isConnected(int id)
Indicates if an RNC contained in the table is still connected to the RNS.

Parameters:
id - The ID of the RNC to check the status of
Returns:
true iff The RNC is connected

lock

public void lock(int lockedId,
                 int lockingId)
Locks an RNC contained in the table.

Parameters:
lockedId - The ID of the RNC that is locked
lockingId - The ID of the RNC locking the locked RNC

getServiceName

public java.lang.String getServiceName(int id)
Returns the name of an RNC stored in the table

Parameters:
id - The ID of the RNC from which to get the name
Returns:
The name of the RNC if found, null otherwise

getServiceType

public java.lang.String getServiceType(int id)
Returns the type of an RNC stored in the table

Parameters:
id - The ID of the RNC from which to get the type
Returns:
The type of the RNC if found, null otherwise

getConnectedRNCs

public java.util.Vector getConnectedRNCs(int idFilter,
                                         java.lang.String serviceNameFilter,
                                         java.lang.String serviceTypeFilter)
Returns a list of RNC Definitions from the table that match the specified filters

Parameters:
idFilter - The ID to filter on. -1 if the ID Filter matches any ID
serviceNameFilter - The name to filter on. "*" if the name filter matches any name
serviceTypeFilter - The type to filter on. "*" if the type filter matches any type
Returns:
A Vector of RNCDefinition objects that match the specified filters

getDisconnectedRNCs

public java.util.Vector getDisconnectedRNCs()
Returns a list of disconnected RNC Definitions from the table

Returns:
A Vector of RNCDefinition objects that have been disconnected

serviceSubscribed

public boolean serviceSubscribed(int id,
                                 java.lang.String serviceName,
                                 java.lang.String serviceType)
Checks if a service matches the filters contained in the RNC Definitions in this table

Parameters:
id - The ID of the service to check
serviceName - The name of the service to check
serviceType - The type of the service to check
Returns:
true iff the service to check matches any of the filters contained in the table