Add Objects to the Policy Store

After creating a Policy Management API object, you can create objects to add to the policy store.
casso127
After creating a Policy Management API object, you can create objects to add to the policy store.
To add objects to the policy store
  1. Create an object to be added to the policy store.
    For example, if you want to create an agent object:
    SmAgent agent = new SmAgent();
  2. Set the appropriate fields for the object—for example:
    agent.setName ("myAgent");
    agent.setSecret ("siteminder");
    agent.setDescription ("Sample agent");
    agent.setAgentType (SmAgentType.DefaultAgentType);
  3. Add the object to the policy store, as follows:
    • Call the add... method for the object you just created—for example, addAgent() for an agent object, or addDomain() for a domain object—and pass in the object you want to add to the policy store.
    • Returning the result into a result object.
    For example:
    result = policyApi.addAgent(agent);
  4. Examine the result.
If the call is successful:
  • The method returns an SmApiResult object whose isSuccess() method returns true.
  • The object is added to the
    CA Single Sign-On
    policy store.
  • The
    Oid
    field in the corresponding object structure is set to the object identifier.