|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hamsam.api.IMAdapter
An abstract adapter class receiving instant messaging events.
The class that is interested in processing an instant
messaging event either extends this class (overriding
only the methods of interest) or implements the
IMListener
interface (and all the methods
it contains).
The listener object created from that class is then registered with
the instant messaging framework using the
ProtocolManager.setIMListener(IMListener)
method.
IMListener
,
Serialized FormConstructor Summary | |
protected |
IMAdapter()
Default constructor. |
Method Summary | |
void |
buddyAdded(Buddy buddy)
Invoked when a buddy was successfully added to your buddy list. |
void |
buddyAddFailed(Buddy buddy,
java.lang.String reasonMessage)
Invoked when an attempt to add a buddy failed. |
void |
buddyAddRejected(Buddy buddy,
java.lang.String reasonMessage)
Invoked when an attempt to add a buddy failed because the buddy rejected your request. |
Response |
buddyAddRequest(Buddy buddy,
Buddy myself,
java.lang.String message)
Invoked when a buddy wants to add you to his / her buddy list. |
void |
buddyDeleted(Buddy buddy)
Invoked when a buddy was successfully deleted from your buddy list. |
void |
buddyDeleteFailed(Buddy buddy,
java.lang.String reasonMessage)
Invoked when an attempt to delete a buddy failed. |
void |
buddyIgnored(Buddy buddy)
Invoked when a buddy was successfully ignored. |
void |
buddyIgnoreFailed(Buddy buddy,
java.lang.String reasonMessage)
Invoked when an attempt to ignore a buddy failed. |
void |
buddyListReceived(Protocol protocol,
Buddy[] buddies)
Invoked when your buddy list is received after a successful login. |
void |
buddyStatusChanged(Buddy buddy)
Invoked when the status information of a buddy is changed. |
void |
buddyUnignored(Buddy buddy)
Invoked when a buddy was successfully unignored. |
void |
buddyUnignoreFailed(Buddy buddy,
java.lang.String reasonMessage)
Invoked when an attempt to unignore a buddy failed. |
void |
conferenceClosed(Conference conf)
Invoked when a conference session is closed, either by the protocol or by a buddy who is authorized to do so. |
void |
conferenceInvitationAccepted(Conference conf,
Buddy buddy)
Invoked when a buddy accepts a conference invitation. |
void |
conferenceInvitationDeclined(Conference conf,
Buddy buddy,
java.lang.String message)
Invoked when a buddy declines a conference invitation. |
Response |
conferenceInvitationReceived(Conference conf,
java.lang.String message)
Invoked when a buddy invites you for a conference. |
void |
conferenceMessageReceived(Conference conf,
Buddy buddy,
Message message)
Invoked when an instant message arrives at a conference. |
void |
conferenceParticipantJoined(Conference conf,
Buddy buddy)
Invoked when a buddy joins a conference. |
void |
conferenceParticipantLeft(Conference conf,
Buddy buddy)
Invoked when a buddy leaves from a conference. |
void |
connected(Protocol protocol)
Invoked when a protocol completes the start up successfully. |
void |
connectFailed(Protocol protocol,
java.lang.String reasonMessage)
Invoked when a protocol failed during the start up. |
void |
connecting(Protocol protocol)
Invoked when a protocol attempts start up. |
void |
disconnected(Protocol protocol)
Invoked when a protocol is disconnected. |
void |
ignoreListReceived(Protocol protocol,
Buddy[] buddies)
Invoked when a list of buddies whom you have ignored is received, after a successful login. |
void |
instantMessageReceived(Buddy buddy,
Message message)
Invoked when an instant message is received. |
void |
mailNotificationReceived(Protocol protocol,
int count,
java.lang.String[] from,
java.lang.String[] subject)
Invoked when an e-mail notification arrives. |
void |
offlineMessageReceived(Buddy buddy,
java.util.Date time,
Message message)
Invoked when an offline message is received. |
void |
protocolMessageReceived(Protocol protocol,
Message message)
Invoked when the underlying protocol system sends a notification to the user. |
void |
typingStarted(Buddy buddy)
Invoked when a buddy starts typing. |
void |
typingStopped(Buddy buddy)
Invoked when a buddy stops typing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected IMAdapter()
Method Detail |
public void connecting(Protocol protocol)
connecting
in interface IMListener
protocol
- the protocol which is starting up.public void connected(Protocol protocol)
connected
in interface IMListener
protocol
- the protocol which was started up.public void connectFailed(Protocol protocol, java.lang.String reasonMessage)
connectFailed
in interface IMListener
protocol
- the protocol which failed.reasonMessage
- the reason for the failure as a string.public void disconnected(Protocol protocol)
disconnected
in interface IMListener
protocol
- the protocol which is disconnected.public Response buddyAddRequest(Buddy buddy, Buddy myself, java.lang.String message)
Response
object which describes whether the request
was allowed or disallowed, and if it was disallowed, an explanation
for that.
Not all protocols notify the user when somebody adds him / her to
their buddy list. In that case this method will not be invoked.
To check whether a protocol supports this, use
Protocol.isBuddyAddRequestSupported()
method.
buddyAddRequest
in interface IMListener
buddy
- the buddy who is trying to add you.myself
- the buddy object corresponding to this user.message
- the message sent along with this request.
public void buddyAdded(Buddy buddy)
buddyAdded
in interface IMListener
buddy
- the buddy who was added to your buddy list.public void buddyAddRejected(Buddy buddy, java.lang.String reasonMessage)
buddyAddRejected
in interface IMListener
buddy
- the buddy whom you tried to add to your buddy list.reasonMessage
- the explanation provided by the buddy. If the
buddy did not provide any explanation, this
will be null.public void buddyAddFailed(Buddy buddy, java.lang.String reasonMessage)
buddyAddFailed
in interface IMListener
buddy
- the buddy whom you tried to add to your buddy list.reasonMessage
- the reason for the failure as a string.public void buddyDeleted(Buddy buddy)
buddyDeleted
in interface IMListener
buddy
- the buddy who was deleted from your buddy list.public void buddyDeleteFailed(Buddy buddy, java.lang.String reasonMessage)
buddyDeleteFailed
in interface IMListener
buddy
- the buddy whom you tried to delete from your buddy list.reasonMessage
- the reason for the failure as a string.public void buddyIgnored(Buddy buddy)
Not all protocols support ignoring buddies. If a specific protocol
does not support ignoring, this method will not be invoked. To
identify whether this method is supported, use
Protocol.isIgnoreSupported()
method.
buddyIgnored
in interface IMListener
buddy
- the buddy who was ignored.public void buddyIgnoreFailed(Buddy buddy, java.lang.String reasonMessage)
Not all protocols support ignoring buddies. If a specific protocol
does not support ignoring, this method will not be invoked. To
identify whether this method is supported, use
Protocol.isIgnoreSupported()
method.
buddyIgnoreFailed
in interface IMListener
buddy
- the buddy whom you tried to ignore.reasonMessage
- the reason for the failure as a string.public void buddyUnignored(Buddy buddy)
Not all protocols support ignoring buddies. If a specific protocol
does not support ignoring, this method will not be invoked. To
identify whether this method is supported, use
Protocol.isIgnoreSupported()
method.
buddyUnignored
in interface IMListener
buddy
- the buddy who was unignored.public void buddyUnignoreFailed(Buddy buddy, java.lang.String reasonMessage)
Not all protocols support ignoring buddies. If a specific protocol
does not support ignoring, this method will not be invoked. To
identify whether this method is supported, use
Protocol.isIgnoreSupported()
method.
buddyUnignoreFailed
in interface IMListener
buddy
- the buddy whom you tried to add to your buddy list.reasonMessage
- the reason for the failure as a string.public void buddyStatusChanged(Buddy buddy)
getStatus()
method on the buddy
object.
buddyStatusChanged
in interface IMListener
buddy
- the buddy whose status information was changed.public void instantMessageReceived(Buddy buddy, Message message)
instantMessageReceived
in interface IMListener
buddy
- the buddy who sent this message.message
- the message that was received.public void buddyListReceived(Protocol protocol, Buddy[] buddies)
buddyListReceived
in interface IMListener
protocol
- the underlying protocol from which this notification
was originated.buddies
- the list of buddies.public void ignoreListReceived(Protocol protocol, Buddy[] buddies)
Not all protocols support ignoring buddies. If a specific protocol
does not support ignoring, this method will not be invoked. To
identify whether this method is supported, use
Protocol.isIgnoreSupported()
method.
ignoreListReceived
in interface IMListener
protocol
- the underlying protocol from which this notification
was originated.buddies
- the list of buddies who are in your ignore list.public void offlineMessageReceived(Buddy buddy, java.util.Date time, Message message)
Protocol.isOfflineMessageSupported()
method.
offlineMessageReceived
in interface IMListener
buddy
- the buddy who sent this message.time
- the time when this message was sent by the buddy.message
- the message that was received.public void protocolMessageReceived(Protocol protocol, Message message)
protocolMessageReceived
in interface IMListener
protocol
- the underlying protocol from which this notification
was originated.message
- the message that was received.public void typingStarted(Buddy buddy)
Protocol.isTypingNotifySupported()
method.
typingStarted
in interface IMListener
buddy
- the buddy who started typing.public void typingStopped(Buddy buddy)
Protocol.isTypingNotifySupported()
method.
typingStopped
in interface IMListener
buddy
- the buddy who stopped typing.public Response conferenceInvitationReceived(Conference conf, java.lang.String message)
Response
object which describes whether the request was allowed or disallowed,
and if it was disallowed, an explanation for that.
Not all protocols support conferences. If a specific protocol does not
support conferences, this method will not be invoked. To check whether
a protocol supports conferences or not, use
Protocol.isConferenceSupported()
method.
conferenceInvitationReceived
in interface IMListener
conf
- an object representing this conference.message
- an invitation message from the host.public void conferenceInvitationDeclined(Conference conf, Buddy buddy, java.lang.String message)
Protocol.isConferenceSupported()
method.
conferenceInvitationDeclined
in interface IMListener
conf
- an object representing this conference.buddy
- the buddy who declined.message
- a message from the buddy explaining why (s)he did not join.public void conferenceInvitationAccepted(Conference conf, Buddy buddy)
Not all protocols support conferences. If a specific protocol does not
support conferences, this method will not be invoked. To check whether
a protocol supports conferences or not, use
Protocol.isConferenceSupported()
method.
conferenceInvitationAccepted
in interface IMListener
conf
- an object representing this conference.buddy
- the buddy who accepeted the invitation.public void conferenceMessageReceived(Conference conf, Buddy buddy, Message message)
Protocol.isConferenceSupported()
method.
conferenceMessageReceived
in interface IMListener
conf
- an object representing this conference.buddy
- the buddy who sent this message.message
- the instant message that was received.public void conferenceParticipantJoined(Conference conf, Buddy buddy)
Protocol.isConferenceSupported()
method.
conferenceParticipantJoined
in interface IMListener
conf
- an object representing this conference.buddy
- the buddy who joined the conference.public void conferenceParticipantLeft(Conference conf, Buddy buddy)
Protocol.isConferenceSupported()
method.
conferenceParticipantLeft
in interface IMListener
conf
- an object representing this conference.buddy
- the buddy who left the conference.public void mailNotificationReceived(Protocol protocol, int count, java.lang.String[] from, java.lang.String[] subject)
Protocol.isMailNotifySupported()
method.
The parameter count
specifies the number of mails. If this
is -1, it means that the number of mails is not known. The parameter
from
is a list of e-mail addresseswho are the senders of each
e-mail message, in order. The parameter subject
is the
subject line of each e-mail message, in order. Both these parameters can
be null, indicating that the from addresses or subject lines are not
known.
mailNotificationReceived
in interface IMListener
protocol
- the underlying protocol from which this notification
was originated.count
- the number of e-mails received. If this is -1, the number
of e-mails is not known.from
- the senders' e-mail addresses. If this is null, the
sender addresses are unknown.subject
- the subject lines of the e-mails. If this is null, the
subject lines are unknown.public void conferenceClosed(Conference conf)
conferenceClosed
in interface IMListener
conf
- the conference that is closed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |