|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hamsam.api.Buddy
A buddy is a person who is participating in instant messaging. A buddy is usually identified by a unique name in the underlying protocol's namespace.
Constructor Summary | |
Buddy(Protocol protocol,
java.lang.String username)
Construct a buddy object for a buddy with a specified protocol and username. |
|
Buddy(Protocol protocol,
java.lang.String username,
java.lang.String group)
Construct a buddy object for a buddy with a specified protocol, username, and group. |
Method Summary | |
void |
addToBuddyList()
Add this buddy to your buddy list. |
void |
changeAlias(java.lang.String alias)
Changes the alias name of this buddy. |
void |
deleteFromBuddyList()
Delete this buddy from your buddy list. |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this Buddy for equality. |
java.lang.String |
getAlias()
Returns the alias name of this buddy. |
java.lang.String |
getGroup()
Returns the group of this buddy. |
Protocol |
getProtocol()
Get the protocol used by this buddy. |
java.lang.String |
getStatus()
Get the status message for this buddy. |
java.lang.String |
getUsername()
Returns the username of this buddy. |
void |
ignore()
Prevent this buddy from sending you messages. |
void |
sendInstantMessage(Message message)
Send an instant message to this buddy. |
void |
setAlias(java.lang.String alias)
Set the alias name of this buddy. |
void |
setStatus(java.lang.String status)
Set the status message for this buddy. |
void |
typingStarted()
Notify this buddy that you have started typing. |
void |
typingStopped()
Notify this buddy that you have stopped typing. |
void |
unignore()
Undo a previous ignore operation for this buddy. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Buddy(Protocol protocol, java.lang.String username)
protocol
- the underlying protocol for this buddy.username
- the username of this buddy.public Buddy(Protocol protocol, java.lang.String username, java.lang.String group)
protocol
- the underlying protocol for this buddy.username
- the username of this buddy.group
- the group to which this buddy belongs to. If the
protocol does not support groups, this parameter is
ignored.Method Detail |
public java.lang.String getStatus()
IMListener.buddyStatusChanged(Buddy)
method.
null
if this buddy is offline.Protocol.changeStatus(String status)
public void setStatus(java.lang.String status)
status
- the status message.public java.lang.String getAlias()
null
.
Protocol.isBuddyNameAliasSupported
public void setAlias(java.lang.String alias)
changeAlias(newAlias)
instead.
Alias is also known as nick name. Alias is not unique in the namespace of a protocol. Not all protocols support aliases.
alias
- the alias name of this buddy.Protocol.isBuddyNameAliasSupported
public void changeAlias(java.lang.String alias) throws UnsupportedOperationException
UnSupportedOperationException
.
alias
- the new alias for this buddy
UnsupportedOperationException
public Protocol getProtocol()
public java.lang.String getUsername()
public java.lang.String getGroup()
public void addToBuddyList() throws IllegalArgumentException, IllegalStateException
IMListener
.
IllegalArgumentException
- if the protocol supports buddy groups and the
group of the buddy is not specified.
IllegalStateException
- if the protocol is not connected yetIMListener.buddyAddRequest
,
IMListener.buddyAdded
,
IMListener.buddyAddFailed
public void deleteFromBuddyList() throws IllegalArgumentException, IllegalStateException
IMListener
.
IllegalArgumentException
- if the protocol supports buddy groups and the
group of the buddy is not specified.
IllegalStateException
- if the protocol is not connected yetIMListener.buddyDeleted
,
IMListener.buddyDeleteFailed
public void ignore() throws UnsupportedOperationException, IllegalStateException
IMListener
.
UnsupportedOperationException
- if this protocol does not support ignoring buddies.
IllegalStateException
- if the protocol is not connected yetIMListener.buddyIgnored
,
IMListener.buddyIgnoreFailed
public void unignore() throws UnsupportedOperationException, IllegalStateException
IMListener
.
UnsupportedOperationException
- if this protocol does not support ignoring buddies.
IllegalStateException
- if the protocol is not connected yetIMListener.buddyUnignored
,
IMListener.buddyUnignoreFailed
public void sendInstantMessage(Message message) throws IllegalStateException
message
- the message to be sent.
IllegalStateException
- if the protocol is not yet connected.public void typingStarted() throws UnsupportedOperationException, IllegalStateException
UnsupportedOperationException
- if this protocol does not support
typing notifications.
IllegalStateException
- if the protocol is not connected yetpublic void typingStopped() throws UnsupportedOperationException, IllegalStateException
UnsupportedOperationException
- if this protocol does not support
typing notifications.
IllegalStateException
- if the protocol is not connected yetpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be compared for equality with this Buddy.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |