Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
When a user logs in, there is a record added to the database in the AUDITRECORD table. I assume some java code is executed when a user logs in, to put that record in the database.
I was thinking about leveraging this API to do some additional things, such as check the user's preferred file server (their vaulting preference). I could add additional code to this java class do what I desire. But first I need to determine what API is triggered during the login.
Anyway have ideas of which API(s) are triggered during user login?
Whenever a user logs in I think SessionUserAuditEvent.LOGIN event is fired. See if you can do what you want in this event listener.
Abdul,
Thanks. I added a System.out.println() statement to SessionUserAuditEvent(), but I didn't see anything in the MS or BMS logs. Should I expect to see something there? Or somewhere else?
public SessionUserAuditEvent(String paramString, WTPrincipalReference paramWTPrincipalReference, long paramLong, int paramInt)
{
super(paramString);
this.event = paramString;
this.user = paramWTPrincipalReference;
this.time = paramLong;
this.concurrency = paramInt;
System.out.println("\n\n\n\n\nMyStatement\n\n\n\n\n");
}
Abdul,
Nevermind. I'm an idiot.
After the Windchill restart, I refreshed a page, and "My Statement" was printed to the foreground MS log. This is a start. I might have more questions later.
Abdul,
A few observations after running it for a little while today...
FYI...Here are my current modifications to wt.session.SessionUserAuditEvent:
public SessionUserAuditEvent(String paramString, WTPrincipalReference paramWTPrincipalReference, long paramLong, int paramInt)
{
super(paramString);
this.event = paramString;
this.user = paramWTPrincipalReference;
this.time = paramLong;
this.concurrency = paramInt;
// START ADDITION
System.out.println("\n\n\n");
System.out.println("Login event for " + user.getIdentity());
System.out.println("\n\n\n");
// END ADDITION
}
Hi Ben,
Was the user inactive. Looks like there was no activity and the session was timeout after a certain interval defined by wt.session.sessionUsers.timeout property, you can add log-out event to check if that was the case.
Regards,
Bhushan