Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  IBM Sametime Forum

IBM Sametime Forum

developerWorks

  

PreviousPrevious NextNext

RE: What is Sametime's equivalent of Show Users?
Carl Tyler 20.Feb.14 11:13 AM Lotus Notes
Administration All Releases All Platforms


Nothing really as simple as show users within Sametime.

Here is a simple Sametime Community Server Java app which will show the current logged in users, it is basically a modified HackersCatcher Example. Here is a downloadable Jar file http://www.epilio.com/web/liu.htm


/*
* Carl Tyler
* www.Epilio.com
*
* Purely provided as sample code, no warranty implied or given.
*/

import com.lotus.sametime.core.comparch.*;
import com.lotus.sametime.core.types.*;
import com.lotus.sametime.community.*;
import com.lotus.sametime.communityevents.*;
import com.lotus.sametime.core.util.connection.*;


/**
* A sample of the community events service. Shows currently Loggedin users.
*/
public class LoggedInUsers implements LoginListener,
CommunityEventsServiceListener, UserLoginListener
{
/**
* The session object.
*/
private STSession m_session;

/**
* The server application service.
*/
private ServerAppService m_saService;

/**
* The Community events component
*/
CommunityEventsService m_ceService;

private void run(String serverName)
{
// init the sametime session and load the services
// First, we create a new session, that belongs uniquely to us.
try
{
m_session = new STSession("" + this );
String [] compNames = { ServerAppService.COMP_NAME,
CommunityEventsService.COMP_NAME };

m_session.loadComponents( compNames );

m_saService = (ServerAppService)
m_session.getCompApi(ServerAppService.COMP_NAME);
m_ceService = (CommunityEventsService)
m_session.getCompApi(CommunityEventsService.COMP_NAME);
}
catch (DuplicateObjectException e)
{
System.out.println("STSession or Components created twice.");
}

// start the session
m_session.start();

// Login to sametime
m_saService.addLoginListener( this);
short loginType = STUserInstance.LT_SERVER_APP;

// The default connection is configured to connect through the Sametime
// mux. We want to connect directly to the server, so we have to set
// the port explicitly.
Connection[] connections = {new SocketConnection(1516, 17000),};
m_saService.setConnectivity(connections);
m_saService.loginAsServerApp( serverName, loginType, "Hacker Catcher", null);
}

/**
* Logged in to Sametime.
*/
public void loggedIn(LoginEvent event)
{
m_ceService.addCommunityEventsServiceListener(this);
m_ceService.addUserLoginListener(this);

}

/**
* Logged out from Sametime.
*/
public void loggedOut(LoginEvent event)
{
m_ceService.removeCommunityEventsServiceListener(this);
}

/**
* The community events service is available.
*/
public void serviceAvailable(CommunityEventsServiceEvent event)
{
System.out.println("************** Start recording *************");

//m_ceService.addUserLoginFailedListener(this);
}

/**
* The community events service is unavailable.
*/
public void serviceUnavailable(CommunityEventsServiceEvent event)
{
System.out.println("************** finish recording *************");

// m_ceService.removeLoginFailedListener(this);
}

/**
* Entry point of the application
*/
public static void main(String[] args)
{
if ( args.length != 1 )
{
System.out.println("Usage: LoggedInUsers serverName");
System.exit(0);
}

new LoggedInUsers().run(args[0]);
}

public void userLoggedIn(UserLoginEvent event) {
// TODO Auto-generated method stub

String s = "Name=" + event.getUserInstance().getName();
s += ", ip=" + event.getUserInstance().getIp();
s += ", type=" + Integer.toHexString(event.getUserInstance().getLoginType());

System.out.println(s);
}

public void userLoggedOut(UserLoginEvent arg0) {
// TODO Auto-generated method stub

}
}




What is Sametime's equivalent of Sh... (Rob Berendt 20.Feb.14)
. . RE: What is Sametime's equivalent o... (Carl Tyler 20.Feb.14)
. . RE: What is Sametime's equivalent o... (Ben Williams 20.Feb.14)
. . . . RE: What is Sametime's equivalent o... (Rob Berendt 20.Feb.14)
. . . . . . RE: What is Sametime's equivalent o... (Ben Williams 21.Feb.14)
. . . . . . . . RE: What is Sametime's equivalent o... (Rob Berendt 3.Dec.15)
. . . . . . . . . . RE: What is Sametime's equivalent o... (Barry Shapiro 3.Dec.15)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite