com.bowstreet.webapp.util
Interface UserInfo


public interface UserInfo

Interface for Factory WebApp User Info retrieval. The engine has no knowledge of where users come from, and relies on the AppServers to support flexible/extensible user registry integration. But, WebApp Modellers would like a common way to retrieve user information (eg, username) no matter where it comes from. This interface allows custom handlers to be written which may obtain any number of user attributes from an external user registry. A WebApp model developer gets an instance of one of these handlers via public UserInfo WebAppAccess.getUserInfo(); Note - this is the application developers version of the UserInfo handler interface. Handler implementors must implement UserInfoHandler.java


Field Summary
static java.lang.String USER_ID
          Constant for the user id attribute that all handlers must support
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attributeName)
          getAttribute Return the attribute value for the specified attribute name.
 java.util.Iterator getKnownAttributeNames()
          getKnownAttributeNames Return an iterator over a list of strings representing the known (to the particular custom instance of the handler) attribute types/names to be used with getAttribute(String attributeName) below.
 java.lang.String getUserID()
          getUserID Get a String representation of the userID/username - the primary identity key that the caller is authenticated with.
 

Field Detail

USER_ID

static final java.lang.String USER_ID
Constant for the user id attribute that all handlers must support

See Also:
Constant Field Values
Method Detail

getAttribute

java.lang.Object getAttribute(java.lang.String attributeName)
getAttribute Return the attribute value for the specified attribute name. In most cases, the return value will always be a java.lang.String, but the interface allows for the return value to be any Object derivation, to allow for custom handlers to pass back custom objects (eg, X509Certificate object in a PKI implementation) where callers can make use of such data.

Parameters:
attributeName - attribute name (eg, "username")
Returns:
java.lang.Object usually a string value but may be a custom Object type, but may be null if no attribute found with that name for this user.

getKnownAttributeNames

java.util.Iterator getKnownAttributeNames()
getKnownAttributeNames Return an iterator over a list of strings representing the known (to the particular custom instance of the handler) attribute types/names to be used with getAttribute(String attributeName) below. The list will likely be specific to each custom handler, but should always include at least "username" (which can represent a requestor id if this is a server to server scenario with no users), so modellers can rely on at least one common piece of information across all user registries and all UserInfo handlers.

Returns:
java.util.Iterator

getUserID

java.lang.String getUserID()
getUserID Get a String representation of the userID/username - the primary identity key that the caller is authenticated with.

Returns:
String username / userid or null if user not authenticated.


Copyright © 2009 IBM. All Rights Reserved.