Patrick-Dussault

Tech Tip : CA Single Sign-On : SmAgentConfig.removeAgentConfigProperties() method does not remove ACO properties that are commented out

Discussion created by Patrick-Dussault Employee on Jun 22, 2017

Issue:

 

The SmAgentConfig.removeAgentConfigProperties() method does not remove
ACO properties that are commented out. The removeAgentConfigProperty
method has the same problem. So when I go on to the AdminUI and
comment out an ACO paramter, then I do my migrate using my SDK code,
it does not remove the non commented out parameter on the
target. Rather is creates a new parameter with the # symbol and
retains the one that is not commented out.


To illustrate that :

 

Source System

 

       Parameter -

        ValidTargetDomain = .rusniaklab.com

 

 

 

Modify Source system to be

 

              #ValidTargetDomain=.rusniaklab.com

 

Do Migrate

 

Target System ends up with

 

        ValidTargetDomain=.rusniaklab.com

 

#ValidTargetDomain=.rusniaklab.com

 

How can I fix it ?

 

Environment:

 

Policy Server 12.52SP1CR01 SDK 12.52SP1CR04

 

Resolution:

 

This issue is fixed in SDK 12.52SP1CR08.

 

New API to give the user of API calls the ability to delete not only
the ACO parameters but also the "#" commented out ACO parameters.

 

Previously, the API to delete ACO parameters uses the following
sequence of API code:

 

      SmAgentConfig agentconfig = new SmAgentConfig();
      SmApiResult result = policyapi.getAgentConfig("test-aco", agentconfig);

 

        if (result.isSuccess())
        {
           agentconfig.removeAgentConfigProperties();
           System.out.println("prop num: "+agentconfig.getPropNum());
           return policyapi.modifyAgentConfig(agentconfig)
        }

 

The NEW API call will be declared similar to modifyAgentConfig:

 

    public SmApiResult  modifyAgentConfigExt (SmAgentConfig agentConfig)
                               throws SmApiException;         

 

 The new code would be applied to the following to delete all ACO
  parameters including the commented ones:

 

        SmAgentConfig agentconfig = new SmAgentConfig();
        SmApiResult result = policyapi.getAgentConfig("test-aco", agentconfig);

 

        if (result.isSuccess())
       {
           agentconfig.removeAgentConfigProperties();
           System.out.println("prop num: "+agentconfig.getPropNum());
           return policyapi.modifyAgentConfigExt(agentconfig);
       }

 

KB : TEC1403809

Outcomes