use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class CtStateConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
CtStateCaseValue ctStateCaseValue = (CtStateCaseValue) input.getMatchEntryValue();
NxmNxCtStateBuilder ctStateBuilder = new NxmNxCtStateBuilder();
ctStateBuilder.setCtState(ctStateCaseValue.getCtStateValues().getCtState());
ctStateBuilder.setMask(ctStateCaseValue.getCtStateValues().getMask());
return resolveAugmentation(ctStateBuilder.build(), path, NxmNxCtStateKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class UdpSrcConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
UdpSrcCaseValue udpSrcCaseValue = (UdpSrcCaseValue) input.getMatchEntryValue();
NxmOfUdpSrcBuilder udpSrcBuilder = new NxmOfUdpSrcBuilder();
udpSrcBuilder.setPort(udpSrcCaseValue.getUdpSrcValues().getPort());
udpSrcBuilder.setMask(udpSrcCaseValue.getUdpSrcValues().getMask());
return resolveAugmentation(udpSrcBuilder.build(), path, NxmOfUdpSrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class RegConvertor method convert.
@SuppressWarnings("unchecked")
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
NxmNxRegBuilder nxRegBuilder = new NxmNxRegBuilder();
if (!org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class.isAssignableFrom(input.getOxmMatchField())) {
String msg = input.getOxmMatchField() + " does not implement " + org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class;
LOG.warn(msg);
throw new IllegalStateException(msg);
}
nxRegBuilder.setReg((Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg>) input.getOxmMatchField());
RegCaseValue regCaseValue = (RegCaseValue) input.getMatchEntryValue();
nxRegBuilder.setValue(regCaseValue.getRegValues().getValue());
if (input.isHasMask()) {
nxRegBuilder.setMask(regCaseValue.getRegValues().getMask());
}
return resolveAugmentation(nxRegBuilder.build(), path, resolveRegKey(input.getOxmMatchField()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class TcpSrcConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
TcpSrcCaseValue tcpSrcCaseValue = (TcpSrcCaseValue) input.getMatchEntryValue();
NxmOfTcpSrcBuilder tcpSrcBuilder = new NxmOfTcpSrcBuilder();
tcpSrcBuilder.setPort(tcpSrcCaseValue.getTcpSrcValues().getPort());
tcpSrcBuilder.setMask(tcpSrcCaseValue.getTcpSrcValues().getMask());
return resolveAugmentation(tcpSrcBuilder.build(), path, NxmOfTcpSrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class DeviceFlowRegistryImpl method fillFromDatastore.
private CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> fillFromDatastore(final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<FlowCapableNode> path) {
// Create new read-only transaction
final ReadOnlyTransaction transaction = dataBroker.newReadOnlyTransaction();
// Bail out early if transaction is null
if (transaction == null) {
return Futures.immediateFailedCheckedFuture(new ReadFailedException("Read transaction is null"));
}
// Prepare read operation from datastore for path
final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> future = transaction.read(logicalDatastoreType, path);
// Bail out early if future is null
if (future == null) {
return Futures.immediateFailedCheckedFuture(new ReadFailedException("Future from read transaction is null"));
}
Futures.addCallback(future, new FutureCallback<Optional<FlowCapableNode>>() {
@Override
public void onSuccess(@Nonnull Optional<FlowCapableNode> result) {
result.asSet().stream().filter(Objects::nonNull).filter(flowCapableNode -> Objects.nonNull(flowCapableNode.getTable())).flatMap(flowCapableNode -> flowCapableNode.getTable().stream()).filter(Objects::nonNull).filter(table -> Objects.nonNull(table.getFlow())).flatMap(table -> table.getFlow().stream()).filter(Objects::nonNull).filter(flow -> Objects.nonNull(flow.getId())).forEach(flowConsumer);
// After we are done with reading from datastore, close the transaction
transaction.close();
}
@Override
public void onFailure(Throwable throwable) {
// Even when read operation failed, close the transaction
transaction.close();
}
}, MoreExecutors.directExecutor());
return future;
}
Aggregations