@Test public void testGetType_interface() { assertThat(new InterfacesInterface("iface").getType(), equalTo(CumulusStructureType.INTERFACE)); }
@Nonnull public CumulusStructureType getType() { CumulusStructureType type = null; if (VLAN_INTERFACE_PATTERN.matcher(_name).matches()) { type = VLAN; } if (_vxlanId != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VXLAN); type = VXLAN; } if (_vrfTable != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VRF); type = VRF; } if (_bondSlaves != null && !_bondSlaves.isEmpty()) { checkState(type == null, "ambiguous interface type: %s vs %s", type, BOND); type = BOND; } return firstNonNull(type, INTERFACE); }
InterfacesInterface implements Serializable { @Nonnull public CumulusStructureType getType() { CumulusStructureType type = null; if (VLAN_INTERFACE_PATTERN.matcher(_name).matches()) { type = VLAN; } if (_vxlanId != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VXLAN); type = VXLAN; } if (_vrfTable != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VRF); type = VRF; } if (_bondSlaves != null && !_bondSlaves.isEmpty()) { checkState(type == null, "ambiguous interface type: %s vs %s", type, BOND); type = BOND; } return firstNonNull(type, INTERFACE); } }
InterfacesInterface implements Serializable { @Nonnull public CumulusStructureType getType() { CumulusStructureType type = null; if (VLAN_INTERFACE_PATTERN.matcher(_name).matches()) { type = VLAN; } if (_vxlanId != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VXLAN); type = VXLAN; } if (_vrfTable != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VRF); type = VRF; } if (_bondSlaves != null && !_bondSlaves.isEmpty()) { checkState(type == null, "ambiguous interface type: %s vs %s", type, BOND); type = BOND; } return firstNonNull(type, INTERFACE); } InterfacesInterface(@Nonnull String name); }
InterfacesInterface implements Serializable { @Nonnull public CumulusStructureType getType() { CumulusStructureType type = null; if (VLAN_INTERFACE_PATTERN.matcher(_name).matches()) { type = VLAN; } if (_vxlanId != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VXLAN); type = VXLAN; } if (_vrfTable != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VRF); type = VRF; } if (_bondSlaves != null && !_bondSlaves.isEmpty()) { checkState(type == null, "ambiguous interface type: %s vs %s", type, BOND); type = BOND; } return firstNonNull(type, INTERFACE); } InterfacesInterface(@Nonnull String name); void addAddress(ConcreteInterfaceAddress address); @Nonnull InterfaceBridgeSettings createOrGetBridgeSettings(); @Nonnull InterfaceClagSettings createOrGetClagSettings(); @Nullable List<ConcreteInterfaceAddress> getAddresses(); @Nullable Map<MacAddress, Set<InterfaceAddress>> getAddressVirtuals(); @Nullable Set<String> getBondSlaves(); @Nullable Set<String> getBridgePorts(); @Nullable InterfaceBridgeSettings getBridgeSettings(); @Nullable Integer getClagId(); @Nullable InterfaceClagSettings getClagSettings(); @Nullable String getDescription(); @Nullable String getVrfTable(); @Nullable Integer getLinkSpeed(); @Nullable Integer getMtu(); @Nonnull String getName(); @Nonnull CumulusStructureType getType(); @Nullable Integer getVlanId(); @Nullable String getVlanRawDevice(); @Nullable String getVrf(); @Nullable Integer getVxlanId(); @Nullable Ip getVxlanLocalTunnelIp(); void setBondSlaves(Set<String> bondSlaves); void setBridgePorts(Set<String> bridgePorts); void setClagId(int clagId); void setDescription(String description); void setVrfTable(String vrfTable); void setLinkSpeed(int linkSpeed); void setMtu(int mtu); void setVlanId(int vlanId); void setVlanRawDevice(String vlanRawDevice); void setVrf(String vrf); void setVxlanId(int vxlanId); void setVxlanLocalTunnelIp(Ip vxlanLocalTunnelIp); void setAddressVirtual(MacAddress macAddress, ConcreteInterfaceAddress address); static boolean isPhysicalInterfaceType(String ifaceName); static boolean isVlanInterfaceType(String ifaceName); @Nonnull List<StaticRoute> getPostUpIpRoutes(); void addPostUpIpRoute(StaticRoute sr); @Nullable Ip getClagVxlanAnycastIp(); void setClagVxlanAnycastIp(@Nullable Ip clagVxlanAnycastIp); }
InterfacesInterface implements Serializable { @Nonnull public CumulusStructureType getType() { CumulusStructureType type = null; if (VLAN_INTERFACE_PATTERN.matcher(_name).matches()) { type = VLAN; } if (_vxlanId != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VXLAN); type = VXLAN; } if (_vrfTable != null) { checkState(type == null, "ambiguous interface type: %s vs %s", type, VRF); type = VRF; } if (_bondSlaves != null && !_bondSlaves.isEmpty()) { checkState(type == null, "ambiguous interface type: %s vs %s", type, BOND); type = BOND; } return firstNonNull(type, INTERFACE); } InterfacesInterface(@Nonnull String name); void addAddress(ConcreteInterfaceAddress address); @Nonnull InterfaceBridgeSettings createOrGetBridgeSettings(); @Nonnull InterfaceClagSettings createOrGetClagSettings(); @Nullable List<ConcreteInterfaceAddress> getAddresses(); @Nullable Map<MacAddress, Set<InterfaceAddress>> getAddressVirtuals(); @Nullable Set<String> getBondSlaves(); @Nullable Set<String> getBridgePorts(); @Nullable InterfaceBridgeSettings getBridgeSettings(); @Nullable Integer getClagId(); @Nullable InterfaceClagSettings getClagSettings(); @Nullable String getDescription(); @Nullable String getVrfTable(); @Nullable Integer getLinkSpeed(); @Nullable Integer getMtu(); @Nonnull String getName(); @Nonnull CumulusStructureType getType(); @Nullable Integer getVlanId(); @Nullable String getVlanRawDevice(); @Nullable String getVrf(); @Nullable Integer getVxlanId(); @Nullable Ip getVxlanLocalTunnelIp(); void setBondSlaves(Set<String> bondSlaves); void setBridgePorts(Set<String> bridgePorts); void setClagId(int clagId); void setDescription(String description); void setVrfTable(String vrfTable); void setLinkSpeed(int linkSpeed); void setMtu(int mtu); void setVlanId(int vlanId); void setVlanRawDevice(String vlanRawDevice); void setVrf(String vrf); void setVxlanId(int vxlanId); void setVxlanLocalTunnelIp(Ip vxlanLocalTunnelIp); void setAddressVirtual(MacAddress macAddress, ConcreteInterfaceAddress address); static boolean isPhysicalInterfaceType(String ifaceName); static boolean isVlanInterfaceType(String ifaceName); @Nonnull List<StaticRoute> getPostUpIpRoutes(); void addPostUpIpRoute(StaticRoute sr); @Nullable Ip getClagVxlanAnycastIp(); void setClagVxlanAnycastIp(@Nullable Ip clagVxlanAnycastIp); static final Pattern PHYSICAL_INTERFACE_PATTERN; static final Pattern VLAN_INTERFACE_PATTERN; static final Pattern VXLAN_INTERFACE_PATTERN; static final Pattern SUBINTERFACE_PATTERN; }