class BgpConfig extends Config<ApplicationId> {

    public void addSpeaker(BgpSpeakerConfig speaker) {
        ObjectNode speakerNode = JsonNodeFactory.instance.objectNode();

        speakerNode.put(NAME, speaker.name().get());

        speakerNode.put(VLAN, speaker.vlan().toString());

        speakerNode.put(CONNECT_POINT, speaker.connectPoint().elementId().toString()
                + "/" + speaker.connectPoint().port().toString());

        ArrayNode peersNode = speakerNode.putArray(PEERS);
        for (IpAddress peerAddress: speaker.peers()) {
            peersNode.add(peerAddress.toString());
        }

        ArrayNode speakersArray = bgpSpeakers().isEmpty() ?
                initBgpConfiguration() : (ArrayNode) object.get(SPEAKERS);
        speakersArray.add(speakerNode);
    }

}