|
EASP API 7.6.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SubstEngine
This is the interface to an engine creating and analyzing sets of Substitution
s. It includes
methods to do the following things:
Notes:
net.juniper.smgt.lib.subst
group may not immediately throw exceptions indicating syntax errors. Methods such as
acquireParams(List,List)
and
classify(List,List,List,List)
may throw exceptions indicating syntax errors
where previously they would have been thrown earlier when substitutions were created. Use
Substitution.validate()
to explicitly validate substitutions
Method Summary | |
---|---|
List |
acquireParams(List formals,
List acquired)
Given a List of parameters and a List of aquired Substitutions ordered from specific to general, returns a List of values for the formal parameters according to the acquired Substitutions. |
void |
classify(List substs,
List free,
List defaulted,
List fixed)
classifies the variables in the given list of Substitution s in specific to general order
(including variables occuring in the value) into
3 classes: |
Substitution |
createSubstitution(String substStr)
Creates a substitution from the given string. |
List |
createSubstitutions(List substStrs)
Creates a List of substitutions from the given list of strings representing substitutions. |
void |
createSubstitutions(List substStrs,
List substsList)
adds the Substitution s represented by the given list of strings to the given list. |
List |
createSubstitutions(String[] substStrs)
Creates the List of substitutions represented by the given array of strings. |
void |
createSubstitutions(String[] substStrs,
List substsList)
Creates substitutions represented by the given array of strings and adds them to the given List of substitutions. |
Method Detail |
---|
List acquireParams(List formals, List acquired) throws SubstitutionFormatException
net.juniper.smgt.sae.ent.im.Subscription#getAdministrativeValues()
,
net.juniper.smgt.sae.ent.im.Session#getOperationalValues()
, and
net.juniper.smgt.sae.ent.im.Session#getPolicyValues()
.
It is included here for informational and debugging purposes.
The parameters and values are represented as Substitution
s.
Only the variables in the parameters are considered, the values and types of the parameters
are ignored. The values List contains substitutions of values for the corresponding variables in the
parameters List as defined by the List of aquired substiutions.
The order of the variables in the values List
is the same as the order in the parameters List, so to find the value for the variable in the ith
position in the parameters List, use the substitution in the ith position in the returned
values List.
The values in the returned List are partially evaluated to remove subexpressions
containing no variables. The subexpressions containing no variables in the value after all
possible variable substitutions are performed is evaluated, converting
to floating point if necessary, and the results, are
inserted into the output value substitution for the variable. It is possible for the output
value Substitutions to contain variables in the values. Use Substitution.isGrounding()
and
Substitution.getValVars()
to test if the aquisition found specific values for the variables.
To make this clearer, here are some examples:
[x] | [x:any=y, y:number=z+1, z:burst=16999] | [x:burst=17000] | Most specific type deduced from aquired substitutions |
[x,y] | [x:any=y, y:number=z+1, z:burst=16999] | [x:burst=17000, y:burst=17000] | Variables in same order in params and values |
[x] | [x=y, y=z+2*w, w=3] | [x=z+6] | the subexpression 2*3 gets evaluated to 6 |
[x] | [y=z] | [x=x] | x=x is the way the method indicates that there were no substitutions for the formal parameter x. |
params
- java.util.List a List of Substitution
s indicating the variables to search for
values for in the given List of aquired Substitutions.substs
- java.util.List the List of Substitution
s from Substitution the acquisition path
in specific to general order that is used to find the values for the parameters. The list may contain
individual Substitutions, Lists of Substitutions, or Maps of variable names (as Strings) to Substitutions. When searching for a substituion
for a variable, if sublist is encountered, the search continues in the same direction in the sublist. If
a Map is encountered, the variable name is used to key into the map to determine if there is a substution for
the variable.
Substitution
s indicating the actual values to use for the
variables in the given List of parameters
SubstitutionFormatException
- thrown if
void classify(List substs, List free, List defaulted, List fixed) throws SubstitutionFormatException
Substitution
s in specific to general order
(including variables occuring in the value) into
3 classes:
After aquisition of substitutions, this is the method called by
net.juniper.smgt.sae.ent.im.Substitutions#getFreeVariables()
,
net.juniper.smgt.sae.ent.im.Substitutions#getFixedVariables()
, and
net.juniper.smgt.sae.ent.im.Substitutions#getDefaultedVariables()
. It is also used
to determine the service parameters and default values by
net.juniper.smgt.sae.ent.im.Service#getParameters()
.
If substs
is the list of substitutions from the Service followed by the substitutions for the
policy parameters followed by the list of substitutions for the global variables considered fixed, then
the parameters params
of the service are classify(substs, params, params, null)
.
For instance, if
classify([!inside=asp, !outside=dept, !qos=0.2*interface_speed, asp:network=any, dept:network inside:network, outside:network, qos:number, !interface_speed:number, !any:network=0.0.0.0/0], params, params, null)gives params = [asp:network=0.0.0.0/0, dept:network]. This means that
This method is included here for informational and debugging purposes.
In the following discussion, more general substitutions (those closer to the back of the input list)
are described as
substs
- java.util.List a list of Substitution
s from the acquisition path. The list may contain
individual Substitutions, Lists of Substitutions, or Maps of variable names (as Strings) to Substitutions. When classifying variables,
if sublist is encountered, the classification contines in the same direction in the sublist. If
a Map is encountered, the Substitutions in the Map are classified in an arbitrary order.free
- java.util.List the List to add the Substitution
s for free variables to,
or null if the free variables are not requireddefaulted
- java.util.List the List to add the Substitution
s for defaulted variables to,
or null if the defaulted variables are not requiredfixed
- java.util.List the List to add the Substitution
s for fixed variables to,
or null if the fixed variables are not required
SubstitutionFormatException
- there is a syntax error in the string used to create one of the substitutionsSubstitution createSubstitution(String substStr) throws SubstitutionFormatException
substStr
- java.lang.String the string representing the substitution
SubstitutionFormatException
- List createSubstitutions(String[] substStrs) throws SubstitutionFormatException
substStrs
- java.lang.String[] an array of strings representing substitutions
Substitution
s represented by the input strings
SubstitutionFormatException
- thrown if there is a problem with the syntax or semanics of any of
the substitution strings.createSubstitution(String)
void createSubstitutions(String[] substStrs, List substsList) throws SubstitutionFormatException
substStrs
- java.lang.String[] an array of strings representing substitutionssubstsList
- List a List of Substitution
s to add the substitutions represented by the
strings to
SubstitutionFormatException
- thrown if there is a problem with the syntax or semanics of any of
the substitution strings.createSubstitution(String)
List createSubstitutions(List substStrs) throws SubstitutionFormatException
substStrs
- List a List of strings representing substitutions
Substitution
s represented by the input strings
SubstitutionFormatException
- thrown if there is a problem with the syntax or semanics of any
of the substitution strings.createSubstitution(String)
void createSubstitutions(List substStrs, List substsList) throws SubstitutionFormatException
Substitution
s represented by the given list of strings to the given list.
substStrs
- List a List of Strings representing substitutionssubstsList
- List a List of Substitution
s to add the substitutions represented by the input
strings to
SubstitutionFormatException
- thrown if there is a problem with the syntax or semanics of any of
the substitution strings.createSubstitution(String)
|
EASP API 7.6.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |