SiteMinder
Java SDK r12.51


com.netegrity.policyserver.smapi
Class SmSessionServer

java.lang.Object
  extended by com.netegrity.policyserver.smapi.SmSessionServer

public class SmSessionServer
extends java.lang.Object

This class implements the Java Session Server API.

Since:
SiteMinder 6.0 SP3

Field Summary
static int CLOSED_DISABLED
           
static int CLOSED_EXPIRED
           
static int CLOSED_IDLEOUT
           
static int CLOSED_LOGOUT
           
static int CLOSED_NO
           
static int CLOSED_REVOKED
           
static int CLOSED_UNKNOWN
           
static int RETCODE_BAD_INPUT
           
static int RETCODE_DB_IO
           
static int RETCODE_NOT_INITTED
           
static int RETCODE_OK
           
static int RETCODE_UNKNOWN
           
 
Constructor Summary
SmSessionServer(APIContext context)
          Constructs a SmSessionServer object based on the APIContext object.
SmSessionServer(long lpApiContext)
          Constructs a SmSessionServer object based on the C pointer to the API context.
 
Method Summary
 boolean createSession(java.lang.String sessionID, int expirationTime, int maxIdleTime, int lastTouch, java.lang.String blob)
          Creates a session in the session store.
 boolean deleteNameIDSession(java.lang.String id)
          Delete the NameID/Session mapping.
 boolean deleteSession(java.lang.String sessionID, int reason)
          Deletes a session from the session store.
 boolean deleteVariable(java.lang.String sessionID, java.lang.String varName, int[] reason)
          Deletes a session variable from the session store.
 boolean generateSessionID(java.lang.String[] sessionID)
          Generates a valid Session ID.
 boolean getNameIDSession(java.lang.String nameID, java.lang.String spID, java.lang.String[] sessionID)
          Retrieve the sessionID which is mapped to the provided NameID from the expiry data table.
 boolean getSession(java.lang.String sessionID, int[] expirationTime, int[] maxIdleTime, int[] lastTouch, java.lang.String[] blob, int[] reason)
          Obtains a session's parameters from the session store.
 boolean getStatus(java.lang.String sessionID, int[] status)
          Obtains the session's status.
 boolean getVariable(java.lang.String sessionID, java.lang.String varName, java.lang.String[] varValue, int[] reason)
          Obtains a session variable's value.
 boolean init()
          Initializes the Session Server.
 boolean keepAlive(java.lang.String sessionID, int[] reason)
          Updates the session's modification time to keep it alive.
 boolean matchVariables(java.lang.String sessionID, java.lang.String pattern, java.lang.String[] varNames, java.lang.String[] varValues, int[] totalSize, int[] reason)
          Matches session variables by name.
 boolean persistArtifactNoSession(java.lang.String artifactID, java.lang.String samlResponse, long timeout)
          Persists an artifact created for a sessionless response to the expiry table.
 boolean queryVersion(int[] version)
          Returns the Session Server's version.
 void release()
          Releases the Session Server.
 boolean removeSessionID(java.lang.String userName, java.lang.String issuerName, java.lang.String sessionIndex)
          Removes the indicated session ID from the expiry table.
 boolean retrieveNoSessionResponse(java.lang.String artifactID, java.lang.String[] samlResponse)
          Retrieves an artifact created for a sessionless response from the expiry table.
 boolean retrieveSessionID(java.lang.String userName, java.lang.String issuerName, java.lang.String sessionIndex, java.lang.String[] sessionID)
          Retrieves a session ID from the expiry table that is mapped to the indicated user, partnership, and remote sessionIndex.
 boolean retrieveSessionIDs(java.lang.String userName, java.lang.String issuerName, java.util.List sessionIDs)
          Retrieves a session ID from the expiry table that is mapped to the indicated user, partnership, and remote sessionIndex.
 boolean setNameIDSession(java.lang.String nameID, java.lang.String spID, java.lang.String sessionID, long expirationTime)
          Set the NameID->SessionID mapping in the expiry data table.
 boolean setSessionID(java.lang.String userName, java.lang.String issuerName, java.lang.String sessionIndex, java.lang.String sessionID, long timeout)
          Saves the indicated session ID to the expiry table.
 boolean setStatus(java.lang.String sessionID, int status)
          Modifies the session's status.
 boolean setVariable(java.lang.String sessionID, java.lang.String varName, java.lang.String varValue, int[] reason)
          Adds a session variable to the session.
 boolean updateSession(java.lang.String sessionID, int expirationTime, int maxIdleTime, int lastTouch, java.lang.String blob)
          Updates a session in the session store.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETCODE_OK

public static final int RETCODE_OK
See Also:
Constant Field Values

RETCODE_NOT_INITTED

public static final int RETCODE_NOT_INITTED
See Also:
Constant Field Values

RETCODE_BAD_INPUT

public static final int RETCODE_BAD_INPUT
See Also:
Constant Field Values

RETCODE_DB_IO

public static final int RETCODE_DB_IO
See Also:
Constant Field Values

RETCODE_UNKNOWN

public static final int RETCODE_UNKNOWN
See Also:
Constant Field Values

CLOSED_NO

public static final int CLOSED_NO
See Also:
Constant Field Values

CLOSED_UNKNOWN

public static final int CLOSED_UNKNOWN
See Also:
Constant Field Values

CLOSED_LOGOUT

public static final int CLOSED_LOGOUT
See Also:
Constant Field Values

CLOSED_EXPIRED

public static final int CLOSED_EXPIRED
See Also:
Constant Field Values

CLOSED_IDLEOUT

public static final int CLOSED_IDLEOUT
See Also:
Constant Field Values

CLOSED_REVOKED

public static final int CLOSED_REVOKED
See Also:
Constant Field Values

CLOSED_DISABLED

public static final int CLOSED_DISABLED
See Also:
Constant Field Values
Constructor Detail

SmSessionServer

public SmSessionServer(long lpApiContext)
Constructs a SmSessionServer object based on the C pointer to the API context.

Parameters:
lpApiContext - The C pointer to the API context.

SmSessionServer

public SmSessionServer(APIContext context)
Constructs a SmSessionServer object based on the APIContext object.

Parameters:
context - The APIContext object.
Method Detail

init

public boolean init()
Initializes the Session Server. It is safe to call it multiple times.

Returns:
A boolean value indicating whether the Session Server is initialized.

queryVersion

public boolean queryVersion(int[] version)
Returns the Session Server's version.

Parameters:
version - The output array containing the version value as its first element.
Returns:
A boolean value indicating whether the call was successful.

release

public void release()
Releases the Session Server. WARNING: Calling this function will cause the Session Server to shutdown for all clients.


generateSessionID

public boolean generateSessionID(java.lang.String[] sessionID)
Generates a valid Session ID.

Parameters:
sessionID - The output array containing the session ID as its first element.
Returns:
A boolean value indicating whether the call was successful.

createSession

public boolean createSession(java.lang.String sessionID,
                             int expirationTime,
                             int maxIdleTime,
                             int lastTouch,
                             java.lang.String blob)
Creates a session in the session store.

Parameters:
sessionID - The session's ID.
expirationTime - The session's expiration time.
maxIdleTime - The session's maximal idle time.
lastTouch - The session's last modification time.
blob - The session's blob.
Returns:
A boolean value indicating whether the call was successful.

updateSession

public boolean updateSession(java.lang.String sessionID,
                             int expirationTime,
                             int maxIdleTime,
                             int lastTouch,
                             java.lang.String blob)
Updates a session in the session store.

Parameters:
sessionID - The session's ID.
expirationTime - The session's expiration time.
maxIdleTime - The session's maximal idle time.
lastTouch - The session's last modification time.
blob - The session's blob.
Returns:
A boolean value indicating whether the call was successful.

getSession

public boolean getSession(java.lang.String sessionID,
                          int[] expirationTime,
                          int[] maxIdleTime,
                          int[] lastTouch,
                          java.lang.String[] blob,
                          int[] reason)
Obtains a session's parameters from the session store.

Parameters:
sessionID - The session's ID.
expirationTime - The output array containing the session's expiration time as its first element.
maxIdleTime - The output array containing the session's maximal idle time as its first element.
lastTouch - The output array containing the session's last modification time as its first element.
blob - The output array containing the session's blob as its first element.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

deleteSession

public boolean deleteSession(java.lang.String sessionID,
                             int reason)
Deletes a session from the session store.

Parameters:
sessionID - The session's ID.
reason - The reason code for deleting the session.
Returns:
A boolean value indicating whether the call was successful.

keepAlive

public boolean keepAlive(java.lang.String sessionID,
                         int[] reason)
Updates the session's modification time to keep it alive.

Parameters:
sessionID - The session's ID.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

getStatus

public boolean getStatus(java.lang.String sessionID,
                         int[] status)
Obtains the session's status.

Parameters:
sessionID - The session's ID.
status - The output array containing the session's status as its first element.
Returns:
A boolean value indicating whether the call was successful.

setStatus

public boolean setStatus(java.lang.String sessionID,
                         int status)
Modifies the session's status.

Parameters:
sessionID - The session's ID.
status - The new session status.
Returns:
A boolean value indicating whether the call was successful.

setVariable

public boolean setVariable(java.lang.String sessionID,
                           java.lang.String varName,
                           java.lang.String varValue,
                           int[] reason)
Adds a session variable to the session.

Parameters:
sessionID - The session's ID.
varName - The session variable's name.
varName - The session variable's value.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

getVariable

public boolean getVariable(java.lang.String sessionID,
                           java.lang.String varName,
                           java.lang.String[] varValue,
                           int[] reason)
Obtains a session variable's value.

Parameters:
sessionID - The session's ID.
varName - The session variable's name.
varName - The output array containing the session variable's value as its first element.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

matchVariables

public boolean matchVariables(java.lang.String sessionID,
                              java.lang.String pattern,
                              java.lang.String[] varNames,
                              java.lang.String[] varValues,
                              int[] totalSize,
                              int[] reason)
Matches session variables by name. The output array containing the names of matching session variables has to be allocated before making the call. The total number of matching session variables is also returned, to be used in cases when more variables are found than can be contained in the allocated array.

Parameters:
sessionID - The session's ID.
pattern - The search pattern formatted as a SQL's 'LIKE' expression (use '%' as a wildcard).
varNames - The output array containing the names of matching session variables.
varValues - The output array containing the values of matching session variables.
totalSize - The output array containing the total number of matching session variables as its first element.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

persistArtifactNoSession

public boolean persistArtifactNoSession(java.lang.String artifactID,
                                        java.lang.String samlResponse,
                                        long timeout)
Persists an artifact created for a sessionless response to the expiry table.

Parameters:
artifact -
samlResponse -
status -
Returns:

retrieveNoSessionResponse

public boolean retrieveNoSessionResponse(java.lang.String artifactID,
                                         java.lang.String[] samlResponse)
Retrieves an artifact created for a sessionless response from the expiry table.

Parameters:
artifact -
samlResponse -
status -
Returns:

retrieveSessionID

public boolean retrieveSessionID(java.lang.String userName,
                                 java.lang.String issuerName,
                                 java.lang.String sessionIndex,
                                 java.lang.String[] sessionID)
Retrieves a session ID from the expiry table that is mapped to the indicated user, partnership, and remote sessionIndex.

Parameters:
userName -
issuerName -
sessionIndex - user/partnership combination will be returned.
sessionID -
Returns:

retrieveSessionIDs

public boolean retrieveSessionIDs(java.lang.String userName,
                                  java.lang.String issuerName,
                                  java.util.List sessionIDs)
Retrieves a session ID from the expiry table that is mapped to the indicated user, partnership, and remote sessionIndex.

Parameters:
userName -
issuerName -
sessionIndex - user/partnership combination will be returned.
sessionID -
Returns:

removeSessionID

public boolean removeSessionID(java.lang.String userName,
                               java.lang.String issuerName,
                               java.lang.String sessionIndex)
Removes the indicated session ID from the expiry table.

Parameters:
userName -
issuerName -
sessionIndex -
Returns:

setSessionID

public boolean setSessionID(java.lang.String userName,
                            java.lang.String issuerName,
                            java.lang.String sessionIndex,
                            java.lang.String sessionID,
                            long timeout)
Saves the indicated session ID to the expiry table.

Parameters:
userName -
issuerName -
sessionIndex -
sessionID -
timeout -
Returns:

deleteVariable

public boolean deleteVariable(java.lang.String sessionID,
                              java.lang.String varName,
                              int[] reason)
Deletes a session variable from the session store.

Parameters:
sessionID - The session's ID.
varNames - The session variable's name.
reason - The output array containing the status code as its first element.
Returns:
A boolean value indicating whether the call was successful.

setNameIDSession

public boolean setNameIDSession(java.lang.String nameID,
                                java.lang.String spID,
                                java.lang.String sessionID,
                                long expirationTime)
Set the NameID->SessionID mapping in the expiry data table. This function should assemble the following values for the call to callSetNameIDSession(): id = nameID:spID:sessionID searchData = nameID:spID data = sessionID

Parameters:
nameID -
spID -
sessionID -
expirationTime -

getNameIDSession

public boolean getNameIDSession(java.lang.String nameID,
                                java.lang.String spID,
                                java.lang.String[] sessionID)
Retrieve the sessionID which is mapped to the provided NameID from the expiry data table. This function should create the search data for the invocation of callGetNameIDSession as follows: searchData - nameID:spID

Parameters:
nameID -
spID -
sessionID -
Returns:

deleteNameIDSession

public boolean deleteNameIDSession(java.lang.String id)
Delete the NameID/Session mapping. The ‘id’ of the entry needs to be passed. The ‘id’ is represented by the following data: id = :

Parameters:
id -
Returns:

SiteMinder
Java SDK r12.51

Mon 04/08/2013

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