use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State in project genius by opendaylight.
the class AlivenessMonitor method publishNotification.
void publishNotification(final Long monitorId, final LivenessState state) {
LOG.debug("Sending notification for id {} - state {}", monitorId, state);
EventData data = new EventDataBuilder().setMonitorId(monitorId).setMonitorState(state).build();
MonitorEvent event = new MonitorEventBuilder().setEventData(data).build();
final ListenableFuture<?> eventFuture = notificationPublishService.offerNotification(event);
Futures.addCallback(eventFuture, new FutureCallback<Object>() {
@Override
public void onFailure(Throwable error) {
LOG.warn("Error in notifying listeners for id {} - state {}", monitorId, state, error);
}
@Override
public void onSuccess(Object arg) {
LOG.trace("Successful in notifying listeners for id {} - state {}", monitorId, state);
}
}, callbackExecutorService);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State in project genius by opendaylight.
the class SouthboundUtils method addStateEntry.
public static void addStateEntry(Interface interfaceInfo, IfTunnel ifTunnel, WriteTransaction transaction) {
LOG.debug("adding tep interface state for {}", interfaceInfo);
if (interfaceInfo == null) {
return;
}
OperStatus operStatus = OperStatus.Up;
AdminStatus adminStatus = AdminStatus.Up;
if (!interfaceInfo.isEnabled()) {
operStatus = OperStatus.Down;
}
List<String> childLowerLayerIfList = new ArrayList<>();
childLowerLayerIfList.add(0, SouthboundUtils.getTerminationPointKeyString(ifTunnel.getTunnelDestination().getIpv4Address().getValue()));
InterfaceBuilder ifaceBuilder = new InterfaceBuilder().setAdminStatus(adminStatus).setOperStatus(operStatus).setLowerLayerIf(childLowerLayerIfList);
ifaceBuilder.setType(interfaceInfo.getType());
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> ifStateId = IfmUtil.buildStateInterfaceId(interfaceInfo.getName());
ifaceBuilder.setKey(IfmUtil.getStateInterfaceKeyFromName(interfaceInfo.getName()));
transaction.put(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build(), true);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State in project genius by opendaylight.
the class OvsInterfaceConfigUpdateHelper method handleInterfaceAdminStateUpdates.
private void handleInterfaceAdminStateUpdates(WriteTransaction transaction, Interface interfaceNew, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
IfL2vlan ifL2vlan = interfaceNew.getAugmentation(IfL2vlan.class);
if (ifL2vlan == null || IfL2vlan.L2vlanMode.Trunk != ifL2vlan.getL2vlanMode() && IfL2vlan.L2vlanMode.Transparent != ifL2vlan.getL2vlanMode()) {
return;
}
LOG.info("admin-state modified for interface {}", interfaceNew.getName());
OperStatus operStatus = interfaceManagerCommonUtils.updateStateEntry(interfaceNew, transaction, ifState);
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceNew.getName());
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceParentEntryKey);
if (interfaceParentEntry == null || interfaceParentEntry.getInterfaceChildEntry() == null) {
return;
}
VlanMemberStateUpdateWorker vlanMemberStateUpdateWorker = new VlanMemberStateUpdateWorker(txRunner, operStatus, interfaceParentEntry.getInterfaceChildEntry());
coordinator.enqueueJob(interfaceNew.getName(), vlanMemberStateUpdateWorker, IfmConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildFlowCapableNodeConnector.
static FlowCapableNodeConnector buildFlowCapableNodeConnector(boolean isPortDown, boolean isLive, String macAddress, String portName) {
PortConfig portConfig = new PortConfig(false, false, false, isPortDown);
State state = new StateBuilder().setBlocked(true).setLinkDown(false).setLive(isLive).build();
FlowCapableNodeConnectorBuilder fcNodeConnector = new FlowCapableNodeConnectorBuilder().setName(portName).setHardwareAddress(MacAddress.getDefaultInstance(macAddress)).setConfiguration(portConfig).setState(state);
return fcNodeConnector.build();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State in project genius by opendaylight.
the class OvsdbSouthboundTestUtil method updateTerminationPoint.
public static void updateTerminationPoint(DataBroker dataBroker, String interfaceName, Class<? extends InterfaceTypeBase> type) throws TransactionCommitFailedException {
final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
InstanceIdentifier<TerminationPoint> tpId = createTerminationPointInstanceIdentifier(InstanceIdentifier.keyOf(bridgeIid.firstIdentifierOf(Node.class)), interfaceName);
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(InstanceIdentifier.keyOf(tpId));
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
tpAugmentationBuilder.setName(interfaceName);
if (type != null) {
tpAugmentationBuilder.setInterfaceType(type);
}
List<InterfaceBfdStatus> interfaceBfdStatuses = Arrays.asList(new InterfaceBfdStatusBuilder().setBfdStatusKey("state").setBfdStatusValue("down").build());
tpAugmentationBuilder.setInterfaceBfdStatus(interfaceBfdStatuses);
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.merge(OPERATIONAL, tpId, tpBuilder.build(), true);
tx.submit().checkedGet();
}
Aggregations