Previous Topic: Agent APINext Topic: Policy Migration Methods


Policy Management API

This section contains the following topics:

About Policy Management

Policy Management Setup

Required JAR File

Policy Store Objects

Write a Policy Management Application

Administrator Methods

Agent Methods

Agent Configuration Object Methods

Authentication and Authorization Map Methods

Authentication Scheme Methods

Certificate Map Methods

Domain Methods

General Object Methods

Group Methods

Host Configuration Object Methods

ODBC Query Scheme Methods

Password Policy Methods

Policy Methods

Policy Migration Methods

Realm Methods

Response Methods

Root Configuration Methods

Rule Methods

Self-Registration Methods

Trusted Host Object Methods

User Directory Methods

User Policy Methods

Utility Methods

Object Associations

Add Objects to the Policy Store

Retrieve Objects from the Policy Store

Delete Objects from the Policy Store

Authentication Scheme Configuration

Performance Consideration

About Policy Management

Policy management consists of creating, deleting, and modifying policy objects within a SiteMinder policy store. Through the Policy Management API, you can perform most of the data manipulations that you can perform through the native Policy Server User Interface. For example, you can write a client application that allows administrators to perform tasks such as:

Policy Management Setup

To run applications built with the Policy Management API:

Note: If an application built with the Policy Management API runs on the same machine as the Policy Server, the application must run as the same user who installed the Policy Server (for example, smuser on UNIX platforms).

Required JAR File

The JAR file smjavasdk2.jar is required for building and running Policy Management applications. The JAR file is stored in the following locations:

Policy Store Objects

Interface SmPolicyApi is implemented by the class SmPolicyApiImpl. Use this class as the starting point for the Policy Management API. Each policy store object is associated with a class in the Policy Management API. You create and manage policy store objects through the methods in an object’s class.

Policy store objects can be classified according to scope:

Global objects include:

Domain objects include:

When you are working in the Policy Server user interface, you will see most of the above objects listed in the System and Domain tabs of the SiteMinder Administration window.

Note: Descriptions in the Javadoc reference specify whether an object has global scope or domain scope.

Write a Policy Management Application

To write a Policy Management application

  1. Establish a Connection to the Policy Server
  2. Obtain a Session Object
  3. Pass in the Session Object
  4. Make Policy Management API Requests
  5. Terminate the Administrator Session

The SiteMinder SDK contains a sample of how to use the classes and methods in the Java Policy Management API.

Establish a Connection to the Policy Server

To establish a connection to the Policy Server, use the SmApiConnection class of the Utilities package. This class holds the Agent API handle through which Java API requests are sent.

There are two types of connection handles in this class:

Obtain a Session Object

A session object is obtained when a user or administrator successfully logs in. In this case, an administrator login is required, since only administrators can perform policy management.

To log in a SiteMinder administrator and establish an administrator session, call the login() method in the SmApiSession class of the Utilities package.

Once login is successful, the session object will hold a valid administrator session specification.

Pass in the Session Object

After obtaining a valid session, create a Policy Management API object by passing the session to the constructor of the SmPolicyApiImpl class—for example:

SmPolicyApi policyApi = new SmPolicyApiImpl (apiSession);

In the example, policyApi is the new Policy Management API object and apiSession is the session obtained when the administrator successfully logged in.

Make Policy Management API Requests

After you obtain a session object and create a Policy Management API object, you are ready to make Policy Management requests. Most of the methods in the Policy Management API are categorized according to the SiteMinder object that a given method acts upon—for example, agents, policies, and rules.

There is also a Utilities category for methods that perform services, such as cache and encryption key management. Use these categories to help you find a particular Policy Management API method to use in your custom policy management applications.

Note: The methods in the policyapi package can only be called from a Siteminder administrator session.

Terminate the Administrator Session

When you are finished making Policy Management API requests, log out the administrator by calling the logout() method in the SmApiSession class of the Utilities package.

Important! After you have called the logout() method, the connection handle becomes invalid. Do not reference it again.

Administrator Methods

Unless otherwise specified, the following methods are in the class SmPolicyApiImpl. The following methods act on administrator objects. You create an administrator object by instantiating SmAdmin.

Method

Description

addAdmin()

Adds an administrator object to the policy store.

addAdminToDomain()

Associates an administrator with a domain.

deleteAdmin()

Deletes an administrator.

getAdmin()

Gets the contents of an administrator.

getAdminUserDirs()

Gets a list of user directories that an administrator can manage.

modifyAdmin()

Modifies an administrator.

removeAdminFromDomain()

Disassociates an administrator from a domain.

Agent Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on agent objects. You create an agent object by instantiating SmAgent.

Method

Description

addAgent()

Adds an agent object to the policy store.

deleteAgent()

Deletes an agent.

getAgent()

Gets the contents of an agent.

modifyAgent()

Modifies an agent.

Agent Configuration Object Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on agent configuration objects. You define an agent configuration object by instantiating SmAgentConfig.

Method

Description

addAgentConfig()

Adds an agent configuration object to the policy store.

deleteAgentConfig()

Deletes an agent configuration object.

getAgentConfig()

Gets the contents of an agent configuration object.

modifyAgentConfig()

Modifies an agent configuration object.

Authentication and Authorization Map Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on authentication and authorization directory mapping objects. You create an authentication and authorization directory mapping object by instantiating SmAuthAzMap.

Method

Description

addAuthAzMap()

Adds an authentication and authorization directory mapping object to the policy store.

deleteAuthAzMap()

Deletes an authentication and authorization directory mapping object.

getAuthAzMap()

Gets the contents of an authentication and authorization directory mapping object.

modifyAuthAzMap()

Modifies an authentication and authorization directory mapping object.

Authentication Scheme Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on authentication schemes. You create an authentication scheme by instantiating SmScheme.

Method

Description

addScheme()

Adds an authentication scheme to the policy store.

deleteScheme()

Deletes an authentication scheme.

getScheme()

Gets the contents of an authentication scheme.

modifyScheme()

Modifies an authentication scheme.

Certificate Map Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on certificate mapping objects. You create certificate mapping objects by instantiating SmCertMap.

Method

Description

addCertMap()

Adds a certificate mapping object to the policy store.

deleteCertMap()

Deletes a certificate mapping object.

getCertMap()

Gets the contents of a certificate mapping object.

modifyCertMap()

Modifies a certificate mapping object.

Domain Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on domain objects. You create domain objects by instantiating SmDomain.

Method

Description

addDomain()

Adds a domain object to the policy store.

deleteDomain()

Deletes a domain.

getDomain()

Gets the contents of a domain.

getDomainObject()

Gets a domain object for the specified object name or OID.

getDomainObjectNames()

Gets a list of domain objects within a domain.

isDomainObject()

Indicates whether an object is a domain object.

In classes SmObjectImpl, SmDomainObjectImpl.

modifyDomain()

Modifies a domain.

General Object Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on multiple types of objects.

Method

Description

getGlobalObjectNames()

Gets a list of global objects.

getObject()

Gets a global object for the specified object name or OID.

getOid()

Retrieves an object identifier for an object.

In class SmObjectImpl.

isWriteable()

Specifies whether an object is writeable.

In classes SmAgentType, SmDomainObjectImpl, and SmObjectImpl.

renameObject()

Renames an object.

 

Group Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on group objects. Group objects are created with SmAgentGroup (for agent groups), SmResponseGroup (for response groups), or SmRuleGroup (for rule groups).

Method

Description

addGroup()

Adds an agent, response, or rule group to the policy store.

addToGroup()

Adds a group element of type rule, response, or agent to the specified group.

deleteGroup()

Deletes an existing group.

getGroup()

Gets the contents of an existing group.

getGroupMembers()

Get a list of groups of all types.

modifyGroup()

Modify a group.

removeFromGroup()

Removes a group element from a group.

Host Configuration Object Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on host configuration objects. You define a host configuration object by instantiating SmHostConfig.

Method

Description

addHostConfig()

Adds a host configuration object to the policy store.

deleteHostConfig()

Deletes a host configuration object.

getHostConfig()

Gets the contents of a host configuration object.

modifyHostConfig()

Modifies a host configuration object.

ODBC Query Scheme Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on ODBC Query schemes. You create ODBC Query schemes by instantiating SmODBCQuery.

Method

Description

addODBCQuery()

Adds an ODBC query object to the policy store.

deleteODBCQuery()

Deletes an ODBC query object.

getODBCQuery()

Gets the contents of an ODBC query object.

modifyODBCQuery()

Modifies an ODBC query object.

Password Policy Methods

Unless otherwise specified, the methods listed in this table are in the class SmPolicyApiImpl. The following methods act on password policy objects. You create password policy objects by instantiating SmPasswordPolicy.

Method

Description

addPasswordPolicy()

Adds a password policy object to the policy store.

deletePasswordPolicy()

Deletes a password policy.

getPasswordPolicy()

Gets the contents of a password policy.

isEnabled()

Specifies whether the password policy is enabled.

In class SmPasswordPolicy.

isEntireDir()

Specifies whether the password policy applies to the entire directory.

In class SmPasswordPolicy.

modifyPasswordPolicy()

Modifies a password policy.

Policy Methods

The following methods act on policy and policy link objects. A policy link is an association of a policy, a rule, and optionally, a response. Unless otherwise specified, these methods are in the class SmPolicyApiImpl.

Policy objects are created with SmPolicy. Policy link objects are created with SmPolicyLink.

Method

Description

addPolicy()

Adds a policy object to the policy store.

addPolicyLink()

Adds a policy link to a policy.

deletePolicy()

Deletes the policy associated with the specified domain.

deletePolicyLink()

Removes a policy link from a policy.

getPolicy()

Gets the contents of a policy.

getPolicyLinks()

Gets all of the policy links for the specified policy and domain.

modifyPolicy()

Modify the policy associated with the specified domain.

modifyPolicyLink()

Modifies the specified policy link.