001 /* 002 * Copyright 2008-2009 the original author or authors. 003 * The contents of this file are subject to the Mozilla Public License 004 * Version 1.1 (the "License"); you may not use this file except in 005 * compliance with the License. You may obtain a copy of the License at 006 * http://www.mozilla.org/MPL/ 007 * 008 * Software distributed under the License is distributed on an "AS IS" 009 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 010 * License for the specific language governing rights and limitations 011 * under the License. 012 */ 013 014 package com.mtgi.analytics; 015 016 /** 017 * Provides contextual information for behavior tracking purposes about a user 018 * (or other principal) acting on an application. Usually principal 019 * name and session ID can be determined using standard java.security 020 * and servlet APIs; this interface provides a layer of abstraction so 021 * that custom application authentication schemes can be integrated into 022 * the behavior tracking library. 023 * 024 * @see BehaviorTrackingManager 025 */ 026 public interface SessionContext { 027 /** get the user ID currently associated with the calling thread, if any */ 028 public String getContextUserId(); 029 /** 030 * If the calling thread is currently working on an authenticated session, 031 * return the session ID. Otherwise return null. 032 */ 033 public String getContextSessionId(); 034 }