SiteMinder
Java SDK r12.0 SP2


com.netegrity.sdk.apiutil
Class SmApiSession

java.lang.Object
  |
  +--com.netegrity.sdk.apiutil.SmApiSession

public class SmApiSession
extends java.lang.Object

Holds the session and connection information.

Since:
SDK 2.0

Constructor Summary
SmApiSession(SmApiConnection apiConnection)
          Creates a session object with a valid API connection.
SmApiSession(SmApiConnection apiConnection, java.lang.String sessionSpec)
          Create a session object with a valid API connection and a session specification.
 
Method Summary
 SmApiConnection getApiConnection()
          Gets an API connection.
 int getLicenseInfo(java.lang.String licenseFeature)
          For internal use only.
 java.lang.String getSessionSpec()
          Gets the session specification.
 SmApiResult login(java.lang.String username, java.lang.String password, java.net.InetAddress address, int challengeReason)
          Logs in with username and password.
 SmApiResult logout()
          Ends the SiteMinder administrator session.
 void setApiConnection(SmApiConnection apiConnection)
          Sets a valid API connection.
 void setSessionSpec(java.lang.String sessionSpec)
          Sets an existing session specification.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmApiSession

public SmApiSession(SmApiConnection apiConnection)
Creates a session object with a valid API connection. This constructor will not create a session specification.

Parameters:
apiConnection - Valid API connection.

SmApiSession

public SmApiSession(SmApiConnection apiConnection,
                    java.lang.String sessionSpec)
Create a session object with a valid API connection and a session specification.

Parameters:
apiConnection - Valid API connection.
sessionSpec - Session specification.
Method Detail

getApiConnection

public SmApiConnection getApiConnection()
Gets an API connection.

Returns:
SmApiConnection

setApiConnection

public void setApiConnection(SmApiConnection apiConnection)
Sets a valid API connection.

Parameters:
apiConnection - Valid API connection.
Returns:
void

login

public SmApiResult login(java.lang.String username,
                         java.lang.String password,
                         java.net.InetAddress address,
                         int challengeReason)
                  throws SmApiException

Logs in with username and password.

This login is for SiteMinder administrators. For login of other users (end users as well as DMS organization administrators and DMS super administrators), see login() in class AgentAPI of the Agent API.

Parameters:
username - Username of the person logging in.
password - Password of the person logging in.
address - IP address (in the format "%d.%d.%d.%d") of the machine where the administrator is logging in.
challengeReason - Assign values to this parameter as follows:
  • In an initial login attempt, set to 0.
  • If the initial login fails, use challengeReason in the next login() call to specify the result of the previous authentication attempt. To retrieve the result value to assign to challengeReason, call getReason()
Returns:
SmApiResult, which includes the reason code of the API result.

When an administrator login failure occurs, SmApiResult contains one of the following values:

  • 0. No failure reason.
  • 1. Need new password.
  • 2. Invalid session.
  • 3. Revoked session.
  • 4. Expired session.
  • 5. Authentication level too low.
  • 6. Unknown user.
  • 7. User account is disabled.
  • 8. Invalid session ID.
  • 9. Invalid sessino IP.
  • 10. Certificate revoked.
  • 11. CRL out of date.
  • 12. Certification revoked, key compromised.
  • 13. Certification revoked, affiliation changes.
  • 14. Certification on hold.
  • 15. Token card challenge.
  • 16. Impersonated user not in directory.
  • 17. Anonymous.
  • 18. Password will expire.
  • 19. Password expired.
  • 20. Immediate password change is required.
  • 21. Password change failed.
  • 22. Bad password change.
  • 23. Password change accepted.
  • 24. Excessive failed login attempts.
  • 25. Account inactivity.
  • 26. No redirection is configured.
  • 27. Error message is redirect.
  • 28. Next tokencode.
  • 29. New PIN select.
  • 30. New PIN System tokencode.
  • 31. New user PIN tokencode.
  • 32. New PIN accepted.
  • 33. Guest.
  • 34. Password self-change.
  • 35. Server exception.
  • 36. Unknown scheme.
  • 37. Unsupported scheme.
  • 38. Misconfigured.
  • 39. Buffer overflow.
  • 40. Persistent session creation failed.

Throws:
SmApiException

logout

public SmApiResult logout()
                   throws SmApiException

Ends the SiteMinder administrator session.

This logout is for SiteMinder administrators. For logout of other users (end users as well as DMS organization administrators and DMS super administrators), see logout() in class AgentAPI of the Agent API.

Returns:
SmApiResult
Throws:
SmApiException

setSessionSpec

public void setSessionSpec(java.lang.String sessionSpec)
                    throws SmApiException
Sets an existing session specification.

Parameters:
sessionSpec - Session specification.
Returns:
void
Throws:
SmApiException

getSessionSpec

public java.lang.String getSessionSpec()
Gets the session specification.

Returns:
String

getLicenseInfo

public int getLicenseInfo(java.lang.String licenseFeature)
                   throws SmApiException
For internal use only.
For an evaluation copy of the software, this method returns the number of days left in the evaluation period.

Parameters:
licenseFeature - Name of the license feature.
Returns:
Returns one of the following values:
  • -1. No license was found and the evaluation period has expired.
  • 0. A valid license was found.
  • A number greater than 0. The number of days left in the evaluation period.
Throws:
SmApiException

SiteMinder
Java SDK r12.0 SP2

Fri 11/06/2009

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