SiteMinder
Java SDK r12.0 SP2


com.netegrity.sdk.apiutil
Class SmApiConnection

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

public class SmApiConnection
extends java.lang.Object

Establishes the connection to the Policy Server and sends Java API requests to the Policy Server.

This class holds the Agent API handle through which Java API request are sent. The AgentAPI object is in the package netegrity.siteminder.javaagent. For background information about connections, see Establish a Connection to the Policy Server in the CA eTrust Java Developer's Guide.

There are two types of connection handles in this class:

If you want to use the default handle, call the SmApiConnnection constructor with defaultAgentConnection set to true. If you already established an Agent API handle, call the SmApiConnnection constructor that takes the Agent API handle as its only parameter.

Since:
SDK 2.0

Constructor Summary
SmApiConnection(AgentAPI agentApiConnection)
          Creates a user-defined Agent API connection.
SmApiConnection(boolean defaultAgentConnection, boolean disableLoadBalancing)
          Creates an API connection object and establishes a connection to the Policy Server.
 
Method Summary
 SmApiResult execute(java.lang.String sessionspec, SmApiConstants method, SmApiObject apiObj)
          Executes the API command request.
 SmApiResult execute(java.lang.String sessionspec, java.lang.String library, SmApiConstants method, SmApiObject apiObj)
          Executes the API command request.
 AgentAPI getAgentApiConnection()
          Gets an Agent API connection.
 boolean isValidApiConnection()
          Verifies whether a valid Agent API connection is available.
 void setAgentApiConnection(AgentAPI agentApiConnection)
          Sets an Agent API connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmApiConnection

public SmApiConnection(boolean defaultAgentConnection,
                       boolean disableLoadBalancing)
                throws SmApiException
Creates an API connection object and establishes a connection to the Policy Server.

Parameters:
defaultAgentConnection - Specifies the type of connection:
disableLoadBalancing - Specifies whether to disable load balancing for the Agent API connection, if any. If true, Java API calls can access the configured Policy Servers in failover mode. Otherwise, the existing agent configuration is preserved.
Throws:
SmApiException

SmApiConnection

public SmApiConnection(AgentAPI agentApiConnection)
Creates a user-defined Agent API connection. This connection handle overrides a default handle.

Parameters:
agentApiConnection - Valid AgentAPI handle.
Method Detail

setAgentApiConnection

public void setAgentApiConnection(AgentAPI agentApiConnection)
                           throws SmApiException
Sets an Agent API connection.

Parameters:
agentApiConnection - A valid AgentAPI connection * handle. The connection handle overrides the default handle or any other user-defined handle. If a null handle is passed, the connection is switched to the default handle, provided the default handle is already established through SmApiConnnection.
Returns:
void
SmApiException

getAgentApiConnection

public AgentAPI getAgentApiConnection()
                               throws SmApiException
Gets an Agent API connection.

Returns:
AgentAPI - AgentAPI handle
Throws:
SmApiException

isValidApiConnection

public boolean isValidApiConnection()
Verifies whether a valid Agent API connection is available.

Returns:
true if there is a valid Agent API connection; false otherwise.

execute

public SmApiResult execute(java.lang.String sessionspec,
                           SmApiConstants method,
                           SmApiObject apiObj)
                    throws SmApiException
Executes the API command request.

Parameters:
sessionspec - Valid session specification.
method - Requested method to be executed.
apiObj - An SmApiObject containing information about the request.
Returns:
SmApiResult The result of the request.
SmApiException

execute

public SmApiResult execute(java.lang.String sessionspec,
                           java.lang.String library,
                           SmApiConstants method,
                           SmApiObject apiObj)
                    throws SmApiException
Executes the API command request.

Parameters:
sessionspec - Valid session specification.
method - Requested method to be executed.
apiObj - An SmApiObject containing information about the request.
Returns:
SmApiResult The result of the request.
SmApiException

SiteMinder
Java SDK r12.0 SP2

Fri 11/06/2009

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