JML

net.sf.jml
Interface MsnMessenger

All Known Implementing Classes:
AbstractMessenger, BasicMessenger, SimpleMessenger

public interface MsnMessenger

Msn Messenger interface.

Author:
Roger Chen

Method Summary
 void addContactListListener(MsnContactListListener listener)
          Add a new listener for the contact list icoming events.
 void addEmailListener(MsnEmailListener listener)
          Add a email events listener.
 void addFileTransferListener(MsnFileTransferListener listener)
          Add a file transfer events listener.
 void addFriend(Email email, String friendlyName)
          Add friend to FL and AL.
 void addGroup(String groupName)
          Add group.
 void addListener(MsnAdapter listener)
          Add a new listener for all interfaces.
 void addMessageListener(MsnMessageListener listener)
          Add a new listener for incoming messages.
 void addMessengerListener(MsnMessengerListener listener)
          Add a new Messenger events listener.
 void addSwitchboardListener(MsnSwitchboardListener listener)
          Add a new switchboard incominf events listener.
 void blockFriend(Email email)
          Block friend.
 void copyFriend(Email email, String groupId)
          Copy friend to other group, but user can't both in default group and user defined group.
 MsnSwitchboard[] getActiveSwitchboards()
          Get all active MsnSwitchboard.
 MsnProtocol getActualMsnProtocol()
          Get actual used protocol.
 Object getAttachment()
          Get the attachment.
 MsnConnection getConnection()
          Get current connection information.
 MsnContactList getContactList()
          Get contact list.
 DisplayPictureDuelManager getDisplayPictureDuelManager()
          Retrieves the instance of the duel manager to be used by this session.
 MsnMessageChain getIncomingMessageChain()
          Get the incoming message chain.
 MsnMessageChain getOutgoingMessageChain()
          Get the outgoing message chain.
 MsnOwner getOwner()
          Get current user.
 MsnProtocol[] getSupportedProtocol()
          Get supported protocols.
 boolean isLogIncoming()
          Is log incoming message.
 boolean isLogOutgoing()
          Is log outgoing message.
 void login()
          Login.
 void logout()
          Logout.
 void moveFriend(Email email, String srcGroupId, String destGroupId)
          Move friend from one group to other group.
 void newSwitchboard(Object attachment)
          Create a switchboard and start.
 void removeContactListListener(MsnContactListListener listener)
          Removes a listener for incoming events for the contact list.
 void removeEmailListener(MsnEmailListener listener)
          Removes a email listener.
 void removeFileTransferListener(MsnFileTransferListener listener)
          Removes a file transfer listener.
 void removeFriend(Email email, boolean block)
          Remove friend.
 void removeFriend(Email email, String groupId)
          Remove friend from one group.
 void removeGroup(String groupId)
          Remove group.
 void removeListener(MsnAdapter listener)
          Remove the MsnAdapter listener.
 void removeMessageListener(MsnMessageListener listener)
          Remosves a listener for incoming messages.
 void removeMessengerListener(MsnMessengerListener listener)
          Remove the Messenger listener.
 void removeSwitchboardListener(MsnSwitchboardListener listener)
          Remove a switchboard listener.
 void renameFriend(Email email, String friendlyName)
          Rename friend.
 void renameGroup(String groupId, String newGroupName)
          Rename group.
 void retrieveDisplayPicture(MsnObject displayPicture, DisplayPictureListener listener)
          Retrieves the content of a display picture, given as a MsnObject.
 void send(MsnOutgoingMessage message)
          This method is a shorthand for:
 boolean send(MsnOutgoingMessage message, boolean block)
          Send a message to DS/NS server.
 void sendText(Email email, String text)
          Send text message to someone without format.
 void setAttachment(Object attachment)
          Set the attachment.
 void setLogIncoming(boolean logIncoming)
          Set log incoming message.
 void setLogOutgoing(boolean logOutgoing)
          Set log outgoing message.
 void setSupportedProtocol(MsnProtocol[] supportedProtocol)
          Set supported protocols.
 void unblockFriend(Email email)
          Unblock friend.
 

Method Detail

getAttachment

Object getAttachment()
Get the attachment.

Returns:
attachment

setAttachment

void setAttachment(Object attachment)
Set the attachment.

Parameters:
attachment - attachment

isLogIncoming

boolean isLogIncoming()
Is log incoming message. For debug purpose.

Returns:
is log incoming message

setLogIncoming

void setLogIncoming(boolean logIncoming)
Set log incoming message. For debug purpose.

Parameters:
logIncoming - set log incoming message

isLogOutgoing

boolean isLogOutgoing()
Is log outgoing message. For debug purpose.

Returns:
is log outgoing message

setLogOutgoing

void setLogOutgoing(boolean logOutgoing)
Set log outgoing message. For debug purpose.

Parameters:
logOutgoing - set log outgoing message

getSupportedProtocol

MsnProtocol[] getSupportedProtocol()
Get supported protocols.

Returns:
supported protocols

setSupportedProtocol

void setSupportedProtocol(MsnProtocol[] supportedProtocol)
Set supported protocols. This will take effect only after re-login.

Parameters:
supportedProtocol - supported protocols

getOwner

MsnOwner getOwner()
Get current user.

Returns:
current user

getContactList

MsnContactList getContactList()
Get contact list.

Returns:
contact list

getConnection

MsnConnection getConnection()
Get current connection information.

Returns:
current connect information

getActualMsnProtocol

MsnProtocol getActualMsnProtocol()
Get actual used protocol.

Returns:
current used protocol

getOutgoingMessageChain

MsnMessageChain getOutgoingMessageChain()
Get the outgoing message chain.

Returns:
outgoing message chain

getIncomingMessageChain

MsnMessageChain getIncomingMessageChain()
Get the incoming message chain.

Returns:
incoming message chain

login

void login()
Login.


logout

void logout()
Logout.


send

boolean send(MsnOutgoingMessage message,
             boolean block)
Send a message to DS/NS server. 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

newSwitchboard

void newSwitchboard(Object attachment)
Create a switchboard and start. Send a message to NS server and wait response to start a new switchboard.

You can use the attachement to identify the MsnSwitchboard by call switchboard.getAttachment().

Parameters:
attachment - MsnSwitchboard's attachment

getActiveSwitchboards

MsnSwitchboard[] getActiveSwitchboards()
Get all active MsnSwitchboard.

Returns:
all active MsnSwitchboard

addListener

void addListener(MsnAdapter listener)
Add a new listener for all interfaces.

Parameters:
listener - Instance of MsnAdapter that listen to all interfaces.

removeListener

void removeListener(MsnAdapter listener)
Remove the MsnAdapter listener.

Parameters:
listener - Instance of the listener to be removed.

addMessengerListener

void addMessengerListener(MsnMessengerListener listener)
Add a new Messenger events listener.

Parameters:
listener - New Messenger listener.

removeMessengerListener

void removeMessengerListener(MsnMessengerListener listener)
Remove the Messenger listener.

Parameters:
listener - Instance of Messenger listener to be removed.

addMessageListener

void addMessageListener(MsnMessageListener listener)
Add a new listener for incoming messages.

Parameters:
listener - Instance of the listener.

removeMessageListener

void removeMessageListener(MsnMessageListener listener)
Remosves a listener for incoming messages.

Parameters:
listener - Instance of the listener.

addContactListListener

void addContactListListener(MsnContactListListener listener)
Add a new listener for the contact list icoming events.

Parameters:
listener - New instance of the listener.

removeContactListListener

void removeContactListListener(MsnContactListListener listener)
Removes a listener for incoming events for the contact list.

Parameters:
listener - Instance of the listener to be removed.

addSwitchboardListener

void addSwitchboardListener(MsnSwitchboardListener listener)
Add a new switchboard incominf events listener.

Parameters:
listener - New listener instance.

removeSwitchboardListener

void removeSwitchboardListener(MsnSwitchboardListener listener)
Remove a switchboard listener.

Parameters:
listener - Instance of the listener.

addFileTransferListener

void addFileTransferListener(MsnFileTransferListener listener)
Add a file transfer events listener.

Parameters:
listener - Instance of the listener.

removeFileTransferListener

void removeFileTransferListener(MsnFileTransferListener listener)
Removes a file transfer listener.

Parameters:
listener - Instance of the listener.

addEmailListener

void addEmailListener(MsnEmailListener listener)
Add a email events listener.

Parameters:
listener - Instance of the listener.

removeEmailListener

void removeEmailListener(MsnEmailListener listener)
Removes a email listener.

Parameters:
listener - Instance of the listener.

sendText

void sendText(Email email,
              String text)
Send text message to someone without format. If the email address is not in any switchboard, will create a switchboard and send the text.

Parameters:
email - email
text - text

addGroup

void addGroup(String groupName)
Add group.

Parameters:
groupName - group name

removeGroup

void removeGroup(String groupId)
Remove group.

Parameters:
groupId - group id

renameGroup

void renameGroup(String groupId,
                 String newGroupName)
Rename group.

Parameters:
groupId - group id
newGroupName - new group name

addFriend

void addFriend(Email email,
               String friendlyName)
Add friend to FL and AL.

Parameters:
email - email
friendlyName - friendly name

copyFriend

void copyFriend(Email email,
                String groupId)
Copy friend to other group, but user can't both in default group and user defined group.

Parameters:
email - email
groupId - group id

removeFriend

void removeFriend(Email email,
                  boolean block)
Remove friend.

Parameters:
email - email
block - remove and block

removeFriend

void removeFriend(Email email,
                  String groupId)
Remove friend from one group.

Parameters:
email - email
groupId - group id

moveFriend

void moveFriend(Email email,
                String srcGroupId,
                String destGroupId)
Move friend from one group to other group.

Parameters:
email - email
srcGroupId - source group id
destGroupId - dest group id

blockFriend

void blockFriend(Email email)
Block friend.

Parameters:
email - email

unblockFriend

void unblockFriend(Email email)
Unblock friend.

Parameters:
email - email

renameFriend

void renameFriend(Email email,
                  String friendlyName)
Rename friend.

Parameters:
email - email
friendlyName - new friendly name

retrieveDisplayPicture

void retrieveDisplayPicture(MsnObject displayPicture,
                            DisplayPictureListener listener)
                            throws JmlException
Retrieves the content of a display picture, given as a MsnObject. This method can only be used with display pictures and emoticons. If the file specified already exists, then it is removed first.

Parameters:
displayPicture - Instance of the MsnObject for the display picture.
listener - Listener for the display pictura retrieval progress.
Throws:
JmlException - If the MsnObject instance is null, or isn't a display picture or emoticon.

getDisplayPictureDuelManager

DisplayPictureDuelManager getDisplayPictureDuelManager()
Retrieves the instance of the duel manager to be used by this session.

Returns:
Instance of the duel manager.

JML