Cisco Systems, Inc.

com.pcube.apps.engage.apply
Class RuleResolutionAdaptor

java.lang.Object
  extended by com.pcube.apps.engage.apply.RuleResolutionAdaptor

public class RuleResolutionAdaptor
extends java.lang.Object

builds a structure that is parallel to the SML app rule resolution structure. This adaptor has one major output: ruleResKey - map of RuleResolutionKeys (a compound key of package, service and time frame) to a rule entry (rule,index) the final rule resolution is an optimized ip-prefix LUT; optimized in the sense that it contains minimum number of keys that represent correctly and accuratly the user configuration. Each key in the LUT is a triplet . The triplets are associates with indices of rules in the global rule set. Building the LUT: for each service in services for each package in packages for each time-frame in time-frames find the active (none disabled) rule - if no rule defined go to parent service. add rule index to LUT. The order of the iteration is important! the LUT optimizer expects the entries in ascending order, so if we don't want to create all entries (possibly 500*5000*4 = 10,000,000 entries) we better iterate services -> packages -> time-frames Note: the performance of the implementation below is sensitive to the depth of the service hierarchy. If service has no active rule for a specific time frame and package the algorithm climbs up the service hierarchy till it finds the explicit rule (the rule for the service in the package's rule array)

Author:
rafis

Field Summary
static org.apache.log4j.Category logcat
           
 
Constructor Summary
RuleResolutionAdaptor(Policy _policy, PackageArray packages, ServiceArray services, RuleSetAdaptor ruleSetAdaptor)
           
 
Method Summary
 java.util.Map getRuleResMap()
          The rule resolution map; association of RuleResolutionKey with rule index
 void printMapKeys(java.util.Map map)
          for debuging
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logcat

public static final org.apache.log4j.Category logcat
Constructor Detail

RuleResolutionAdaptor

public RuleResolutionAdaptor(Policy _policy,
                             PackageArray packages,
                             ServiceArray services,
                             RuleSetAdaptor ruleSetAdaptor)
                      throws ApplyException
Throws:
ApplyException
Method Detail

getRuleResMap

public java.util.Map getRuleResMap()
The rule resolution map; association of RuleResolutionKey with rule index

Returns:
Returns the ruleResMap.

printMapKeys

public void printMapKeys(java.util.Map map)
for debuging


Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.