com.netscape.certsrv.publish
Interface IPublishRuleSet


public interface IPublishRuleSet

Represents a set of publishing rules. Publishing rules are ordered from lowest priority to highest priority. The priority assignment for publishing rules is not enforced by this interface. Various implementation may use different mechanisms such as a linear ordering of publishing rules in a configuration file or explicit assignment of priority levels ..etc. The publishing rule initialization needs to deal with reading the publishing rules, sorting them in increasing order of priority and presenting an ordered vector of publishing rules via the IPublishRuleSet interface. When a request comes, the predicates of the publishing rules will be checked in the order to find the first matched publishing rule as the mapping rule to (un)publish the object.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Method Summary
 void addRule(java.lang.String aliasName, ILdapRule rule)
          Add a publishing rule
 int count()
          Returns the no of publishing rules in a set.
 java.lang.String getName()
          Returns the name of the publishing rule set.
 ILdapRule getRule(IRequest req)
          Get the publishing rule identified by a corresponding request.
 ILdapRule getRule(java.lang.String ruleName)
          Get the publishing rule identified by a given name.
 java.util.Enumeration getRules()
          Get an enumeration of publishing rules.
 void init(ISubsystem sys, IConfigStore conf)
           
 void publish(netscape.ldap.LDAPConnection conn, IRequest req)
          Apply publishing rules on a request.
 void removeRule(java.lang.String ruleName)
          Removes a publishing rule identified by the given name.
 

Method Detail

init

void init(ISubsystem sys,
          IConfigStore conf)
          throws EBaseException
Throws:
EBaseException

getName

java.lang.String getName()
Returns the name of the publishing rule set.

Returns:
The name of the publishing rule set.

count

int count()
Returns the no of publishing rules in a set.

Returns:
the no of publishing rules.

addRule

void addRule(java.lang.String aliasName,
             ILdapRule rule)
Add a publishing rule

Parameters:
aliasName - The name of the publishing rule to be added.
rule - rule The publishing rule to be added.

removeRule

void removeRule(java.lang.String ruleName)
Removes a publishing rule identified by the given name.

Parameters:
ruleName - The name of the publishing rule to be removed.

getRule

ILdapRule getRule(java.lang.String ruleName)
Get the publishing rule identified by a given name.

Parameters:
ruleName - The name of the publishing rule to be return.
Returns:
The publishing rule identified by the given name or null if none exists.

getRule

ILdapRule getRule(IRequest req)
Get the publishing rule identified by a corresponding request.

Parameters:
req - The request from which rule will be identified.
Returns:
The publishing rule or null if none exists.

getRules

java.util.Enumeration getRules()
Get an enumeration of publishing rules.

Returns:
An enumeration of publishing rules.

publish

void publish(netscape.ldap.LDAPConnection conn,
             IRequest req)
             throws ELdapException
Apply publishing rules on a request. The predicates of the publishing rules will be checked in the order to find the first matched publishing rule. Use the mapper to find the dn of the LDAP entry and use the publisher to publish the object in the request.

Parameters:
conn - The Ldap connection
req - The request to apply policies on.
Throws:
ELdapException - publish failed due to Ldap error.