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.

else{System.out.println("Passed validation");}String strToken = getToken(strUserName);if (strToken.compareTo("Error") == 0){out.println("");out.println("Unable to generate Sametime Token for currentuser.");out.println("");out.println("");}else{out.println("");out.println("" + strToken + "");out.println("");out.println("");}}// end doGetThe getToken() method creates a new SametimeToken object, passing it theuser name as a parameter. It then calls the SametimeToken’s getToken()method.Example 12-9 TokenGenerator’s getToken() methodpublic String getToken(String strUserName) throws ServletException{SametimeToken myToken = new SametimeToken(strUserName);return myToken.getToken();}SametimeToken classThe SametimeToken class is a private class within the TokenGenerator class,and contains all the Sametime-specific code. It implements three Sametimelistener interfaces: the protected class SametimeToken implementsLoginListener, ResolveListener, and TokenServiceListenerThe TokenServiceListener contains the methods that handle the tokengeneration process. The class also defines a number of variables for theSametime objects it uses (Example 12-10 on page 345).344 <strong>Lotus</strong> <strong>Instant</strong> <strong>Messaging</strong>/<strong>Web</strong> <strong>Conferencing</strong> (Sametime): Building Sametime-Enabled Applications

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

Saved successfully!

Ooh no, something went wrong!