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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

POST request the ability to interact with your Sametime application, regardlessof the language or platform that the client uses.For example, imagine a Sametime application written using the Java ClientToolkit. This could be exposed as a <strong>Web</strong> service and hosted on an applicationserver, such as <strong>Web</strong>Sphere Application Server or Jakarta Tomcat. A clientwritten in Visual Basic or .NET could use this <strong>Web</strong> service to give itself onlineawareness and instant messaging capabilities.In the next section, we show a Sametime application built with the Java ClientToolkit that returns the online status of a user in the Sametime community. Wethen turn that application into a <strong>Web</strong> service using the tools that are included with<strong>Web</strong>Sphere Studio Application Developer. Finally, we show how you can deploythe <strong>Web</strong> service to <strong>Web</strong>Sphere Application Server so that it may be accessed by<strong>Web</strong> service clients of any description. We show how you can access the <strong>Web</strong>service from a sample JSP page created by <strong>Web</strong>Sphere Studio ApplicationDeveloper.4.3 Building the UserStatus applicationIn this section, we build a Java application using the Client Toolkit that, for agiven Sametime user, returns a numerical value indicating their current status,that is, Active, Away, Offline, and so on.The UserStatus application performs the following tasks as part of its execution:1. Logs in to the Sametime server.2. Resolves the user name, passed as a parameter to the application, to aSametime user STUser object.3. Gets and returns the current status of that STUser object in the Sametimecommunity.4. Logs out of the server.4.3.1 The UserStatus applicationThe class UserStatus starts by importing a number of Sametime-specificpackages, as shown in Example 4-1.Example 4-1 Package imports for UserStatus classimport com.lotus.sametime.awareness.*;import com.lotus.sametime.community.*;import com.lotus.sametime.core.comparch.*;import com.lotus.sametime.core.constants.*;86 <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!