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

Using the Policy Code Samples

Access Manager provide Policy code samples to perform the following tasks:

All the files you need to run the policy code samples are located in the following directories:

Solaris Platform

AccessManager-base/samples/policy

Linux Platform

AccessManager-base/identity

Use Cases Illustrated by Policy Code Samples

Each of the following sections describes a sequence of steps you must take when using various means to run a policy evaluation program or to create policies. Each step in a sequence is linked to detailed instructions further down in this chapter.

ProcedureTo Run a Policy Evaluation Program for the URL Policy Agent Service

Use this sequence to runs a policy evaluation program for the iPlanetAMWebAgentService service.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Develop and run a Policy evaluation program.

    See Developing and Running a Policy Evaluation Program.

ProcedureTo Run a Policy Evaluation Program for the URL Policy Agent Service and More

This sequence runs the evaluation program for iPlanetAMWebAgentService and the sample subject, condition, and referral implementations.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Develop custom subjects, conditions, and referrals.

    See Developing Custom Subjects, Conditions, and Referrals.

  3. Develop and run a Policy evaluation program.

    See Developing and Running a Policy Evaluation Program.

ProcedureTo Run a Policy Evaluation Program for the Sample Service

This sequence runs the evaluation program for the SampleWebService.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Add a Policy-enabled service to Access Manager.

    See Adding a Policy-Enabled Service to Access Manager.

  3. Create policies for the new service.

    See Creating Policies for a New Service.

  4. Develop and run a Policy evaluation program.

    Developing and Running a Policy Evaluation Program.

ProcedureTo Run a Policy Evaluation Program for the Sample Service and More

This sequence runs the evaluation program forSampleWebService and the sample subject, condition, and referral implementations.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Add a Policy-enabled service to Access Manager.

    See Adding a Policy-Enabled Service to Access Manager.

  3. Develop custom subjects, conditions, and referrals.

    See Developing Custom Subjects, Conditions, and Referrals.

  4. Create policies for the new service.

    See Creating Policies for a New Service.

  5. Develop and run a Policy evaluation program.

    See Developing and Running a Policy Evaluation Program.

To Use amadmin to Create Policies for the URL Policy Agent Service

Use amadmin to create policies for the service. See Creating Policies in Sun Java System Access Manager 7 2005Q4 Administration Guide for detailed instructions.

ProcedureTo Use amadmin to Create Policies for the Sample Service

This sequences creates policies for SampleWebService.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Develop and run a Policy evaluation program.

    See Developing and Running a Policy Evaluation Program.

ProcedureTo Programmatically Construct Policies

This sequence constructs policies and adds them to the policy store.

  1. Compile the Policy code samples.

    See Compiling the Policy Code Samples.

  2. Programmatically construct policies.

    See Programmatically Constructing Policies.