use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class FlowStatNotificationSupplierImpl method createNotification.
@Override
public FlowsStatisticsUpdate createNotification(final FlowStatistics flowStatistics, final InstanceIdentifier<FlowStatistics> path) {
Preconditions.checkArgument(flowStatistics != null);
Preconditions.checkArgument(path != null);
final FlowAndStatisticsMapListBuilder fsmlBuilder = new FlowAndStatisticsMapListBuilder(flowStatistics);
fsmlBuilder.setFlowId(new FlowId(path.firstKeyOf(Flow.class, FlowKey.class).getId().getValue()));
final FlowsStatisticsUpdateBuilder builder = new FlowsStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// NOTE : fix if it needs, but we have to ask DataStore for the NodeConnector list
builder.setNodeConnector(Collections.<NodeConnector>emptyList());
builder.setFlowAndStatisticsMapList(Collections.singletonList(fsmlBuilder.build()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class GroupStatNotificationSupplierImpl method createNotification.
@Override
public GroupStatisticsUpdated createNotification(final GroupStatistics groupStatistics, final InstanceIdentifier<GroupStatistics> path) {
Preconditions.checkArgument(groupStatistics != null);
Preconditions.checkArgument(path != null);
final GroupStatisticsUpdatedBuilder builder = new GroupStatisticsUpdatedBuilder();
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
builder.setNodeConnector(Collections.<NodeConnector>emptyList());
builder.setGroupStats(Collections.singletonList(new GroupStatsBuilder(groupStatistics).build()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class ActionUtil method readAction.
/**
* Deserialize OpenFlow action, using extension converter if available.
* TODO: Remove also extension converters
*
* @param version OpenFlow version
* @param message OpenFlow buffered message
* @param registry deserializer registry
* @param path Action path
*/
public static Action readAction(short version, ByteBuf message, DeserializerRegistry registry, ActionPath path) {
int type = message.getUnsignedShort(message.readerIndex());
Long expId = null;
if (type == EncodeConstants.EXPERIMENTER_VALUE) {
expId = message.getUnsignedInt(message.readerIndex() + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
}
try {
final MessageCodeExperimenterKey key = new MessageCodeExperimenterKey(version, type, Action.class, expId);
final OFDeserializer<Action> deserializer = registry.getDeserializer(key);
return deserializer.deserialize(message);
} catch (ClassCastException | IllegalStateException e) {
final MessageCodeKey key = Objects.nonNull(expId) ? new ExperimenterActionDeserializerKey(version, expId) : new ActionDeserializerKey(version, type, expId);
final OFDeserializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> deserializer = registry.getDeserializer(key);
return ActionExtensionHelper.processAlienAction(deserializer.deserialize(message), OpenflowVersion.get(version), path);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class ActionExtensionHelper method processAlienAction.
/**
* Processes an alien action.
*
* @param action openflow action
* @param ofVersion openflow version
* @param actionPath openflow action path
* @return augmentation wrapper containing augmentation depending on matchPath
*/
public static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action processAlienAction(final Action action, final OpenflowVersion ofVersion, final ActionPath actionPath) {
ConvertorActionFromOFJava<Action, ActionPath> convertor = null;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null;
final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider();
if (Objects.isNull(extensionConvertorProvider)) {
return null;
}
if (action.getActionChoice() instanceof ExperimenterIdCase) {
ExperimenterIdCase actionCase = (ExperimenterIdCase) action.getActionChoice();
// TODO: EXTENSION PROPOSAL (action, OFJava to MD-SAL)
ExperimenterActionSerializerKey key = new ExperimenterActionSerializerKey(ofVersion.getVersion(), actionCase.getExperimenter().getExperimenter().getValue(), actionCase.getExperimenter().getSubType());
convertor = extensionConvertorProvider.getActionConverter(key);
} else if (action.getActionChoice() != null) {
ActionSerializerKey<?> key = new ActionSerializerKey(EncodeConstants.OF13_VERSION_ID, action.getActionChoice().getImplementedInterface(), null);
convertor = extensionConvertorProvider.getActionConverter(key);
}
if (convertor != null) {
alienAction = convertor.convert(action, actionPath);
}
return alienAction;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class ResubmitConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionResubmit action = ((ActionResubmit) input.getActionChoice()).getNxActionResubmit();
NxResubmitBuilder builder = new NxResubmitBuilder();
builder.setInPort(action.getInPort());
builder.setTable(action.getTable());
return resolveAction(builder.build(), path);
}
Aggregations