Sun Java System Access Manager 7 2005Q4 Developer's Guide

PolicyManager

com.sun.identity.policy.PolicyManager is the top-level administrator class for policy management. com.sun.identity.policy.PolicyManager provides methods that enable an administrator to create, modify, or delete realm policies. The PolicyManager can be obtained by passing a privileged user’s session token or by passing a privileged user’s session token with a realm name. Some of the more widely used methods of this class include the following:

getPolicyNames

Retrieves all named policies created for the realm for which the policy manager was instantiated. This method can also take a pattern (filter) as an argument.

getPolicy

Retrieves a policy when given the policy name.

addPolicy

Adds a policy to the specified realm. If a policy with the same name already exists, it will be overwritten.

removePolicy

Removes a policy from the specified realm.

replacePolicy

Replaces policy with a new policy.