@Test public void testGetSpeakerFromPeer() throws Exception { assertNotNull(bgpConfig.getSpeakerFromPeer(IP1)); assertNull(bgpConfig.getSpeakerFromPeer(IP_NON_EXIST)); }
public BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress) { for (BgpConfig.BgpSpeakerConfig speaker : bgpSpeakers()) { if (speaker.peers().contains(peerAddress)) { return speaker; } } return null; }
BgpConfig extends Config<ApplicationId> { public BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress) { for (BgpConfig.BgpSpeakerConfig speaker : bgpSpeakers()) { if (speaker.peers().contains(peerAddress)) { return speaker; } } return null; } }
BgpConfig extends Config<ApplicationId> { public BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress) { for (BgpConfig.BgpSpeakerConfig speaker : bgpSpeakers()) { if (speaker.peers().contains(peerAddress)) { return speaker; } } return null; }  }
BgpConfig extends Config<ApplicationId> { public BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress) { for (BgpConfig.BgpSpeakerConfig speaker : bgpSpeakers()) { if (speaker.peers().contains(peerAddress)) { return speaker; } } return null; }  Set<BgpSpeakerConfig> bgpSpeakers(); BgpSpeakerConfig getSpeakerWithName(String name); void addSpeaker(BgpSpeakerConfig speaker); void removeSpeaker(String speakerName); void addPeerToSpeaker(String speakerName, IpAddress peerAddress); BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress); void removePeerFromSpeaker(BgpSpeakerConfig speaker, IpAddress peerAddress); }
BgpConfig extends Config<ApplicationId> { public BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress) { for (BgpConfig.BgpSpeakerConfig speaker : bgpSpeakers()) { if (speaker.peers().contains(peerAddress)) { return speaker; } } return null; }  Set<BgpSpeakerConfig> bgpSpeakers(); BgpSpeakerConfig getSpeakerWithName(String name); void addSpeaker(BgpSpeakerConfig speaker); void removeSpeaker(String speakerName); void addPeerToSpeaker(String speakerName, IpAddress peerAddress); BgpSpeakerConfig getSpeakerFromPeer(IpAddress peerAddress); void removePeerFromSpeaker(BgpSpeakerConfig speaker, IpAddress peerAddress); static final String SPEAKERS; static final String CONNECT_POINT; static final String NAME; static final String PEERS; static final String VLAN; }