kfmes.natelib.event
Class NateAdapter

java.lang.Object
  extended by kfmes.natelib.event.NateAdapter
All Implemented Interfaces:
java.util.EventListener, NateListener

public class NateAdapter
extends java.lang.Object
implements NateListener

네이트온 리스너 아답터 클래스

Version:
$Id: NateAdapter.java,v 1.21 2007/11/19 10:13:37 kfmes Exp $
Author:
kfmes(KIM Ga-Hyeon, jateon@kfmes.com, http://jateon.kfmes.com )

Constructor Summary
NateAdapter()
           
 
Method Summary
 void addFailed(int errorCode)
          사용자 등록을 실패하였을때 발송되는 이벤트이다.
 void allListUpdated()
          로그인 시, Synchronization value가 달랐을때, 서버로부터 FL/AL/BL/RL, Group list등을 모두 받게 되는데, 만만치 않은 작업이므로, 모두 다 Update되었을때 통지되는 이벤트이다.
 void buddyListInit(GroupList grouplist)
           
 void buddyListModified()
          BuddyList가 수정되어 Serial number가 변경된 직 후, 발송되는 이벤트이다.
 void buddyModified(NateFriend friend)
          buddy의 상태가 바뀌었을때 사용한다
 void chatMessageReceived(SwitchBoardSession ss, NateFriend friend, MimeMessage mime)
          특정 Switchboard session에서 인스턴트 메시지를 받았을때 불려진다.
 void filePosted(SwitchBoardSession session, FileRecver recv, NateFriend ref, java.util.ArrayList<NateFile> list)
          누군가가 자신에게 파일을 보내려고 함을 알려주는 메소드이다.
 void fileRecved(FileRecver recver, NateFile natefile)
          파일 받기가 끝났을때 발생하는 이벤트
 void fileSend(SwitchBoardSession session, FileSender sender, NateFriend ref, java.util.ArrayList<NateFile> list)
           
 void fileSendAccepted(SwitchBoardSession ss, java.lang.String cookie)
          보내려고 했던 파일에 대하여 상대방이 Accept해주었음을 알려주는 메소드이다.
 void fileSendEnded(FileSender sender, NateFile natefile)
          파일 보내기 작업이 종료되었음을 알려준다.
 void fileSendError(FileSender sender, java.lang.Throwable e)
          파일을 송신하던중 예외가 발생하였음을 알려주는 메소드이다.
 void fileSendRejected(SwitchBoardSession ss, java.lang.String cookie, java.lang.String reason)
          보내려고 했던 파일에 대하여 상대방이 Reject했음을 알려주는 메소드이다.
 void fileSendStarted(FileSender sender)
          파일 보내기 작업이 시작되었음을 알려준다.
 void fileTransferAborted(java.lang.String cookie)
           
 void instanceMessageReceived(InstanceMessage imsg)
          쪽지가 왔을때 발생한다
 void killed()
          kill msg
 void listAdd(NateFriend friend)
          LST 메시지 도착시 알려준다.
 void listOnline(NateFriend friend)
          로그인 한 후, 상태를 온라인으로 바꾸었을때, 자신의 Contact list에 있는 사용자중에 상태가 Online(혹은 substate)인 사용자들을 이 메소드를 통해 임의의 길이로 날려준다.
 void loginComplete()
          로그인이 완료되었다는 메시지이다.
 void loginError(java.lang.String header)
          존재하지 않는 아이디이거나, 비밀번호가 틀렸을 경우, 이 이벤트를 발송하고, 연결은 종료된다.
 void logoutNotify()
          로그아웃 되었음을 알려주는 이벤트이다.
 void notifyUnreadMail(java.util.Properties prop, int unread)
          HotMail 계정사용시, 로그인시 읽지않은 편지에 대한 정보를 넘겨준다.
 void OwnerStatusUpdated()
           
 void progressTyping(SwitchBoardSession ss, NateFriend friend, int flag)
          특정 Switchboard session에서 typingUser사용자가 메시지를 입력하는 중일때 발송될때 불려진다.
 void renameNotify(NateFriend friend)
          친숙한 이름(FriendlyName)이 변경되었을때 발송되는 이벤트이다.
 void switchboardSessionAbandon(SwitchBoardSession ss, java.lang.String targetName)
          Switchboard session이 연결을 완료하지 못하고 SS로부터 연결이 끝어져버렸을때 발생하는 이벤트이다.
 void switchboardSessionEnded(SwitchBoardSession ss)
          Switchboard session이 상대방으로부터 종료되었을때 불려진다.
 void switchboardSessionStarted(SwitchBoardSession ss)
          누군가가 Switchboard server를 통해서 자신에게 대화요청을 하였고, 그 사람과의 session이 연결되었다는 것을 알려준다.
 void userOffline(NateFriend friend)
          자신의 Foward ContactList에 있는 사용자중 온라인이였던 사용자가 오프라인으로 상태가 변경되었을때 NS로부터 날라오는 메시지이다.
 void userOnline(NateFriend friend)
          자신의 ContactList에 있는 사용자 중에 한명이 온라인이 되거나 상태를 변경하였을때, NS로부터 날라오는 메시지이다.
 void whoAddedMe(NateFriend friend)
          누군가 자신을 등록했음을 알려준다.
 void whoJoinSession(SwitchBoardSession ss, NateFriend join)
          특정 세션으로 새로운 사용자가 입장하였음을 알려준다.
 void whoPartSession(SwitchBoardSession ss, NateFriend part)
          특정 세션에서 사용자가 BYE 하고 세션을 끊었음을 알려준다.
 void whoRemovedMe(NateFriend friend)
          누군가 자신을 삭제했음을 알려준다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NateAdapter

public NateAdapter()
Method Detail

addFailed

public void addFailed(int errorCode)
Description copied from interface: NateListener
사용자 등록을 실패하였을때 발송되는 이벤트이다.

Specified by:
addFailed in interface NateListener
Parameters:
errorCode - 서버로부터 받은 에러 코드 헤더

allListUpdated

public void allListUpdated()
Description copied from interface: NateListener
로그인 시, Synchronization value가 달랐을때, 서버로부터 FL/AL/BL/RL, Group list등을 모두 받게 되는데, 만만치 않은 작업이므로, 모두 다 Update되었을때 통지되는 이벤트이다.

Specified by:
allListUpdated in interface NateListener

buddyListModified

public void buddyListModified()
Description copied from interface: NateListener
BuddyList가 수정되어 Serial number가 변경된 직 후, 발송되는 이벤트이다.

Specified by:
buddyListModified in interface NateListener

filePosted

public void filePosted(SwitchBoardSession session,
                       FileRecver recv,
                       NateFriend ref,
                       java.util.ArrayList<NateFile> list)
Description copied from interface: NateListener
누군가가 자신에게 파일을 보내려고 함을 알려주는 메소드이다.

Specified by:
filePosted in interface NateListener

fileSendAccepted

public void fileSendAccepted(SwitchBoardSession ss,
                             java.lang.String cookie)
Description copied from interface: NateListener
보내려고 했던 파일에 대하여 상대방이 Accept해주었음을 알려주는 메소드이다. 이 이벤트가 발생하였을 경우에 특별히 해줘야할일은 없다. 단 이 이벤트가 발생한 후, 곧바로 실제로 파일을 전송하기위한 thread가 생성될 것이며 port가 bind되고 파일 전송이 시작될 것이다.

Specified by:
fileSendAccepted in interface NateListener

fileSendEnded

public void fileSendEnded(FileSender sender,
                          NateFile natefile)
Description copied from interface: NateListener
파일 보내기 작업이 종료되었음을 알려준다.

Specified by:
fileSendEnded in interface NateListener

fileSendError

public void fileSendError(FileSender sender,
                          java.lang.Throwable e)
Description copied from interface: NateListener
파일을 송신하던중 예외가 발생하였음을 알려주는 메소드이다. 어쨌든, 파일 전송 thread는 종료된다.

Specified by:
fileSendError in interface NateListener

fileSendRejected

public void fileSendRejected(SwitchBoardSession ss,
                             java.lang.String cookie,
                             java.lang.String reason)
Description copied from interface: NateListener
보내려고 했던 파일에 대하여 상대방이 Reject했음을 알려주는 메소드이다. 이 이벤트가 발생하였을 경우에 특별히 해줘야할일은 없다.

Specified by:
fileSendRejected in interface NateListener

fileSendStarted

public void fileSendStarted(FileSender sender)
Description copied from interface: NateListener
파일 보내기 작업이 시작되었음을 알려준다.

Specified by:
fileSendStarted in interface NateListener

chatMessageReceived

public void chatMessageReceived(SwitchBoardSession ss,
                                NateFriend friend,
                                MimeMessage mime)
Description copied from interface: NateListener
특정 Switchboard session에서 인스턴트 메시지를 받았을때 불려진다.

Specified by:
chatMessageReceived in interface NateListener
Parameters:
ss - 해당 switchboard session

listAdd

public void listAdd(NateFriend friend)
Description copied from interface: NateListener
LST 메시지 도착시 알려준다.

Specified by:
listAdd in interface NateListener

listOnline

public void listOnline(NateFriend friend)
Description copied from interface: NateListener
로그인 한 후, 상태를 온라인으로 바꾸었을때, 자신의 Contact list에 있는 사용자중에 상태가 Online(혹은 substate)인 사용자들을 이 메소드를 통해 임의의 길이로 날려준다. 문제점은 호출 종료지점을 정확하게 알 수 없다는 것이다.

만약 Online Contact list를 가지고 싶다면, MsnFriend 객체를 Map에 저장해두면 편리하다. (Key값은 loginName으로 하면 더 좋다)

Specified by:
listOnline in interface NateListener

loginComplete

public void loginComplete()
Description copied from interface: NateListener
로그인이 완료되었다는 메시지이다. 자신의 로그인이름(메일주소)와 닉네임을 던져준다.

Specified by:
loginComplete in interface NateListener

loginError

public void loginError(java.lang.String header)
Description copied from interface: NateListener
존재하지 않는 아이디이거나, 비밀번호가 틀렸을 경우, 이 이벤트를 발송하고, 연결은 종료된다. 아무튼 로그인을 할 수 없을때 발생되는 이벤트이다.

Specified by:
loginError in interface NateListener

logoutNotify

public void logoutNotify()
Description copied from interface: NateListener
로그아웃 되었음을 알려주는 이벤트이다. 반드시 정상적인 로그아웃만을 알려주는 것은 아니다. Emergency exception을 통해 NotificationProcessor가 종료되었을 경우에도 이벤트가 발생한다.

즉, 결국 connection이 terminate되었음을 알려주는 것이다.

Specified by:
logoutNotify in interface NateListener

notifyUnreadMail

public void notifyUnreadMail(java.util.Properties prop,
                             int unread)
Description copied from interface: NateListener
HotMail 계정사용시, 로그인시 읽지않은 편지에 대한 정보를 넘겨준다. Properties는 MSN 서버에서 넘겨준 MIME properties들이며, 이 중 Inbox-Unread property를 사용하면 된다. 이것은 편의상 unread variable로 전달된다.

Specified by:
notifyUnreadMail in interface NateListener

progressTyping

public void progressTyping(SwitchBoardSession ss,
                           NateFriend friend,
                           int flag)
Description copied from interface: NateListener
특정 Switchboard session에서 typingUser사용자가 메시지를 입력하는 중일때 발송될때 불려진다.

Specified by:
progressTyping in interface NateListener

renameNotify

public void renameNotify(NateFriend friend)
Description copied from interface: NateListener
친숙한 이름(FriendlyName)이 변경되었을때 발송되는 이벤트이다. 자신이 변경을 했을때도, 이 이벤트가 발송되며, 다른 인간이 변경해도 발송된다.

만약 null이라면, 자기 자신의 이름 변경에 실패한 case이다.

Specified by:
renameNotify in interface NateListener

switchboardSessionAbandon

public void switchboardSessionAbandon(SwitchBoardSession ss,
                                      java.lang.String targetName)
Description copied from interface: NateListener
Switchboard session이 연결을 완료하지 못하고 SS로부터 연결이 끝어져버렸을때 발생하는 이벤트이다. SwitchboardSession의 Session id는 null일 것이다.

Specified by:
switchboardSessionAbandon in interface NateListener

switchboardSessionEnded

public void switchboardSessionEnded(SwitchBoardSession ss)
Description copied from interface: NateListener
Switchboard session이 상대방으로부터 종료되었을때 불려진다.

Specified by:
switchboardSessionEnded in interface NateListener

switchboardSessionStarted

public void switchboardSessionStarted(SwitchBoardSession ss)
Description copied from interface: NateListener
누군가가 Switchboard server를 통해서 자신에게 대화요청을 하였고, 그 사람과의 session이 연결되었다는 것을 알려준다.

Specified by:
switchboardSessionStarted in interface NateListener

userOffline

public void userOffline(NateFriend friend)
Description copied from interface: NateListener
자신의 Foward ContactList에 있는 사용자중 온라인이였던 사용자가 오프라인으로 상태가 변경되었을때 NS로부터 날라오는 메시지이다.

Specified by:
userOffline in interface NateListener

userOnline

public void userOnline(NateFriend friend)
Description copied from interface: NateListener
자신의 ContactList에 있는 사용자 중에 한명이 온라인이 되거나 상태를 변경하였을때, NS로부터 날라오는 메시지이다.

Specified by:
userOnline in interface NateListener

whoAddedMe

public void whoAddedMe(NateFriend friend)
Description copied from interface: NateListener
누군가 자신을 등록했음을 알려준다. RL만이 등록되어있으므로, 실제 자신의 FL에 등록하는 것은 자신이 직접해주어야 한다.

Specified by:
whoAddedMe in interface NateListener
Parameters:
friend - 등록한 사람의 LoginName, FriendlyName이 저장.

whoJoinSession

public void whoJoinSession(SwitchBoardSession ss,
                           NateFriend join)
Description copied from interface: NateListener
특정 세션으로 새로운 사용자가 입장하였음을 알려준다.

Specified by:
whoJoinSession in interface NateListener

whoPartSession

public void whoPartSession(SwitchBoardSession ss,
                           NateFriend part)
Description copied from interface: NateListener
특정 세션에서 사용자가 BYE 하고 세션을 끊었음을 알려준다.

Specified by:
whoPartSession in interface NateListener

whoRemovedMe

public void whoRemovedMe(NateFriend friend)
Description copied from interface: NateListener
누군가 자신을 삭제했음을 알려준다. RL에서만 삭제되므로, 구지 알려줄 필요는 없다.

Specified by:
whoRemovedMe in interface NateListener
Parameters:
friend - 등록한 사람의 LoginName만이 온다. FriendlyName은 null일 것이다.

instanceMessageReceived

public void instanceMessageReceived(InstanceMessage imsg)
Description copied from interface: NateListener
쪽지가 왔을때 발생한다

Specified by:
instanceMessageReceived in interface NateListener

buddyListInit

public void buddyListInit(GroupList grouplist)
Specified by:
buddyListInit in interface NateListener

killed

public void killed()
Description copied from interface: NateListener
kill msg

Specified by:
killed in interface NateListener

OwnerStatusUpdated

public void OwnerStatusUpdated()
Specified by:
OwnerStatusUpdated in interface NateListener

buddyModified

public void buddyModified(NateFriend friend)
Description copied from interface: NateListener
buddy의 상태가 바뀌었을때 사용한다

Specified by:
buddyModified in interface NateListener

fileRecved

public void fileRecved(FileRecver recver,
                       NateFile natefile)
Description copied from interface: NateListener
파일 받기가 끝났을때 발생하는 이벤트

Specified by:
fileRecved in interface NateListener

fileTransferAborted

public void fileTransferAborted(java.lang.String cookie)
Specified by:
fileTransferAborted in interface NateListener

fileSend

public void fileSend(SwitchBoardSession session,
                     FileSender sender,
                     NateFriend ref,
                     java.util.ArrayList<NateFile> list)
Specified by:
fileSend in interface NateListener