

Programming Guides › Programming Guide for Java › Policy Management API › Add Objects to the Policy Store
Add Objects to the Policy Store
After creating a Policy Management API object, you can create objects to add to the policy store.
To add objects to the policy store
- Create an object to be added to the policy store.
For example, if you want to create an agent object:
SmAgent agent = new SmAgent();
- Set the appropriate fields for the object—for example:
agent.setName ("myAgent");
agent.setSecret ("siteminder");
agent.setDescription ("Sample agent");
agent.setAgentType (SmAgentType.DefaultAgentType);
- 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);
- 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 SiteMinder policy store.
- The Oid field in the corresponding object structure is set to the object identifier.
Copyright © 2015 CA Technologies.
All rights reserved.
 
|
|