Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.icq
Class OperationSetFileTransferIcqImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.icq.OperationSetFileTransferIcqImpl
All Implemented Interfaces:
OperationSet, OperationSetFileTransfer, net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManagerListener

public class OperationSetFileTransferIcqImpl
extends Object
implements OperationSetFileTransfer, net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManagerListener

The ICQ protocol filetransfer OperationSet.

Author:
Anthony Schmitt, Damian Minkov

Constructor Summary
OperationSetFileTransferIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
          Create a new FileTransfer OperationSet over the specified Icq provider
 
Method Summary
 void addFileTransferListener(FileTransferListener listener)
          Adds the given FileTransferListener that would listen for file transfer requests and created file transfers.
(package private)  void fireFileTransferCreated(FileTransferCreatedEvent event)
          Delivers the file transfer to all registered listeners.
(package private)  void fireFileTransferRequestCanceled(FileTransferRequestEvent event)
          Delivers the specified event to all registered file transfer listeners.
(package private)  void fireFileTransferRequestRejected(FileTransferRequestEvent event)
          Delivers the specified event to all registered file transfer listeners.
 long getMaximumFileLength()
          Returns the maximum file length supported by the protocol in bytes.
 void handleNewIncomingConnection(net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManager manager, net.kano.joustsim.oscar.oscar.service.icbm.ft.IncomingRvConnection transfer)
          Function called when a icq file transfer request arrive
 void removeFileTransferListener(FileTransferListener listener)
          Removes the given FileTransferListener that listens for file transfer requests and created file transfers.
 FileTransfer sendFile(Contact toContact, Contact fromContact, String remotePath, String localPath)
          Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.
 FileTransfer sendFile(Contact toContact, File file)
          Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationSetFileTransferIcqImpl

public OperationSetFileTransferIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
Create a new FileTransfer OperationSet over the specified Icq provider

Parameters:
icqProvider - ICQ protocol provider service
Method Detail

sendFile

public FileTransfer sendFile(Contact toContact,
                             File file)
                      throws IllegalStateException,
                             IllegalArgumentException
Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.

Specified by:
sendFile in interface OperationSetFileTransfer
Parameters:
toContact - the contact that should receive the file
file - the file to send
Returns:
the transfer object
Throws:
IllegalStateException - if the protocol provider is not registered or connected
IllegalArgumentException - if some of the arguments doesn't fit the protocol requirements

sendFile

public FileTransfer sendFile(Contact toContact,
                             Contact fromContact,
                             String remotePath,
                             String localPath)
                      throws IllegalStateException,
                             IllegalArgumentException
Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.

Specified by:
sendFile in interface OperationSetFileTransfer
Parameters:
toContact - the contact that should receive the file
fromContact - the contact sending the file
remotePath - the remote file path
localPath - the local file path
Returns:
the transfer object
Throws:
IllegalStateException - if the protocol provider is not registered or connected
IllegalArgumentException - if some of the arguments doesn't fit the protocol requirements

addFileTransferListener

public void addFileTransferListener(FileTransferListener listener)
Adds the given FileTransferListener that would listen for file transfer requests and created file transfers.

Specified by:
addFileTransferListener in interface OperationSetFileTransfer
Parameters:
listener - the FileTransferListener to add

removeFileTransferListener

public void removeFileTransferListener(FileTransferListener listener)
Removes the given FileTransferListener that listens for file transfer requests and created file transfers.

Specified by:
removeFileTransferListener in interface OperationSetFileTransfer
Parameters:
listener - the FileTransferListener to remove

handleNewIncomingConnection

public void handleNewIncomingConnection(net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManager manager,
                                        net.kano.joustsim.oscar.oscar.service.icbm.ft.IncomingRvConnection transfer)
Function called when a icq file transfer request arrive

Specified by:
handleNewIncomingConnection in interface net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManagerListener
Parameters:
manager - the joustsim manager
transfer - the incoming transfer

fireFileTransferRequestRejected

void fireFileTransferRequestRejected(FileTransferRequestEvent event)
Delivers the specified event to all registered file transfer listeners.

Parameters:
event - the EventObject that we'd like delivered to all registered file transfer listeners.

fireFileTransferRequestCanceled

void fireFileTransferRequestCanceled(FileTransferRequestEvent event)
Delivers the specified event to all registered file transfer listeners.

Parameters:
event - the EventObject that we'd like delivered to all registered file transfer listeners.

fireFileTransferCreated

void fireFileTransferCreated(FileTransferCreatedEvent event)
Delivers the file transfer to all registered listeners.

Parameters:
event - the FileTransferEvent that we'd like delivered to all registered file transfer listeners.

getMaximumFileLength

public long getMaximumFileLength()
Returns the maximum file length supported by the protocol in bytes. Supports up to 2GB.

Specified by:
getMaximumFileLength in interface OperationSetFileTransfer
Returns:
the file length that is supported.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.