JML

net.sf.jml
Interface MsnSwitchboard

All Known Implementing Classes:
AbstractSwitchboard, BasicSwitchboard, SimpleSwitchboard

public interface MsnSwitchboard

Msn switchboard, communication with MSN SB server.

Author:
Roger Chen

Method Summary
 void close()
          Close switchboard.
 boolean containContact(Email email)
          Is contain the contact.
 MsnFileTransfer[] getActiveFileTransfers()
          Get all active file transfer.
 MsnContact[] getAllContacts()
          Get all contacts on the switchboard.
 Object getAttachment()
          Get the attachment.
 MsnConnection getConnection()
          Get current switchboard's connectin information.
 MsnMessageChain getIncomingMessageChain()
          Get the incoming message chain.
 MsnMessenger getMessenger()
          Get the MsnMessenger belongs to.
 MsnMessageChain getOutgoingMessageChain()
          Get the outgoing message chain.
 void inviteContact(Email email)
          Inviate a contact to join the switchboard.
 void send(MsnOutgoingMessage message)
          This method is a shorthand for:
 boolean send(MsnOutgoingMessage message, boolean block)
          Send protocol message.
 void sendFile(File file)
          Send file.
 void sendMessage(MsnMimeMessage message)
          This method is a shorthand for:
 boolean sendMessage(MsnMimeMessage message, boolean block)
          Send message to others.
 void sendText(String text)
          Send text message without format.
 void setAttachment(Object attachment)
          Set the attachment.
 

Method Detail

getMessenger

MsnMessenger getMessenger()
Get the MsnMessenger belongs to.

Returns:
MsnMessenger

getAttachment

Object getAttachment()
Get the attachment.

Returns:
attachment

setAttachment

void setAttachment(Object attachment)
Set the attachment.

Parameters:
attachment - attachment

getConnection

MsnConnection getConnection()
Get current switchboard's connectin information.

Returns:
connection information

getOutgoingMessageChain

MsnMessageChain getOutgoingMessageChain()
Get the outgoing message chain.

Returns:
outgoing message chain

getIncomingMessageChain

MsnMessageChain getIncomingMessageChain()
Get the incoming message chain.

Returns:
incoming message chain

close

void close()
Close switchboard.


getAllContacts

MsnContact[] getAllContacts()
Get all contacts on the switchboard.

Returns:
all contacts on the switchboard.

containContact

boolean containContact(Email email)
Is contain the contact.

Parameters:
email - email
Returns:
is contain the contact

inviteContact

void inviteContact(Email email)
Inviate a contact to join the switchboard.

Parameters:
email - contact's email

getActiveFileTransfers

MsnFileTransfer[] getActiveFileTransfers()
Get all active file transfer.

Returns:
all file transfer

sendFile

void sendFile(File file)
              throws IllegalArgumentException,
                     IllegalStateException
Send file.

Parameters:
file - send file
Throws:
IllegalArgumentException - if file not existed
IllegalStateException - if no one or more than one contact in current switchboard

sendText

void sendText(String text)
Send text message without format.

Parameters:
text - text

sendMessage

boolean sendMessage(MsnMimeMessage message,
                    boolean block)
Send message to others. If block, the method will return after the message successfully sent or failed. If not block, the method always return false.

Parameters:
message - MsnMimeMessage
block - is block
Returns:
if block, return message send successful, else return false

sendMessage

void sendMessage(MsnMimeMessage message)
This method is a shorthand for:
     sendMessage(message, false);
 

Parameters:
message - MsnMimeMessage

send

boolean send(MsnOutgoingMessage message,
             boolean block)
Send protocol message. If block, the method will return after the message successfully sent or failed. If not block, the method always return false.

Parameters:
message - MsnOutgoingMessage
block - is block
Returns:
if block, return message send successful, else return false

send

void send(MsnOutgoingMessage message)
This method is a shorthand for:
     send(message, false);
 

Parameters:
message - MsnOutgoingMessage

JML