Java SDK - method AgentAPI.init takes 20 sec to timeout
search cancel

Java SDK - method AgentAPI.init takes 20 sec to timeout

book

Article ID: 279463

calendar_today

Updated On: 02-19-2024

Products

CA Single Sign On Agents (SiteMinder) SITEMINDER

Issue/Introduction


Running an SDK Custom Agent in Java, when configuring the serverdef1.timeout to 5, when the Policy Server is down, the init method takes 20 seconds instead of 5 to end.

 

Cause


The serverdef1.timeout is the Request Timeout for a request, not a new connection. The portion of code is to act as HCO of the Agent once a connection is already established. This is what's meant from "agent object" from the documentation (1):

  "If you do not already have a default connection and you want a user-defined connection object, you can use the Agent API to create the agent object and then create the new connection, as follows:

      Create the agent object.
      
      You can create an agent object based on connection parameters from either of the following sources:
      
          User-defined connection parameters defined in your code for example:

          AgentAPI agent = new AgentAPI();
          ServerDef sd = new ServerDef();
          sd.serverIpAddress = POLICY_IP;
          sd.connectionMin = CX_MIN;
          sd.connectionMax = CX_MAX;
          sd.connectionStep = CX_STEP;
          sd.timeout = CX_TIMEOUT;
          sd.authorizationPort = AZ_PORT;
          sd.authenticationPort = AUTH_PORT;
          sd.accountingPort = ACC_PORT;
          InitDef init=new InitDef(AGENT_LOGIN,SHARED_SECRET,false, sd);
          agent.init(init);"

 

Resolution

  
For the first connection before getting the HCO, then you need to configure the requesttimeout parameter from the SmHost.conf file.

 

Additional Information

 

  1. Establish a User-Defined Connection to the Policy Server
    https://techdocs.broadcom.com/us/en/symantec-security-software/identity-security/siteminder/12-8/programming/sdks/programming-in-java/utilities-package-in-java/create-a-client-application-in-java.html