use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.OperationalStatus in project bgpcep by opendaylight.
the class Stateful07TopologySessionListener method ensureLspOperational.
@Override
public synchronized ListenableFuture<OperationResult> ensureLspOperational(@Nonnull final EnsureLspOperationalInput input) {
Preconditions.checkArgument(input != null && input.getName() != null && input.getNode() != null && input.getArguments() != null, MISSING_XML_TAG);
final OperationalStatus op;
final Arguments1 aa = input.getArguments().getAugmentation(Arguments1.class);
if (aa != null) {
op = aa.getOperational();
} else {
op = null;
}
// Make sure the LSP exists
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName());
LOG.debug("Checking if LSP {} has operational state {}", lsp, op);
final ListenableFuture<Optional<ReportedLsp>> f = readOperationalData(lsp);
if (f == null) {
return OperationResults.createUnsent(PCEPErrors.LSP_INTERNAL_ERROR).future();
}
return listenableFuture(f, input, op);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.OperationalStatus in project openflowplugin by opendaylight.
the class LLDPSpeaker method run.
/**
* Send LLDPDU frames to all known openflow switch ports.
*/
@Override
public void run() {
if (OperStatus.RUN.equals(operationalStatus)) {
LOG.debug("Sending LLDP frames to nodes {}", Arrays.toString(deviceOwnershipStatusService.getOwnedNodes().toArray()));
LOG.debug("Sending LLDP frames to total {} ports", getOwnedPorts());
nodeConnectorMap.keySet().forEach(ncIID -> {
NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(ncIID).getId();
NodeId nodeId = ncIID.firstKeyOf(Node.class, NodeKey.class).getId();
if (deviceOwnershipStatusService.isEntityOwned(nodeId.getValue())) {
LOG.debug("Node is owned by this controller, sending LLDP packet through port {}", nodeConnectorId.getValue());
packetProcessingService.transmitPacket(nodeConnectorMap.get(ncIID));
} else {
LOG.trace("Node {} is not owned by this controller, so skip sending LLDP packet on port {}", nodeId.getValue(), nodeConnectorId.getValue());
}
});
}
}
Aggregations