com.myjavaworld.ftp
Class DataConnectionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.myjavaworld.ftp.DataConnectionEvent
All Implemented Interfaces:
Serializable

public class DataConnectionEvent
extends EventObject

An event generated by data connections to notify the status of data transfer.

Version:
2.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com
See Also:
Serialized Form

Field Summary
static int RECEIVE
          A constant to indicate that data is being received from the remote host.
static int SEND
          A constant to indicate that data is being sent to the remote host.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DataConnectionEvent(Object source, int id, long bytesTransferred)
          Constructs a DataConnectionEvent.
 
Method Summary
 long getBytesTransferred()
          Returns the number of bytes transferred.
 int getId()
          Returns the ID ot type of this event.
 String toString()
          String rpresentation of this event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEND

public static final int SEND
A constant to indicate that data is being sent to the remote host.

See Also:
Constant Field Values

RECEIVE

public static final int RECEIVE
A constant to indicate that data is being received from the remote host.

See Also:
Constant Field Values
Constructor Detail

DataConnectionEvent

public DataConnectionEvent(Object source,
                           int id,
                           long bytesTransferred)
Constructs a DataConnectionEvent.

Parameters:
source - The object that generated this event.
id - Type of this event. Possible types are -
  1. DataConnectionEvent.SEND
  2. DataConnectionEvent.RECEIVE
bytesTransferred - Number of bytes transferred so far.
Method Detail

getId

public int getId()
Returns the ID ot type of this event.

Returns:
Type of this event.

getBytesTransferred

public long getBytesTransferred()
Returns the number of bytes transferred.

Returns:
number of bytes transferred.

toString

public String toString()
String rpresentation of this event.

Overrides:
toString in class EventObject
Returns:
String representation of this event.


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.