JML

net.sf.jml.impl
Class BasicSwitchboard

java.lang.Object
  extended by net.sf.jml.impl.AbstractSwitchboard
      extended by net.sf.jml.impl.BasicSwitchboard
All Implemented Interfaces:
MsnSwitchboard
Direct Known Subclasses:
SimpleSwitchboard

public abstract class BasicSwitchboard
extends AbstractSwitchboard

basic MsnSwitchboard implement, communication with MSN SB.

Author:
Roger Chen

Constructor Summary
BasicSwitchboard(BasicMessenger messenger, boolean createdByOwner, String ip, int port)
           
 
Method Summary
 void addSessionListener(net.sf.cindy.SessionListener listener)
           
 void close()
          Close switchboard.
 MsnConnection getConnection()
          Get current switchboard's connectin information.
 MsnMessageChain getIncomingMessageChain()
          Get the incoming message chain.
 MsnMessageChain getOutgoingMessageChain()
          Get the outgoing message chain.
 void removeSessionListener(net.sf.cindy.SessionListener listener)
           
 boolean send(MsnOutgoingMessage message, boolean block)
          Send protocol message.
 boolean sendMessage(MsnMimeMessage message, boolean block)
          Send message to others.
 void setAuthStr(String authStr)
           
 void setSessionId(int sessionId)
           
 void start()
           
 String toString()
           
 
Methods inherited from class net.sf.jml.impl.AbstractSwitchboard
addContact, addFileTransfer, containContact, containContact, getActiveFileTransfers, getAllContacts, getAttachment, getMessenger, removeContact, removeFileTransfer, send, sendMessage, setAttachment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.jml.MsnSwitchboard
inviteContact, sendFile, sendText
 

Constructor Detail

BasicSwitchboard

public BasicSwitchboard(BasicMessenger messenger,
                        boolean createdByOwner,
                        String ip,
                        int port)
Method Detail

getConnection

public MsnConnection getConnection()
Description copied from interface: MsnSwitchboard
Get current switchboard's connectin information.

Returns:
connection information

close

public void close()
Description copied from interface: MsnSwitchboard
Close switchboard.


getIncomingMessageChain

public MsnMessageChain getIncomingMessageChain()
Description copied from interface: MsnSwitchboard
Get the incoming message chain.

Returns:
incoming message chain

getOutgoingMessageChain

public MsnMessageChain getOutgoingMessageChain()
Description copied from interface: MsnSwitchboard
Get the outgoing message chain.

Returns:
outgoing message chain

sendMessage

public boolean sendMessage(MsnMimeMessage message,
                           boolean block)
Description copied from interface: MsnSwitchboard
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

send

public boolean send(MsnOutgoingMessage message,
                    boolean block)
Description copied from interface: MsnSwitchboard
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

toString

public String toString()
Overrides:
toString in class Object

setAuthStr

public void setAuthStr(String authStr)

setSessionId

public void setSessionId(int sessionId)

start

public void start()

addSessionListener

public void addSessionListener(net.sf.cindy.SessionListener listener)

removeSessionListener

public void removeSessionListener(net.sf.cindy.SessionListener listener)

JML