@Test public void testToOspfDeadIntervalExplicit() { OspfInterface ospf = new OspfInterface(); ospf.setDeadIntervalS(7); assertThat(toOspfDeadInterval(ospf), equalTo(7)); }
@VisibleForTesting static int toOspfDeadInterval(OspfInterface ospf) { Integer deadInterval = ospf.getDeadIntervalS(); if (deadInterval != null) { return deadInterval; } Integer helloInterval = ospf.getHelloIntervalS(); if (helloInterval != null) { return OSPF_DEAD_INTERVAL_HELLO_MULTIPLIER * helloInterval; } return DEFAULT_DEAD_INTERVAL_S; }
CiscoNxosConfiguration extends VendorConfiguration { @VisibleForTesting static int toOspfDeadInterval(OspfInterface ospf) { Integer deadInterval = ospf.getDeadIntervalS(); if (deadInterval != null) { return deadInterval; } Integer helloInterval = ospf.getHelloIntervalS(); if (helloInterval != null) { return OSPF_DEAD_INTERVAL_HELLO_MULTIPLIER * helloInterval; } return DEFAULT_DEAD_INTERVAL_S; } }
CiscoNxosConfiguration extends VendorConfiguration { @VisibleForTesting static int toOspfDeadInterval(OspfInterface ospf) { Integer deadInterval = ospf.getDeadIntervalS(); if (deadInterval != null) { return deadInterval; } Integer helloInterval = ospf.getHelloIntervalS(); if (helloInterval != null) { return OSPF_DEAD_INTERVAL_HELLO_MULTIPLIER * helloInterval; } return DEFAULT_DEAD_INTERVAL_S; } CiscoNxosConfiguration(); }
CiscoNxosConfiguration extends VendorConfiguration { @VisibleForTesting static int toOspfDeadInterval(OspfInterface ospf) { Integer deadInterval = ospf.getDeadIntervalS(); if (deadInterval != null) { return deadInterval; } Integer helloInterval = ospf.getHelloIntervalS(); if (helloInterval != null) { return OSPF_DEAD_INTERVAL_HELLO_MULTIPLIER * helloInterval; } return DEFAULT_DEAD_INTERVAL_S; } CiscoNxosConfiguration(); static @Nullable String getCanonicalInterfaceNamePrefix(String prefix); static @Nonnull String toJavaRegex(String ciscoRegex); @Override String canonicalizeInterfaceName(String ifaceName); @Nullable String getBannerExec(); void setBannerExec(@Nullable String bannerExec); @Nullable String getBannerMotd(); void setBannerMotd(@Nullable String bannerMotd); @Nonnull BgpGlobalConfiguration getBgpGlobalConfiguration(); @Nullable String getBootKickstartSup1(); @Nullable String getBootKickstartSup2(); @Nullable String getBootNxosSup1(); @Nullable String getBootNxosSup2(); @Nullable String getBootSystemSup1(); @Nullable String getBootSystemSup2(); @Nonnull Vrf getDefaultVrf(); @Nonnull Map<String, EigrpProcessConfiguration> getEigrpProcesses(); @Nullable EigrpProcessConfiguration getEigrpProcess(String processTag); @Nonnull EigrpProcessConfiguration getOrCreateEigrpProcess(String processTag); @Nullable Evpn getEvpn(); void setEvpn(@Nullable Evpn evpn); @Override @Nullable String getHostname(); @Nonnull Map<String, Interface> getInterfaces(); @Nonnull Map<String, IpAccessList> getIpAccessLists(); @Nonnull Map<String, IpAsPathAccessList> getIpAsPathAccessLists(); @Nonnull Map<String, IpCommunityList> getIpCommunityLists(); @Nullable String getIpDomainName(); @Nonnull Map<String, List<String>> getIpNameServersByUseVrf(); @Nonnull Map<String, IpPrefixList> getIpPrefixLists(); @Nonnull Map<String, Ipv6AccessList> getIpv6AccessLists(); @Nonnull Map<String, Ipv6PrefixList> getIpv6PrefixLists(); @Nonnull Map<String, LoggingServer> getLoggingServers(); @Nullable String getLoggingSourceInterface(); @Nonnull NxosMajorVersion getMajorVersion(); @Nonnull Map<String, NtpServer> getNtpServers(); @Nullable String getNtpSourceInterface(); @Nonnull Map<Integer, Nve> getNves(); @Nonnull Map<String, ObjectGroup> getObjectGroups(); @Nonnull Map<String, DefaultVrfOspfProcess> getOspfProcesses(); @Nonnull NexusPlatform getPlatform(); @Nonnull IntegerSpace getReservedVlanRange(); @Nonnull Map<String, RouteMap> getRouteMaps(); @Nonnull Map<String, SnmpCommunity> getSnmpCommunities(); @Nonnull Map<String, SnmpServer> getSnmpServers(); @Nullable String getSnmpSourceInterface(); boolean getSystemDefaultSwitchport(); boolean getSystemDefaultSwitchportShutdown(); @Nonnull Map<String, TacacsServer> getTacacsServers(); @Nullable String getTacacsSourceInterface(); @Nullable String getVersion(); void setVersion(@Nullable String version); @Nonnull Map<Integer, Vlan> getVlans(); @Nonnull Vrf getOrCreateVrf(String name); @Nonnull Map<String, Vrf> getVrfs(); void setBootKickstartSup1(@Nullable String bootKickstartSup1); void setBootKickstartSup2(@Nullable String bootKickstartSup2); void setBootNxosSup1(@Nullable String bootNxosSup1); void setBootNxosSup2(@Nullable String bootNxosSup2); void setBootSystemSup1(@Nullable String bootSystemSup1); void setBootSystemSup2(@Nullable String bootSystemSup2); @Override void setHostname(String hostname); void setIpDomainName(@Nullable String ipDomainName); void setLoggingSourceInterface(@Nullable String loggingSourceInterface); void setMajorVersion(NxosMajorVersion majorVersion); void setNonSwitchportDefaultShutdown(boolean nonSwitchportDefaultShutdown); void setNtpSourceInterface(@Nullable String ntpSourceInterface); void setPlatform(NexusPlatform platform); void setSnmpSourceInterface(@Nullable String snmpSourceInterface); void setTacacsSourceInterface(@Nullable String tacacsSourceInterface); void setSystemDefaultSwitchport(boolean systemDefaultSwitchport); void setSystemDefaultSwitchportShutdown(boolean systemDefaultSwitchportShutdown); @Override void setVendor(ConfigurationFormat format); static @Nonnull String computeRouteMapEntryName(String routeMapName, int sequence); @VisibleForTesting static @Nonnull String computeRoutingPolicyName(String routeMapName, int sequence); @Override @Nonnull List<Configuration> toVendorIndependentConfigurations(); }
CiscoNxosConfiguration extends VendorConfiguration { @VisibleForTesting static int toOspfDeadInterval(OspfInterface ospf) { Integer deadInterval = ospf.getDeadIntervalS(); if (deadInterval != null) { return deadInterval; } Integer helloInterval = ospf.getHelloIntervalS(); if (helloInterval != null) { return OSPF_DEAD_INTERVAL_HELLO_MULTIPLIER * helloInterval; } return DEFAULT_DEAD_INTERVAL_S; } CiscoNxosConfiguration(); static @Nullable String getCanonicalInterfaceNamePrefix(String prefix); static @Nonnull String toJavaRegex(String ciscoRegex); @Override String canonicalizeInterfaceName(String ifaceName); @Nullable String getBannerExec(); void setBannerExec(@Nullable String bannerExec); @Nullable String getBannerMotd(); void setBannerMotd(@Nullable String bannerMotd); @Nonnull BgpGlobalConfiguration getBgpGlobalConfiguration(); @Nullable String getBootKickstartSup1(); @Nullable String getBootKickstartSup2(); @Nullable String getBootNxosSup1(); @Nullable String getBootNxosSup2(); @Nullable String getBootSystemSup1(); @Nullable String getBootSystemSup2(); @Nonnull Vrf getDefaultVrf(); @Nonnull Map<String, EigrpProcessConfiguration> getEigrpProcesses(); @Nullable EigrpProcessConfiguration getEigrpProcess(String processTag); @Nonnull EigrpProcessConfiguration getOrCreateEigrpProcess(String processTag); @Nullable Evpn getEvpn(); void setEvpn(@Nullable Evpn evpn); @Override @Nullable String getHostname(); @Nonnull Map<String, Interface> getInterfaces(); @Nonnull Map<String, IpAccessList> getIpAccessLists(); @Nonnull Map<String, IpAsPathAccessList> getIpAsPathAccessLists(); @Nonnull Map<String, IpCommunityList> getIpCommunityLists(); @Nullable String getIpDomainName(); @Nonnull Map<String, List<String>> getIpNameServersByUseVrf(); @Nonnull Map<String, IpPrefixList> getIpPrefixLists(); @Nonnull Map<String, Ipv6AccessList> getIpv6AccessLists(); @Nonnull Map<String, Ipv6PrefixList> getIpv6PrefixLists(); @Nonnull Map<String, LoggingServer> getLoggingServers(); @Nullable String getLoggingSourceInterface(); @Nonnull NxosMajorVersion getMajorVersion(); @Nonnull Map<String, NtpServer> getNtpServers(); @Nullable String getNtpSourceInterface(); @Nonnull Map<Integer, Nve> getNves(); @Nonnull Map<String, ObjectGroup> getObjectGroups(); @Nonnull Map<String, DefaultVrfOspfProcess> getOspfProcesses(); @Nonnull NexusPlatform getPlatform(); @Nonnull IntegerSpace getReservedVlanRange(); @Nonnull Map<String, RouteMap> getRouteMaps(); @Nonnull Map<String, SnmpCommunity> getSnmpCommunities(); @Nonnull Map<String, SnmpServer> getSnmpServers(); @Nullable String getSnmpSourceInterface(); boolean getSystemDefaultSwitchport(); boolean getSystemDefaultSwitchportShutdown(); @Nonnull Map<String, TacacsServer> getTacacsServers(); @Nullable String getTacacsSourceInterface(); @Nullable String getVersion(); void setVersion(@Nullable String version); @Nonnull Map<Integer, Vlan> getVlans(); @Nonnull Vrf getOrCreateVrf(String name); @Nonnull Map<String, Vrf> getVrfs(); void setBootKickstartSup1(@Nullable String bootKickstartSup1); void setBootKickstartSup2(@Nullable String bootKickstartSup2); void setBootNxosSup1(@Nullable String bootNxosSup1); void setBootNxosSup2(@Nullable String bootNxosSup2); void setBootSystemSup1(@Nullable String bootSystemSup1); void setBootSystemSup2(@Nullable String bootSystemSup2); @Override void setHostname(String hostname); void setIpDomainName(@Nullable String ipDomainName); void setLoggingSourceInterface(@Nullable String loggingSourceInterface); void setMajorVersion(NxosMajorVersion majorVersion); void setNonSwitchportDefaultShutdown(boolean nonSwitchportDefaultShutdown); void setNtpSourceInterface(@Nullable String ntpSourceInterface); void setPlatform(NexusPlatform platform); void setSnmpSourceInterface(@Nullable String snmpSourceInterface); void setTacacsSourceInterface(@Nullable String tacacsSourceInterface); void setSystemDefaultSwitchport(boolean systemDefaultSwitchport); void setSystemDefaultSwitchportShutdown(boolean systemDefaultSwitchportShutdown); @Override void setVendor(ConfigurationFormat format); static @Nonnull String computeRouteMapEntryName(String routeMapName, int sequence); @VisibleForTesting static @Nonnull String computeRoutingPolicyName(String routeMapName, int sequence); @Override @Nonnull List<Configuration> toVendorIndependentConfigurations(); static final String DEFAULT_VRF_NAME; static final int DEFAULT_VRF_ID; static final String MANAGEMENT_VRF_NAME; static final int MANAGEMENT_VRF_ID; static final String DEFAULT_CLASS_MAP_NAME; static final String DEFAULT_POLICY_MAP_IN; static final String DEFAULT_POLICY_MAP_OUT; }