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.

{}}while (isLoggedIn() == false && loginExpired == false);}// end doLogin()protected boolean isLoggedIn(){if (m_saService == null){return false;}return m_saService.isLoggedIn();}When the server application has logged in, the loggedIn() method is called. InExample 12-13, we create a Resolver object from the LookupServicecomponent, and remove ourselves as a LoginListener, as this is no longerrequired.Example 12-13 SametimeToken loggedIn() method// Event fired by successful login to server -public void loggedIn(LoginEvent event){System.out.println("LoggedIn()");m_resolver = m_lookupService.createResolver(true, // Return all matches.false, // Non-exhaustivelookup.true, // Return resolvedusers.resolved groups.m_saService.removeLoginListener(this);}false); // Do not returnControl then passes back to the getToken() method (Example 12-14 onpage 348) of the TokenGenerator object, and the getToken() method ofSametimeToken is called, as shown in Example 12-9 on page 344. ThegetToken() method adds the class as both a ResolveListener andTokenServiceListener. It attempts to resolve the user name to a valid Sametimeuser by calling the Resolver’s resolve() method. It then waits for the booleanm_bFinished flag to be set to true before continuing. It begins cleaning up byremoving itself as a TokenServiceListener and ResolveListener before loggingout from the server. Finally, it stops and unloads the Sametime session beforereturning the token to the TokenGenerator object.Chapter 12. Ideas for customization and integration 347

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

Saved successfully!

Ooh no, something went wrong!