SiteMinder
Java SDK r12.51


com.netegrity.sdk.policyapi
Class SmUserContext

java.lang.Object
  extended by com.netegrity.sdk.policyapi.SmUserContext

public class SmUserContext
extends java.lang.Object

Allows to set and retrieve information about a user in a user directory. The information includes user attributes and directory attributes associated with the user.


Constructor Summary
SmUserContext()
          Construct a user context instance.
 
Method Summary
 java.lang.String authenticateUser(java.lang.String password)
          Authenticates a user whose context in the user directory has been established.
 java.lang.String authenticateUser(java.lang.String password, java.lang.StringBuffer errorMsgBuf)
          Authenticates a user whose context in the user directory has been established.
 java.lang.String getDirNameSpace()
          Retrieves the directory namespace, such as LDAP:, WinNT:, or ODBC:.
 java.lang.String getDirPath()
          Retrieves the directory path (in SiteMinder notation) of a SiteMinder user directory where the user's context was established.
 java.lang.String getDirServer()
          Retrieves the directory server of a SiteMinder user directory where user's context was established.
 java.lang.String getDnProp(java.lang.String dn, java.lang.String propName)
          Retrieves the value of the specified property of the specified DN.
 java.lang.String getProp(java.lang.String propName)
          Retrieves the value of the specified user property.
 java.lang.String getSessionID()
          Retrieves the session ID of the user session.
 java.lang.String getUserName()
          Retrieves the full distinguished name of the user.
 java.lang.String getUserPath()
          Retrieves the user path in SiteMinder notation.
 boolean setDnProp(java.lang.String dn, java.lang.String propName, java.lang.String value)
          Sets the property value of a directory object DN.
 boolean setProp(java.lang.String propName, java.lang.String value)
          Sets a value for the specified user property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmUserContext

public SmUserContext()
Construct a user context instance.

Method Detail

getUserName

public java.lang.String getUserName()

Retrieves the full distinguished name of the user.

Returns:
The full distinguished name of the user.

getUserPath

public java.lang.String getUserPath()

Retrieves the user path in SiteMinder notation.

SiteMinder notation has the following format:
    directory-namespace + server + / + user-DN
For example:
     ldap://server.company.com/uid=user1,ou=people,o=company.com

Returns:
The user path in SiteMinder notation.

getDirPath

public java.lang.String getDirPath()

Retrieves the directory path (in SiteMinder notation) of a SiteMinder user directory where the user's context was established.

Returns:
The directory path in SiteMinder notation.

getDirServer

public java.lang.String getDirServer()

Retrieves the directory server of a SiteMinder user directory where user's context was established.

Returns:
The directory server where the user's context was established.

getDirNameSpace

public java.lang.String getDirNameSpace()

Retrieves the directory namespace, such as LDAP:, WinNT:, or ODBC:.

Returns:
The directory namespace.

getSessionID

public java.lang.String getSessionID()

Retrieves the session ID of the user session.

Returns:
The session ID.

getDnProp

public java.lang.String getDnProp(java.lang.String dn,
                                  java.lang.String propName)
                           throws SmApiException

Retrieves the value of the specified property of the specified DN. The user whose context has been established must be associated with the DN (for example, the user is a member of a group).

Parameters:
DN - The DN of an object in the user directory. The user must be associated with this DN.
propName - The name of the DN property to retrieve.
Returns:
The value of the specified property, or null if not available. For information on the format of multiple values retrieved from a multi-valued LDAP attribute, see setProp().
Throws:
SmApiException

setDnProp

public boolean setDnProp(java.lang.String dn,
                         java.lang.String propName,
                         java.lang.String value)
                  throws SmApiException

Sets the property value of a directory object DN. The user whose context has been established must be associated with the object (for example, the user is a member of a group).

Parameters:
DN - The DN of an object in the user directory. The user must be associated with this DN.
propName - The name of the DN property to set.
value - The value to assign to the DN property. For information on setting multiple values in this parameter for an LDAP multi-valued attribute, see setProp().
Returns:
true if successful, or false if unsuccessful.
Throws:
SmApiException

getProp

public java.lang.String getProp(java.lang.String propName)
                         throws SmApiException

Retrieves the value of the specified user property.

Parameters:
propName - The name of the user property to retrieve.
Returns:
The value of the specified property, or null if not available. For information on the format of multiple values retrieved from a multi-valued LDAP attribute, see setProp().
Throws:
SmApiException

setProp

public boolean setProp(java.lang.String propName,
                       java.lang.String value)
                throws SmApiException

Sets a value for the specified user property.

When setting or retrieving multi-valued attributes in an LDAP user store, the values are presented in a single string, delimited by a carat character (^). For example, you might set three different telephone numbers in the value parameter as follows:
      "111-1234^111-5678^111-0000" 
Custom code that sets or retrieves multi-valued attributes must support the expected multi-valued string format.

Note: ODBC user stores do not support multi-valued attribute settings.

Parameters:
propName - The name of the user property to set.
value - The value to assign to the user property.
Returns:
true if successful, or false if unsuccessful.
Throws:
SmApiException

authenticateUser

public java.lang.String authenticateUser(java.lang.String password)
                                  throws SmApiException

Authenticates a user whose context in the user directory has been established.

Parameters:
password - The password to verify for this user.
Returns:
The user message, or null if authentication fails.
Throws:
SmApiException

authenticateUser

public java.lang.String authenticateUser(java.lang.String password,
                                         java.lang.StringBuffer errorMsgBuf)
                                  throws SmApiException

Authenticates a user whose context in the user directory has been established.

Parameters:
password - The password to verify for this user.
errorMsgBuf - Output buffer for error message.
Returns:
The user message, or null if authentication fails.
Throws:
SmApiException

SiteMinder
Java SDK r12.51

Mon 04/08/2013

http://ca.com
Copyright (c) 2013 CA.