JML

net.sf.jml.impl
Class AbstractFileTransfer

java.lang.Object
  extended by net.sf.jml.impl.AbstractFileTransfer
All Implemented Interfaces:
MsnFileTransfer

public abstract class AbstractFileTransfer
extends Object
implements MsnFileTransfer

Implement MsnFileTransfer basic method.

Author:
Roger Chen

Constructor Summary
AbstractFileTransfer(MsnSwitchboard switchboard, MsnContact contact)
           
 
Method Summary
 MsnContact getContact()
          Get the contact who sent the file or received the file.
 File getFile()
          Get the transfer file.
 long getFileTotalSize()
          Get the total size of the file.
 MsnMessenger getMessenger()
          Get the MsnMessenger the controller belongs to.
 MsnFileTransferState getState()
          Get file transfer state.
 MsnSwitchboard getSwitchboard()
          Get the MsnSwitchboard the controller belongs to.
 long getTransferredSize()
          Get transferred size.
 boolean isReceiver()
          Is the MsnOwner receive file from others.
 void setFile(File file)
          Set the transfer file only if the transfer controller not started.
 void setFileTotalSize(long fileTotalSize)
           
protected  void setState(MsnFileTransferState state)
           
protected  void setTransferredSize(long transferredSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jml.MsnFileTransfer
cancel, isSender, isStarted, start
 

Constructor Detail

AbstractFileTransfer

public AbstractFileTransfer(MsnSwitchboard switchboard,
                            MsnContact contact)
Method Detail

getSwitchboard

public MsnSwitchboard getSwitchboard()
Description copied from interface: MsnFileTransfer
Get the MsnSwitchboard the controller belongs to.

Specified by:
getSwitchboard in interface MsnFileTransfer
Returns:
MsnSwitchboard

getMessenger

public MsnMessenger getMessenger()
Description copied from interface: MsnFileTransfer
Get the MsnMessenger the controller belongs to.

Specified by:
getMessenger in interface MsnFileTransfer
Returns:
MsnMessenger

getContact

public MsnContact getContact()
Description copied from interface: MsnFileTransfer
Get the contact who sent the file or received the file.

Specified by:
getContact in interface MsnFileTransfer
Returns:
the contact

getState

public MsnFileTransferState getState()
Description copied from interface: MsnFileTransfer
Get file transfer state.

Specified by:
getState in interface MsnFileTransfer
Returns:
file transfer state

isReceiver

public boolean isReceiver()
Description copied from interface: MsnFileTransfer
Is the MsnOwner receive file from others.

Specified by:
isReceiver in interface MsnFileTransfer
Returns:
is the MsnOwner receive file from others

getFileTotalSize

public long getFileTotalSize()
Description copied from interface: MsnFileTransfer
Get the total size of the file.

Specified by:
getFileTotalSize in interface MsnFileTransfer
Returns:
the file total size

getTransferredSize

public long getTransferredSize()
Description copied from interface: MsnFileTransfer
Get transferred size.

Specified by:
getTransferredSize in interface MsnFileTransfer
Returns:
the transferred size

getFile

public File getFile()
Description copied from interface: MsnFileTransfer
Get the transfer file.

Specified by:
getFile in interface MsnFileTransfer
Returns:
transfer file

setFile

public void setFile(File file)
             throws IllegalStateException
Description copied from interface: MsnFileTransfer
Set the transfer file only if the transfer controller not started.

Specified by:
setFile in interface MsnFileTransfer
Parameters:
file - transfer file
Throws:
IllegalStateException - if the transfer started

setFileTotalSize

public void setFileTotalSize(long fileTotalSize)

setTransferredSize

protected void setTransferredSize(long transferredSize)

setState

protected void setState(MsnFileTransferState state)

JML