|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jabber.jabberbeans.RosterBean
RosterBean is a bean to gain and utilize the roster information in jabber. A 'Roster' is a list of users, a type of subscription list or address book, if you will. By using a roster, you can get the status of other users (online/offline, etc), subscribe and unsubscribe users, as well as change your own status.
This bean hooks into an IQBean, it will not work until it is given a ConnectionBean to handle. RosterBean to ConnectionBean is a many to one relation - one ConnectionBean can have many RosterBeans, but if software wants to use more than a singular server connection, there is need for multiple RosterBeans, one per ConnectionBean.
Inner Class Summary | |
(package private) class |
RosterBean.RosterPacketListener
class RosterPacketListener filters out received packets
and outputs only those which contain roster information, through the
RosterListener vector. |
Field Summary | |
private IQBean |
connection
parent connection class, an IQBean |
private java.util.Hashtable |
currentRoster
we use the roster extension object to store our current roster. |
private InfoQueryBuilder |
IQBuilder
an infoquery builder for sending roster change requests. |
private RosterBean.RosterPacketListener |
listener
Internal object for processing the PacketListener events |
private RosterBuilder |
rosterBuilder
a roster extension builder for sending roster change requests. |
private RosterItemBuilder |
rosterItemBuilder
a roster item builder for sending custom roster changes. |
private java.util.Vector |
rosterListeners
roster subscribed listener list |
Constructor Summary | |
RosterBean()
Default do-nothing constructor. |
Method Summary | |
void |
addRosterItem(RosterItem ri)
addRosterItem adds one precreated roster item to the
roster, as stored on the server. |
void |
addRosterListener(RosterListener l)
addRosterListener registers a class supporting
RosterListener to receive events from this bean. |
void |
delRosterItem(RosterItem ri)
delRosterItem deletes a roster item. |
void |
delRosterListener(RosterListener l)
delRosterListener unregisters a RosterListener from
receiving events from this bean. |
java.util.Enumeration |
entries()
returns the entries int the maintained roster cache. |
private void |
fireUserRosterChanged(Roster r)
fireUserRosterChanged is a helper method to notify all
subscribed RosterListener objects that the roster has been altered. |
private void |
fireUserRosterReplaced(Roster r)
fireUserRosterReplaced is a helper method to notify all
subscribed RosterListener objects that the roster has been completely
reloaded |
IQBean |
getIQBean()
getIQBean returns the currently set parent bean, if any |
void |
refreshRoster()
refreshRoster does a complete reload of the user roster. |
void |
setIQBean(IQBean connection)
setIQBean sets the IQBean 'parent' for this class, which
is used to send and receive events from the interface with the jabber
server. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private IQBean connection
private java.util.Vector rosterListeners
private java.util.Hashtable currentRoster
private InfoQueryBuilder IQBuilder
private RosterBuilder rosterBuilder
private RosterItemBuilder rosterItemBuilder
private RosterBean.RosterPacketListener listener
Constructor Detail |
public RosterBean()
Method Detail |
public void setIQBean(IQBean connection)
setIQBean
sets the IQBean 'parent' for this class, which
is used to send and receive events from the interface with the jabber
server.connection
- an IQBean
public IQBean getIQBean()
getIQBean
returns the currently set parent bean, if anyIQBean
value, or null if none has been set.public void refreshRoster() throws java.lang.InstantiationException
refreshRoster
does a complete reload of the user roster.public void addRosterItem(RosterItem ri) throws java.lang.InstantiationException
addRosterItem
adds one precreated roster item to the
roster, as stored on the server. A response will be sent by the server,
which will trigger a changed event on any registered RosterListener
interface.ri
- a RosterItem
object to addpublic void delRosterItem(RosterItem ri) throws java.lang.InstantiationException
delRosterItem
deletes a roster item. The rosterItem can
be taken directly from a valid Roster Extension object.
The server will respond to this, at which time any registered
RosterListener interfaces will be notified via a 'changed' type event.ri
- a RosterItem
to deletepublic void addRosterListener(RosterListener l)
addRosterListener
registers a class supporting
RosterListener to receive events from this bean.l
- a RosterListener
to registerpublic void delRosterListener(RosterListener l)
delRosterListener
unregisters a RosterListener from
receiving events from this bean.l
- a RosterListener
to unregisterpublic java.util.Enumeration entries()
entries
int the maintained roster cache.Enumeration
of RosterItemsprivate void fireUserRosterChanged(Roster r)
fireUserRosterChanged
is a helper method to notify all
subscribed RosterListener objects that the roster has been altered.r
- an Roster Extension
value holding a description
of changes made.private void fireUserRosterReplaced(Roster r)
fireUserRosterReplaced
is a helper method to notify all
subscribed RosterListener objects that the roster has been completely
reloadedr
- an Roster Extension
after reloading.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |