Search in sources :

Example 1 with SpeakerSwitchDescription

use of org.openkilda.messaging.model.SpeakerSwitchDescription in project open-kilda by telstra.

the class SwitchFsm method persistSwitchData.

private void persistSwitchData(SpeakerSwitchView speakerSwitchView, SwitchAvailabilityData availabilityData) {
    Switch sw = lookupSwitchCreateIfMissing();
    IpSocketAddress socketAddress = speakerSwitchView.getSwitchSocketAddress();
    sw.setSocketAddress(socketAddress);
    sw.setHostname(speakerSwitchView.getHostname());
    SpeakerSwitchDescription description = speakerSwitchView.getDescription();
    sw.setDescription(String.format("%s %s %s", description.getManufacturer(), speakerSwitchView.getOfVersion(), description.getSoftware()));
    sw.setOfVersion(speakerSwitchView.getOfVersion());
    sw.setOfDescriptionManufacturer(description.getManufacturer());
    sw.setOfDescriptionHardware(description.getHardware());
    sw.setOfDescriptionSoftware(description.getSoftware());
    sw.setOfDescriptionSerialNumber(description.getSerialNumber());
    sw.setOfDescriptionDatapath(description.getDatapath());
    sw.setStatus(SwitchStatus.INACTIVE);
    sw.setFeatures(speakerSwitchView.getFeatures());
    persistSwitchProperties(sw);
    persistSwitchConnections(sw, availabilityData);
}
Also used : Switch(org.openkilda.model.Switch) IpSocketAddress(org.openkilda.model.IpSocketAddress) SpeakerSwitchDescription(org.openkilda.messaging.model.SpeakerSwitchDescription)

Aggregations

SpeakerSwitchDescription (org.openkilda.messaging.model.SpeakerSwitchDescription)1 IpSocketAddress (org.openkilda.model.IpSocketAddress)1 Switch (org.openkilda.model.Switch)1