本文整理汇总了Java中net.juniper.contrail.api.types.PolicyEntriesType类的典型用法代码示例。如果您正苦于以下问题:Java PolicyEntriesType类的具体用法?Java PolicyEntriesType怎么用?Java PolicyEntriesType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolicyEntriesType类属于net.juniper.contrail.api.types包,在下文中一共展示了PolicyEntriesType类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import net.juniper.contrail.api.types.PolicyEntriesType; //导入依赖的package包/类
public void build(ModelController modelController, String leftVn, String rightVn, String gatewayName,
List<String> siList, String action) {
if (_project != null) {
_fqName = StringUtils.join(_project.getQualifiedName(), ':') + ":" + _name;
} else {
_fqName = ContrailManager.VNC_ROOT_DOMAIN + ":" + ContrailManager.VNC_DEFAULT_PROJECT + ":" + _name;
}
PolicyEntriesType policyMap = new PolicyEntriesType();
List<PolicyRuleType.AddressType> srcList = new ArrayList<PolicyRuleType.AddressType>();
srcList.add(new PolicyRuleType.AddressType(null, leftVn, null));
List<PolicyRuleType.AddressType> dstList = new ArrayList<PolicyRuleType.AddressType>();
dstList.add(new PolicyRuleType.AddressType(null, rightVn, null));
List<PolicyRuleType.PortType> portAny = new ArrayList<PolicyRuleType.PortType>();
portAny.add(new PolicyRuleType.PortType(0, 65535));
PolicyRuleType rule = new PolicyRuleType(
new PolicyRuleType.SequenceType(1, 0), null, "<>", "any",
srcList, portAny, null, dstList, portAny,
new PolicyRuleType.ActionListType(action, gatewayName, siList, null));
policyMap.addPolicyRule(rule);
_policyMap = policyMap;
}