roomba.roombanetwork.server
Class RNCDefinition

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

public class RNCDefinition
extends java.lang.Object

Contains info about an RNC connected and manages the disconnect timer

Author:
Drew Housten

Constructor Summary
RNCDefinition(int id, java.lang.String serviceName, java.lang.String serviceType)
          Constructor
 
Method Summary
 void disconnect()
          Forces a disconnect of the RNC
 int getID()
          Gets the ID of the RNC service
 int getLock()
          Gets the RNC ID that has a lock on this RNC.
 java.lang.String getServiceName()
          Gets the name of the RNC service
 java.lang.String getServiceType()
          Gets the type of the RNC service
 boolean isConnected()
          Indicates if the RNC is still connected to the RNS
 void lock(int lockingId)
          Specifies a lock on the RNC.
 void resetDisconnectTimer()
          Resets the disconnect timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RNCDefinition

public RNCDefinition(int id,
                     java.lang.String serviceName,
                     java.lang.String serviceType)
Constructor

Parameters:
id - The id of the RNC Service
serviceName - The name of the RNC Service
serviceType - The type of the RNC Service
Method Detail

getID

public int getID()
Gets the ID of the RNC service

Returns:
The ID of the RNC service

getServiceName

public java.lang.String getServiceName()
Gets the name of the RNC service

Returns:
The name of the RNC service

getServiceType

public java.lang.String getServiceType()
Gets the type of the RNC service

Returns:
The type of the RNC service

resetDisconnectTimer

public void resetDisconnectTimer()
Resets the disconnect timer. The disconnect timer will disconnect the RNC if the timer has not been reset for 30 seconds.


isConnected

public boolean isConnected()
Indicates if the RNC is still connected to the RNS

Returns:
true iff the RNC is still connected

disconnect

public void disconnect()
Forces a disconnect of the RNC


lock

public void lock(int lockingId)
Specifies a lock on the RNC. If there is no lock, a value of -1 should be passed to the method

Parameters:
lockingId - The RNC ID of the service that holds the lock on this RNC

getLock

public int getLock()
Gets the RNC ID that has a lock on this RNC. This will return -1 if there is no lock

Returns:
the ID of the RNC that has a lock on this RNC. -1 if there is no lock