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.

m_saService.loginAsServerApp(host, loginType, RedPanelDiscussionConstants.PLACE_DISPLAY_NAME,supportedServices);}Before calling the loginAsServerApp() method, we establish connectivity to theSametime server by creating a new SocketConnection object and then callingthe setConnectivity() method of the ServerAppService class. We have to make adirect socket connect to the Sametime server to avoid connecting through aMUX. The socket connection is opened on port 1516, which is the port Sametimelistens on. The second parameter is the connection time-out setting. After weestablish connectivity, we call the loginAsServerApp() method. The methodtakes four input parameters. These parameters and their descriptions are listedin Table 8-2.Table 8-2 loginAsServerApp() parametersParameter Purpose Data typehost DNS name of the server to connect to. StringloginTypeThe type of login. In this example, we want tolog in as a server application, so we useSTUserInstance.LT_SERVER_APP.intappName The application name. StringserviceTypesList of service types that the serverapplication supports. Examples of servicetypes are chat, audio, video, and so on. Inthis example, we are only concerned with thecustom activity registering so we useRedPanelDiscussionConstants.ACTIVITY_TYPE.int[]Important: The serviceTypes parameter is where you declare the list ofservices that the server application will provide. In this application, we providean Activity, so we have include the activity type number in the list.If the log is successful, then the loggedIn() event will be triggered. We do nottake any action in this event except to write a message to the console.Figure 8-4 on page 206 summarizes the sequence of events when logging in asa server application.Chapter 8. Places and Place awareness 205

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

Saved successfully!

Ooh no, something went wrong!