@Test public void getIsPassiveTest() { assertFalse( getIsPassive( BgpActivePeerConfig.builder() .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()) .build())); assertFalse( getIsPassive( BgpUnnumberedPeerConfig.builder() .setPeerInterface("i") .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()) .build())); assertTrue( getIsPassive( BgpPassivePeerConfig.builder() .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()) .build())); }
@VisibleForTesting static boolean getIsPassive(@Nonnull BgpPeerConfig peer) { if (peer instanceof BgpActivePeerConfig || peer instanceof BgpUnnumberedPeerConfig) { return false; } if (peer instanceof BgpPassivePeerConfig) { return true; } throw new IllegalArgumentException(String.format("Unrecognized peer type: %s", peer)); }
BgpPeerPropertySpecifier extends PropertySpecifier { @VisibleForTesting static boolean getIsPassive(@Nonnull BgpPeerConfig peer) { if (peer instanceof BgpActivePeerConfig || peer instanceof BgpUnnumberedPeerConfig) { return false; } if (peer instanceof BgpPassivePeerConfig) { return true; } throw new IllegalArgumentException(String.format("Unrecognized peer type: %s", peer)); } }
BgpPeerPropertySpecifier extends PropertySpecifier { @VisibleForTesting static boolean getIsPassive(@Nonnull BgpPeerConfig peer) { if (peer instanceof BgpActivePeerConfig || peer instanceof BgpUnnumberedPeerConfig) { return false; } if (peer instanceof BgpPassivePeerConfig) { return true; } throw new IllegalArgumentException(String.format("Unrecognized peer type: %s", peer)); } BgpPeerPropertySpecifier(Set<String> properties); }
BgpPeerPropertySpecifier extends PropertySpecifier { @VisibleForTesting static boolean getIsPassive(@Nonnull BgpPeerConfig peer) { if (peer instanceof BgpActivePeerConfig || peer instanceof BgpUnnumberedPeerConfig) { return false; } if (peer instanceof BgpPassivePeerConfig) { return true; } throw new IllegalArgumentException(String.format("Unrecognized peer type: %s", peer)); } BgpPeerPropertySpecifier(Set<String> properties); static PropertyDescriptor<BgpPeerConfig> getPropertyDescriptor(String property); static BgpPeerPropertySpecifier create(@Nullable String expression); @Override List<String> getMatchingProperties(); @Override boolean equals(Object o); @Override int hashCode(); }
BgpPeerPropertySpecifier extends PropertySpecifier { @VisibleForTesting static boolean getIsPassive(@Nonnull BgpPeerConfig peer) { if (peer instanceof BgpActivePeerConfig || peer instanceof BgpUnnumberedPeerConfig) { return false; } if (peer instanceof BgpPassivePeerConfig) { return true; } throw new IllegalArgumentException(String.format("Unrecognized peer type: %s", peer)); } BgpPeerPropertySpecifier(Set<String> properties); static PropertyDescriptor<BgpPeerConfig> getPropertyDescriptor(String property); static BgpPeerPropertySpecifier create(@Nullable String expression); @Override List<String> getMatchingProperties(); @Override boolean equals(Object o); @Override int hashCode(); static final String CONFEDERATION; static final String LOCAL_AS; static final String LOCAL_IP; static final String IS_PASSIVE; static final String REMOTE_AS; static final String ROUTE_REFLECTOR_CLIENT; static final String CLUSTER_ID; static final String PEER_GROUP; static final String IMPORT_POLICY; static final String EXPORT_POLICY; static final String SEND_COMMUNITY; static final BgpPeerPropertySpecifier ALL; }