rero.dcc
Class ProtocolDCC

java.lang.Object
  extended byrero.dcc.ProtocolDCC
Direct Known Subclasses:
Chat, Receive, Send

public abstract class ProtocolDCC
extends Object


Field Summary
static int DCC_CHAT
           
static int DCC_RECEIVE
           
static int DCC_SEND
           
static int DCC_TIMEOUT
           
protected  ProtocolDispatcher dispatcher
           
protected  HashMap eventData
           
protected  long idleTime
           
protected  String nickname
           
protected  Socket socket
           
protected  long startTime
           
protected  int state
           
static int STATE_CLOSED
           
static int STATE_OPEN
           
static int STATE_WAIT
           
 
Constructor Summary
ProtocolDCC()
           
 
Method Summary
 void announceFramework(ChatFramework f)
          tells the protocol implementation class that we are ready to rock and roll, Socket is assumed to be connected.
 void close()
           
abstract  void fireError(String text)
           
 long getIdleTime()
          returns the number of milliseconds since this chat has been active
 int getLocalPort()
           
 String getNickname()
          returns the nickname of who we are having a *chat* with
 int getPort()
           
 String getRemoteAddress()
           
 long getStartTime()
          return time that this chat started
 int getState()
           
 long getTotalTime()
          return total amount of time this chat has been active (in milliseconds)
abstract  int getTypeOfDCC()
          return the type of DCC based on a constant
 boolean isConnected()
          returns wether or not the socket is connected
abstract  void run()
           
 void setDCCSocket(Socket _socket)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DCC_SEND

public static final int DCC_SEND
See Also:
Constant Field Values

DCC_RECEIVE

public static final int DCC_RECEIVE
See Also:
Constant Field Values

DCC_CHAT

public static final int DCC_CHAT
See Also:
Constant Field Values

STATE_WAIT

public static final int STATE_WAIT
See Also:
Constant Field Values

STATE_OPEN

public static final int STATE_OPEN
See Also:
Constant Field Values

STATE_CLOSED

public static final int STATE_CLOSED
See Also:
Constant Field Values

DCC_TIMEOUT

public static final int DCC_TIMEOUT
See Also:
Constant Field Values

nickname

protected String nickname

socket

protected Socket socket

idleTime

protected long idleTime

startTime

protected long startTime

eventData

protected HashMap eventData

dispatcher

protected ProtocolDispatcher dispatcher

state

protected int state
Constructor Detail

ProtocolDCC

public ProtocolDCC()
Method Detail

getTypeOfDCC

public abstract int getTypeOfDCC()
return the type of DCC based on a constant


close

public void close()

getState

public int getState()

getRemoteAddress

public String getRemoteAddress()

getLocalPort

public int getLocalPort()

getPort

public int getPort()

announceFramework

public void announceFramework(ChatFramework f)
tells the protocol implementation class that we are ready to rock and roll, Socket is assumed to be connected.


run

public abstract void run()

isConnected

public boolean isConnected()
returns wether or not the socket is connected


getNickname

public String getNickname()
returns the nickname of who we are having a *chat* with


getIdleTime

public long getIdleTime()
returns the number of milliseconds since this chat has been active


getStartTime

public long getStartTime()
return time that this chat started


getTotalTime

public long getTotalTime()
return total amount of time this chat has been active (in milliseconds)


setDCCSocket

public void setDCCSocket(Socket _socket)

fireError

public abstract void fireError(String text)