jcx.util
Class msn
java.lang.Object
|
+--jcx.util.msn
- All Implemented Interfaces:
- java.util.EventListener, com.msn.event.MsnListener
- public class msn
- extends java.lang.Object
- implements com.msn.event.MsnListener
此類別 MSN
為一 MSN API,
凡是欲連結 MSN 皆可引用此 API 。
使用方法:
1.安裝MSN ,申請一個 MSN 的帳號(account) 並記好 password
2.如果欲送訊息給對方,先確定已加入 Contact List
3.將安裝好的 MSN OFF-Line
P.S. 請在 emaker/config/main.cfg 加入兩行
msn.user=account
msn.pass=password
Constructor Summary |
msn()
|
msn(java.lang.String Account,
java.lang.String pwd)
new a MSN object with initial Account and PASSWORD
must use open to start connection after this |
Method Summary |
void |
addFailed(int errorCode)
|
void |
allListUpdated()
|
void |
buddyListModified()
|
void |
close()
|
void |
filePosted(com.msn.SwitchboardSession ss,
int cookie,
java.lang.String filename,
int filesize)
|
void |
fileReceiveError(com.msn.ftp.VolatileDownloader downloader,
java.lang.Throwable e)
|
void |
fileReceiveStarted(com.msn.ftp.VolatileDownloader downloader)
|
void |
fileSendAccepted(com.msn.SwitchboardSession ss,
int cookie)
|
void |
fileSendEnded(com.msn.ftp.VolatileTransferServer server)
|
void |
fileSendError(com.msn.ftp.VolatileTransferServer server,
java.lang.Throwable e)
|
void |
fileSendRejected(com.msn.SwitchboardSession ss,
int cookie,
java.lang.String reason)
|
void |
fileSendStarted(com.msn.ftp.VolatileTransferServer server)
|
java.lang.String |
getMyStatus()
|
void |
instantMessageReceived(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend friend,
com.msn.msg.MimeMessage mime)
|
void |
listAdd(com.msn.entity.MsnFriend friend)
|
void |
listOnline(com.msn.entity.MsnFriend friend)
|
void |
loginComplete(com.msn.entity.MsnFriend own)
|
void |
loginError(java.lang.String header)
|
void |
logoutNotify()
|
static void |
main(java.lang.String[] args)
|
static boolean |
message(java.lang.String Account,
java.lang.String msg)
|
void |
notifyUnreadMail(java.util.Properties prop,
int unread)
|
void |
progressTyping(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend friend,
java.lang.String typingUser)
|
void |
renameNotify(com.msn.entity.MsnFriend friend)
|
boolean |
sendmsg(java.lang.String Account,
java.lang.String msg)
|
void |
switchboardSessionAbandon(com.msn.SwitchboardSession ss,
java.lang.String targetName)
|
void |
switchboardSessionEnded(com.msn.SwitchboardSession ss)
|
void |
switchboardSessionStarted(com.msn.SwitchboardSession ss)
|
void |
userOffline(java.lang.String loginName)
|
void |
userOnline(com.msn.entity.MsnFriend friend)
|
void |
whoAddedMe(com.msn.entity.MsnFriend friend)
|
void |
whoJoinSession(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend join)
|
void |
whoPartSession(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend part)
|
void |
whoRemovedMe(com.msn.entity.MsnFriend friend)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
msn
public msn()
msn
public msn(java.lang.String Account,
java.lang.String pwd)
- new a MSN object with initial Account and PASSWORD
must use
open
to start connection after this
- Parameters:
Account
- MSN
MSN Account.pwd
- MSN
login PASSWORD.
loginComplete
public void loginComplete(com.msn.entity.MsnFriend own)
- Specified by:
loginComplete
in interface com.msn.event.MsnListener
loginError
public void loginError(java.lang.String header)
- Specified by:
loginError
in interface com.msn.event.MsnListener
listAdd
public void listAdd(com.msn.entity.MsnFriend friend)
- Specified by:
listAdd
in interface com.msn.event.MsnListener
listOnline
public void listOnline(com.msn.entity.MsnFriend friend)
- Specified by:
listOnline
in interface com.msn.event.MsnListener
userOnline
public void userOnline(com.msn.entity.MsnFriend friend)
- Specified by:
userOnline
in interface com.msn.event.MsnListener
userOffline
public void userOffline(java.lang.String loginName)
- Specified by:
userOffline
in interface com.msn.event.MsnListener
switchboardSessionStarted
public void switchboardSessionStarted(com.msn.SwitchboardSession ss)
- Specified by:
switchboardSessionStarted
in interface com.msn.event.MsnListener
whoJoinSession
public void whoJoinSession(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend join)
- Specified by:
whoJoinSession
in interface com.msn.event.MsnListener
whoPartSession
public void whoPartSession(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend part)
- Specified by:
whoPartSession
in interface com.msn.event.MsnListener
switchboardSessionEnded
public void switchboardSessionEnded(com.msn.SwitchboardSession ss)
- Specified by:
switchboardSessionEnded
in interface com.msn.event.MsnListener
switchboardSessionAbandon
public void switchboardSessionAbandon(com.msn.SwitchboardSession ss,
java.lang.String targetName)
- Specified by:
switchboardSessionAbandon
in interface com.msn.event.MsnListener
progressTyping
public void progressTyping(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend friend,
java.lang.String typingUser)
- Specified by:
progressTyping
in interface com.msn.event.MsnListener
instantMessageReceived
public void instantMessageReceived(com.msn.SwitchboardSession ss,
com.msn.entity.MsnFriend friend,
com.msn.msg.MimeMessage mime)
- Specified by:
instantMessageReceived
in interface com.msn.event.MsnListener
filePosted
public void filePosted(com.msn.SwitchboardSession ss,
int cookie,
java.lang.String filename,
int filesize)
- Specified by:
filePosted
in interface com.msn.event.MsnListener
fileSendAccepted
public void fileSendAccepted(com.msn.SwitchboardSession ss,
int cookie)
- Specified by:
fileSendAccepted
in interface com.msn.event.MsnListener
fileSendRejected
public void fileSendRejected(com.msn.SwitchboardSession ss,
int cookie,
java.lang.String reason)
- Specified by:
fileSendRejected
in interface com.msn.event.MsnListener
fileSendStarted
public void fileSendStarted(com.msn.ftp.VolatileTransferServer server)
- Specified by:
fileSendStarted
in interface com.msn.event.MsnListener
fileSendEnded
public void fileSendEnded(com.msn.ftp.VolatileTransferServer server)
- Specified by:
fileSendEnded
in interface com.msn.event.MsnListener
fileReceiveStarted
public void fileReceiveStarted(com.msn.ftp.VolatileDownloader downloader)
- Specified by:
fileReceiveStarted
in interface com.msn.event.MsnListener
fileSendError
public void fileSendError(com.msn.ftp.VolatileTransferServer server,
java.lang.Throwable e)
- Specified by:
fileSendError
in interface com.msn.event.MsnListener
fileReceiveError
public void fileReceiveError(com.msn.ftp.VolatileDownloader downloader,
java.lang.Throwable e)
- Specified by:
fileReceiveError
in interface com.msn.event.MsnListener
whoAddedMe
public void whoAddedMe(com.msn.entity.MsnFriend friend)
- Specified by:
whoAddedMe
in interface com.msn.event.MsnListener
whoRemovedMe
public void whoRemovedMe(com.msn.entity.MsnFriend friend)
- Specified by:
whoRemovedMe
in interface com.msn.event.MsnListener
buddyListModified
public void buddyListModified()
- Specified by:
buddyListModified
in interface com.msn.event.MsnListener
addFailed
public void addFailed(int errorCode)
- Specified by:
addFailed
in interface com.msn.event.MsnListener
renameNotify
public void renameNotify(com.msn.entity.MsnFriend friend)
- Specified by:
renameNotify
in interface com.msn.event.MsnListener
allListUpdated
public void allListUpdated()
- Specified by:
allListUpdated
in interface com.msn.event.MsnListener
logoutNotify
public void logoutNotify()
- Specified by:
logoutNotify
in interface com.msn.event.MsnListener
notifyUnreadMail
public void notifyUnreadMail(java.util.Properties prop,
int unread)
- Specified by:
notifyUnreadMail
in interface com.msn.event.MsnListener
getMyStatus
public java.lang.String getMyStatus()
sendmsg
public boolean sendmsg(java.lang.String Account,
java.lang.String msg)
throws java.io.IOException
message
public static boolean message(java.lang.String Account,
java.lang.String msg)
throws java.lang.Exception
close
public void close()
throws java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception