use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class LinkOperationsServiceTest method shouldPropagateBfdPropertiesUpdateOnFullUpdate.
@Test
public void shouldPropagateBfdPropertiesUpdateOnFullUpdate() throws IslNotFoundException {
createIsl(IslStatus.ACTIVE);
Endpoint source = Endpoint.of(TEST_SWITCH_A_ID, TEST_SWITCH_A_PORT);
Endpoint destination = Endpoint.of(TEST_SWITCH_B_ID, TEST_SWITCH_B_PORT);
linkOperationsService.writeBfdProperties(source, destination, defaultBfdProperties);
verifyBfdProperties(defaultBfdProperties);
verify(carrier, times(1)).islBfdPropertiesChanged(eq(source), eq(destination));
verifyNoMoreInteractions(carrier);
reset(carrier);
// no propagation on subsequent request
linkOperationsService.writeBfdProperties(source, destination, defaultBfdProperties);
verifyZeroInteractions(carrier);
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class LinkOperationsBolt method bfdPropertiesRead.
private BfdPropertiesResponse bfdPropertiesRead(BfdPropertiesReadRequest request) {
Endpoint source = new Endpoint(request.getSource());
Endpoint destination = new Endpoint(request.getDestination());
try {
return linkOperationsService.readBfdProperties(source, destination);
} catch (IslNotFoundException e) {
throw new MessageException(ErrorType.NOT_FOUND, e.getMessage(), "ISL was not found.");
}
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class DiscoveryPollMonitor method actualUpdate.
@Override
public void actualUpdate(IslFsmEvent event, IslFsmContext context) {
Endpoint endpoint = context.getEndpoint();
IslEndpointPollStatus update = discoveryData.get(endpoint);
switch(event) {
case ISL_UP:
update = new IslEndpointPollStatus(context.getIslData(), IslStatus.ACTIVE);
log.info("ISL {} data update - bind:{} - {}", reference, endpoint, update.getIslData());
break;
case ISL_DOWN:
update = new IslEndpointPollStatus(update.getIslData(), IslStatus.INACTIVE);
break;
case ISL_MOVE:
// We must track MOVED state, because poll and moved monitor save it's status
// inside same field {@link Isl.actualStatus}. In other case we will rewrite MOVED state
// saved by {@link DiscoveryMovedMonitor} with our ovn "vision".
update = new IslEndpointPollStatus(update.getIslData(), IslStatus.MOVED);
break;
default:
}
discoveryData.put(endpoint, update);
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class DiscoveryBfdMonitor method actualUpdate.
@Override
public void actualUpdate(IslFsmEvent event, IslFsmContext context) {
final Endpoint endpoint = context.getEndpoint();
IslEndpointBfdStatus update = null;
switch(event) {
case BFD_UP:
update = new IslEndpointBfdStatus(true, BfdSessionStatus.UP);
break;
case BFD_DOWN:
update = new IslEndpointBfdStatus(true, BfdSessionStatus.DOWN);
break;
case BFD_KILL:
update = new IslEndpointBfdStatus(false, null);
break;
case BFD_FAIL:
update = new IslEndpointBfdStatus(false, BfdSessionStatus.FAIL);
break;
default:
}
if (update != null) {
discoveryData.put(endpoint, update);
}
}
use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.
the class IslFsm method handleRemovedRule.
// FIXME(surabujin): protect from stale responses
public void handleRemovedRule(IslFsmState from, IslFsmState to, IslFsmEvent event, IslFsmContext context) {
Endpoint endpoint = context.getRemovedRulesEndpoint();
if (endpoint == null) {
throw new IllegalArgumentException(makeInvalidResourceManipulationResponseMessage());
}
log.info("Receive response on ISL resource release request for {} (from {})", reference, endpoint.getDatapath());
endpointResourcesManagementCompleteStatus.put(endpoint, true);
if (isResourcesManagementCompleted()) {
fire(IslFsmEvent._RESOURCES_DONE, context);
}
}
Aggregations