10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

One of the toolkit official samples is called Basic Buddy List. You can find thesample code as one of the samples in the C++ or Java APIs. We reference thissample, because it serves as a basis for comparison between using the storageservice and using the BuddyList service. In the Basic Buddy List example,loading and saving the buddylist content from the server is accomplished byusing the Storage Service directly. Our purpose in this chapter is to present youan easier way to perform the same actions with less coding and with no internalknowledge regarding the attribute format in the server by using the BuddyListservice.We encourage you to compare the code in this chapter to the code in the BasicBuddy List sample. This will be the best demonstration on how you can write thesame code using two different services.Our recommendation is to use the BuddyList service for handling the buddylistattribute and using the storage service for all other attributes.The BL structureThe buddylist information is saved as a storage attribute on the server. Theattribute ID is 0 and the value is a long list with spatial separators for every field.The BL structure represents the user buddylist. This structure saves you theneed to know the string format. You will not have to parse the attribute string;instead, you will just need to use the documented object BL. This structure is ahierarchical representation of the user buddylist. The BL contains the buddylistgroups. There are two kinds of groups:►►Private group: Represented by the class PrivateGroup.Public group: Represented by the class PublicGroup.Both PublicGroup and PrivateGroup classes inherit the BLGroup class. ThePrivateGroup class contains lists of people, and every person is represented by aBLUser class.Note: A public group does not contain information about the list of peoplecontained within the group. We do not save this information in storage, since apublic group can contain hundreds of people and the content of the group maychange while the user is offline. Accordingly, it is not meaningful to save thisinformation. Instead, a client can always query a public group’s content byusing the LookupService.Chapter 7. BuddyList service 165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!