Programming Guides › Programming Guide for Java › Policy Management API › Retrieve Objects from the Policy Store
Retrieve Objects from the Policy Store
To retrieve an object from the policy store
- Create an object of the relevant class to store the returned properties. For example, the following code creates an agent object:
SmAgent myAgent = new SmAgent();
- Call the appropriate get... function for the object you just created—for example, getAgent() for an agent object, or getDomain() for a domain object—and pass in the object you just created. For example, if you’re retrieving an agent named myAgent:
result = myPolicyApi.getAgent ("myAgent", myAgent);
If the method succeeds, it populates myAgent with the properties of the specified agent object. (If a get... method retrieves a list, the list is written to a vector.) If no matching objects are found, the properties of the receiving object retain their initial values.
Copyright © 2014 CA.
All rights reserved.
|
|