com.cloudgarden.audio
Class ClientEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.cloudgarden.audio.ClientEvent
All Implemented Interfaces:
java.io.Serializable

public class ClientEvent
extends java.util.EventObject

Class to hold information when a ClientListener signals an event.

See Also:
Serialized Form

Field Summary
static int BYTES_TRANSFERRED
           
static int CLIENT_ADDED
           
static int CLIENT_REMOVED
           
static int FROM_CLIENT
           
static int TO_CLIENT
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ClientEvent(java.lang.Object source, java.lang.String clientName, java.lang.Thread thread, int id, byte[] data, int offset, int length, int direction)
          Creates a new instance of ClientEvent
 
Method Summary
 java.lang.String getClientName()
          Returns ip address of client
 byte[] getData()
          Returns reference to data being transferred
 int getDirection()
          Returns direction of data transfer - either TO_CLIENT or FROM_CLIENT
 int getId()
          Returns the id of this event - BYTES_TRANSFERRED ,CLIENT_ADDED or CLIENT_REMOVED.
 int getLength()
          Returns length (in bytes) of data
 int getOffset()
          Returns offset of start of valid data
 java.lang.Thread getThread()
          Returns the Thread handling this client
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BYTES_TRANSFERRED

public static final int BYTES_TRANSFERRED

CLIENT_ADDED

public static final int CLIENT_ADDED

CLIENT_REMOVED

public static final int CLIENT_REMOVED

TO_CLIENT

public static final int TO_CLIENT

FROM_CLIENT

public static final int FROM_CLIENT
Constructor Detail

ClientEvent

public ClientEvent(java.lang.Object source,
                   java.lang.String clientName,
                   java.lang.Thread thread,
                   int id,
                   byte[] data,
                   int offset,
                   int length,
                   int direction)
Creates a new instance of ClientEvent
Method Detail

getLength

public int getLength()
Returns length (in bytes) of data

getDirection

public int getDirection()
Returns direction of data transfer - either TO_CLIENT or FROM_CLIENT

getOffset

public int getOffset()
Returns offset of start of valid data

getClientName

public java.lang.String getClientName()
Returns ip address of client

getData

public byte[] getData()
Returns reference to data being transferred

getThread

public java.lang.Thread getThread()
Returns the Thread handling this client

getId

public int getId()
Returns the id of this event - BYTES_TRANSFERRED ,CLIENT_ADDED or CLIENT_REMOVED.