|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
PolicyManagerService | Portal service to query the Policy server side system for applicable Policy Value Sets. |
PolicyValueSet | PolicyValueSet (PVS) represents arbitrary name value pairs to be used by applications as points of variability. |
RuleContext | RuleContext interface allows for others to implement a mechanism used by a rules engine to classify different types of Targets. |
Target | Target represents the object used to abstract a rule engine for the purpose of policy evaluation. |
Class Summary | |
---|---|
HttpRequestRuleContext | Public implementation of RuleContext representing a request. |
MapRequestContext | Public implementation of RuleContext representing a generic Map Request. |
This package includes the API of the Policy Manager runtime. Policy
Manager returns objects typed as Policy Value Sets, which are
derivatives of simple Maps. A Policy Value Set (PVS) is a set of
application specific attributes that create points of variability in
some apsect of the calling application. The goal of the Policy Manager
API is to provide the same API to policy consumers, or applications ,
independant of the platforms they are calling from. For example, the
same policy code could be made from a server side portlet running within
Websphere Portal, as well as from an application on the rich client.
Targets are rules engine objects to assist policy in navigating the tree
of subpolicies. Execution of a Target results in a list of profiles,
that provide the next possible step down the policy subtree. Targets'
uses are limited to the server side consumers of policy. Alternative to
Targets, if policy consumers know the policy tree topology, they can
form their own policy path in the form of a String.
Use the WebSphere Portal JNDI portlet service lookup mechanism to locate
the PolicyManager implementation.
Usage examples:
import com.ibm.policy.manager.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
...
PolicyManagerService pms;
javax.naming.Context ctx = new javax.naming.InitialContext();
try {
pms = (PolicyManagerService)ctx.lookup("portal:service/policy/PolicyManager");
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
// request the service via the home interface
PolicyManager pManager = pms.getPolicyManager();
String knownPolicyPath="Taxes/UnitedStates/NorthCarolina";
PolicyValueSet set=pManager.getPVSByPath(knownPolicyPath);
int taxRate=set.get("rate");
import com.ibm.policy.manager.*;
import com.ibm.policy.manager.portal.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
...
PolicyManager pManager=null;
PolicyManagerService pms;
Context ctx = new InitialContext();
try {
pms = (PolicyManagerService)ctx.lookup("portal:service/policy/PolicyManager");
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
// request the service via the home interface
PolicyManager pManager = pms.getPolicyManager();
String knownPolicyType="Taxes";
RuleContext ruleCtx=new PortletRequestRuleContext(portletRequest);
Target tar=pManager.createTarget(ruleCtx);
PolicyValueSet set=pManager.getPVSByTarget(tar, knownPolicyType);
Integer taxRate=set.get("rate");
Please note that as a general rule, all of the interfaces of this API
must not be implemented. Your code may only implement an interface if
the according interface description explicitely states that this is
allowed.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |