import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public final class ActionExtensionHelper {
- private static final Logger LOG = LoggerFactory
- .getLogger(ActionExtensionHelper.class);
-
private ActionExtensionHelper() {
throw new IllegalAccessError("singleton enforcement");
}
/**
+ * 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) {
+ 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();
return null;
}
- if(action.getActionChoice() instanceof ExperimenterIdCase) {
+ if (action.getActionChoice() instanceof ExperimenterIdCase) {
ExperimenterIdCase actionCase = (ExperimenterIdCase) action.getActionChoice();
- /** TODO: EXTENSION PROPOSAL (action, OFJava to MD-SAL) */
+ // 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);
+ } else if (action.getActionChoice() != null) {
+ ActionSerializerKey<?> key = new ActionSerializerKey(EncodeConstants.OF13_VERSION_ID,
+ action.getActionChoice().getImplementedInterface(), null);
convertor = extensionConvertorProvider.getActionConverter(key);
}
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey;
+import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
-import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
import org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava;
import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterManager;
import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
- * simple map-based registration engine implementation
+ * Simple map-based registration engine implementation.
*/
public class ExtensionConverterManagerImpl implements ExtensionConverterManager {
private final Map<MessageTypeKey<?>, ConvertorFromOFJava<?, ?>> registryFromOFJAva;
private final Map<ConverterExtensionKey<?>, ConvertorToOFJava<?>> registryToOFJAva;
- private final Map<TypeVersionKey<? extends Action>, ConvertorActionToOFJava<? extends Action, ? extends DataContainer>> registryActionToOFJAva;
+ private final Map<TypeVersionKey<? extends Action>, ConvertorActionToOFJava<? extends Action,
+ ? extends DataContainer>> registryActionToOFJAva;
private final Map<MessageTypeKey<?>, ConvertorActionFromOFJava<?, ?>> registryActionFromOFJAva;
- private final Map<TypeVersionKey<?>, ConverterMessageToOFJava<? extends ExperimenterMessageOfChoice, ? extends DataContainer>> registryMessageToOFJAva;
- private final Map<MessageTypeKey<?>, ConvertorMessageFromOFJava<? extends ExperimenterDataOfChoice, MessagePath>> registryMessageFromOFJAva;
+ private final Map<TypeVersionKey<?>, ConverterMessageToOFJava<? extends ExperimenterMessageOfChoice,
+ ? extends DataContainer>> registryMessageToOFJAva;
+ private final Map<MessageTypeKey<?>, ConvertorMessageFromOFJava<? extends ExperimenterDataOfChoice, MessagePath>>
+ registryMessageFromOFJAva;
/**
- * default ctor
+ * Default constructor.
*/
public ExtensionConverterManagerImpl() {
registryFromOFJAva = new ConcurrentHashMap<>();
}
/**
+ * Creates a registration closer.
+ *
* @param key message key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <FROM extends DataContainer, PATH extends AugmentationPath, KEY extends MessageTypeKey<?>>
- RegistrationCloserFromOFJava<FROM, PATH> hireJanitor(
- final KEY key, final ConvertorFromOFJava<FROM, PATH> extConvertor) {
- RegistrationCloserFromOFJava<FROM, PATH> janitor = new RegistrationCloser.RegistrationCloserFromOFJava<>();
+ private <F extends DataContainer, P extends AugmentationPath, K extends MessageTypeKey<?>>
+ RegistrationCloserFromOFJava<F, P> hireJanitor(final K key,
+ final ConvertorFromOFJava<F, P> extConvertor) {
+ RegistrationCloserFromOFJava<F, P> janitor = new RegistrationCloser.RegistrationCloserFromOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
+ * Creates a registration closer.
+ *
* @param key message type key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <FROM extends DataContainer, PATH extends AugmentationPath, KEY extends MessageTypeKey<?>>
- RegistrationCloserActionFromOFJava<FROM, PATH> hireJanitor(
- final KEY key, final ConvertorActionFromOFJava<FROM, PATH> extConvertor) {
- RegistrationCloserActionFromOFJava<FROM, PATH> janitor = new RegistrationCloser.RegistrationCloserActionFromOFJava<>();
+ private <F extends DataContainer, P extends AugmentationPath, K extends MessageTypeKey<?>>
+ RegistrationCloserActionFromOFJava<F, P> hireJanitor(
+ final K key, final ConvertorActionFromOFJava<F, P> extConvertor) {
+ RegistrationCloserActionFromOFJava<F, P> janitor =
+ new RegistrationCloser.RegistrationCloserActionFromOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
+ * Creates a registration closer.
+ *
* @param key message type key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <TO extends DataContainer> RegistrationCloserToOFJava<TO> hireJanitor(
- final ConverterExtensionKey<? extends ExtensionKey> key, final ConvertorToOFJava<TO> extConvertor) {
- RegistrationCloserToOFJava<TO> janitor = new RegistrationCloser.RegistrationCloserToOFJava<>();
+ private <T extends DataContainer> RegistrationCloserToOFJava<T> hireJanitor(
+ final ConverterExtensionKey<? extends ExtensionKey> key, final ConvertorToOFJava<T> extConvertor) {
+ RegistrationCloserToOFJava<T> janitor = new RegistrationCloser.RegistrationCloserToOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
+ * Creates a registration closer.
+ *
* @param key message type key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <TO extends DataContainer> RegistrationCloserActionToOFJava<TO> hireJanitor(
- final TypeVersionKey<? extends Action> key, final ConvertorActionToOFJava<Action, TO> extConvertor) {
- RegistrationCloserActionToOFJava<TO> janitor = new RegistrationCloser.RegistrationCloserActionToOFJava<>();
+ private <T extends DataContainer> RegistrationCloserActionToOFJava<T> hireJanitor(
+ final TypeVersionKey<? extends Action> key, final ConvertorActionToOFJava<Action, T> extConvertor) {
+ RegistrationCloserActionToOFJava<T> janitor = new RegistrationCloser.RegistrationCloserActionToOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
+ * Creates a registration closer.
+ *
* @param key message type key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <TO extends DataContainer, K extends ExperimenterMessageOfChoice> RegistrationCloserMessageToOFJava<TO, K> hireMessageJanitor(
- final TypeVersionKey<K> key,
- final ConverterMessageToOFJava<K, TO> extConvertor) {
- RegistrationCloserMessageToOFJava<TO, K> janitor = new RegistrationCloserMessageToOFJava<>();
+ private <T extends DataContainer, K extends ExperimenterMessageOfChoice> RegistrationCloserMessageToOFJava<T, K>
+ hireMessageJanitor(final TypeVersionKey<K> key, final ConverterMessageToOFJava<K, T> extConvertor) {
+ RegistrationCloserMessageToOFJava<T, K> janitor = new RegistrationCloserMessageToOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
+ * Creates a registration closer.
+ *
* @param key message type key
* @param extConvertor extension convertor
* @return registration closure
*/
- private <FROM extends DataContainer, PATH extends AugmentationPath, KEY extends MessageTypeKey<?>>
- RegistrationCloserMessageFromOFJava<FROM, PATH> hireMessageJanitor(
- final KEY key, final ConvertorMessageFromOFJava<FROM, PATH> extConvertor) {
- RegistrationCloserMessageFromOFJava<FROM, PATH> janitor = new RegistrationCloserMessageFromOFJava<>();
+ private <F extends DataContainer, P extends AugmentationPath, K extends MessageTypeKey<?>>
+ RegistrationCloserMessageFromOFJava<F, P> hireMessageJanitor(
+ final K key, final ConvertorMessageFromOFJava<F, P> extConvertor) {
+ RegistrationCloserMessageFromOFJava<F, P> janitor = new RegistrationCloserMessageFromOFJava<>();
janitor.setConverter(extConvertor);
janitor.setKey(key);
janitor.setRegistrator(this);
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
}
/**
- * cancel registration of given converter
+ * Cancel registration of given converter.
*
* @param key message key
* @param converter extension convertor
@SuppressWarnings("unchecked")
@Override
- public <FROM extends DataContainer> ConvertorToOFJava<FROM> getConverter(
+ public <F extends DataContainer> ConvertorToOFJava<F> getConverter(
final ConverterExtensionKey<?> key) {
- return (ConvertorToOFJava<FROM>) registryToOFJAva.get(key);
+ return (ConvertorToOFJava<F>) registryToOFJAva.get(key);
}
@SuppressWarnings("unchecked")
@Override
- public <FROM extends Action, TO extends DataContainer> ConvertorActionToOFJava<FROM, TO> getConverter(
- final TypeVersionKey<FROM> key) {
- return (ConvertorActionToOFJava<FROM, TO>) registryActionToOFJAva.get(key);
+ public <F extends Action, T extends DataContainer> ConvertorActionToOFJava<F, T> getConverter(
+ final TypeVersionKey<F> key) {
+ return (ConvertorActionToOFJava<F, T>) registryActionToOFJAva.get(key);
}
@SuppressWarnings("unchecked")
@Override
- public <FROM extends DataContainer, PATH extends AugmentationPath> ConvertorFromOFJava<FROM, PATH> getConverter(
+ public <F extends DataContainer, P extends AugmentationPath> ConvertorFromOFJava<F, P> getConverter(
final MessageTypeKey<?> key) {
- return (ConvertorFromOFJava<FROM, PATH>) registryFromOFJAva.get(key);
+ return (ConvertorFromOFJava<F, P>) registryFromOFJAva.get(key);
}
@SuppressWarnings("unchecked")
@Override
- public <FROM extends DataContainer, PATH extends AugmentationPath> ConvertorActionFromOFJava<FROM, PATH> getActionConverter(
+ public <F extends DataContainer, P extends AugmentationPath> ConvertorActionFromOFJava<F, P> getActionConverter(
final MessageTypeKey<?> key) {
- return (ConvertorActionFromOFJava<FROM, PATH>) registryActionFromOFJAva.get(key);
+ return (ConvertorActionFromOFJava<F, P>) registryActionFromOFJAva.get(key);
}
@Override
- public ObjectRegistration<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>>
- registerActionConvertor(
- final TypeVersionKey<? extends Action> key,
- final ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> convertor) {
+ public ObjectRegistration<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
+ .common.action.rev150203.actions.grouping.Action>> registerActionConvertor(
+ final TypeVersionKey<? extends Action> key,final ConvertorActionToOFJava<Action, org.opendaylight
+ .yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> convertor) {
registryActionToOFJAva.put(key, convertor);
return hireJanitor(key, convertor);
}
@Override
- public ObjectRegistration<ConvertorActionFromOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action, ActionPath>>
- registerActionConvertor(
- final ActionSerializerKey<?> key,
- final ConvertorActionFromOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action, ActionPath> convertor) {
+ public ObjectRegistration<ConvertorActionFromOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common
+ .action.rev150203.actions.grouping.Action, ActionPath>> registerActionConvertor(
+ final ActionSerializerKey<?> key,
+ final ConvertorActionFromOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action
+ .rev150203.actions.grouping.Action, ActionPath> convertor) {
registryActionFromOFJAva.put(key, convertor);
return hireJanitor(key, convertor);
}
@Override
- public ObjectRegistration<ConvertorToOFJava<MatchEntry>> registerMatchConvertor(final ConverterExtensionKey<? extends ExtensionKey> key,
- final ConvertorToOFJava<MatchEntry> convertor) {
+ public ObjectRegistration<ConvertorToOFJava<MatchEntry>> registerMatchConvertor(
+ final ConverterExtensionKey<? extends ExtensionKey> key, final ConvertorToOFJava<MatchEntry> convertor) {
registryToOFJAva.put(key, convertor);
return hireJanitor(key, convertor);
}
}
@Override
- public <I extends ExperimenterMessageOfChoice, O extends DataContainer> ObjectRegistration<ConverterMessageToOFJava<I, O>> registerMessageConvertor(
- TypeVersionKey<I> key, ConverterMessageToOFJava<I, O> convertor) {
+ public <I extends ExperimenterMessageOfChoice, O extends DataContainer>
+ ObjectRegistration<ConverterMessageToOFJava<I, O>> registerMessageConvertor(
+ TypeVersionKey<I> key, ConverterMessageToOFJava<I, O> convertor) {
registryMessageToOFJAva.put(key, convertor);
return hireMessageJanitor(key, convertor);
}
@Override
- public <I extends ExperimenterDataOfChoice> ObjectRegistration<ConvertorMessageFromOFJava<I, MessagePath>> registerMessageConvertor(
- MessageTypeKey<?> key, ConvertorMessageFromOFJava<I, MessagePath> convertor) {
+ public <I extends ExperimenterDataOfChoice> ObjectRegistration<ConvertorMessageFromOFJava<I, MessagePath>>
+ registerMessageConvertor(MessageTypeKey<?> key, ConvertorMessageFromOFJava<I, MessagePath> convertor) {
registryMessageFromOFJAva.put(key, convertor);
return hireMessageJanitor(key, convertor);
}
@Override
- public <F extends ExperimenterMessageOfChoice, T extends DataContainer> ConverterMessageToOFJava<F, T> getMessageConverter(TypeVersionKey<F> key) {
+ public <F extends ExperimenterMessageOfChoice, T extends DataContainer> ConverterMessageToOFJava<F, T>
+ getMessageConverter(TypeVersionKey<F> key) {
return (ConverterMessageToOFJava<F, T>) registryMessageToOFJAva.get(key);
}
@Override
- public <F extends DataContainer, P extends AugmentationPath> ConvertorMessageFromOFJava<F, P> getMessageConverter(MessageTypeKey<?> key) {
+ public <F extends DataContainer, P extends AugmentationPath> ConvertorMessageFromOFJava<F, P>
+ getMessageConverter(MessageTypeKey<?> key) {
return (ConvertorMessageFromOFJava<F, P>) registryMessageFromOFJAva.get(key);
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcUpdateGroupUpdatedSetField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionListGrouping;
-public class ExtensionResolvers {
+public final class ExtensionResolvers {
+ private ExtensionResolvers() {
+ }
private static GroupingLooseResolver<GeneralExtensionListGrouping> matchExtensionResolver =
new GroupingLooseResolver<>(GeneralExtensionListGrouping.class)
.add(GeneralAugMatchNotifGroupDescStatsUpdatedSetField.class);
/**
- * @return the matchExtensionResolver (covers match rpcs and inventory augmentations)
+ * Returns the matchExtensionResolver (covers match rpcs and inventory augmentations).
*/
public static GroupingLooseResolver<GeneralExtensionListGrouping> getMatchExtensionResolver() {
return matchExtensionResolver;
}
-
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match;
import org.opendaylight.yangtools.yang.binding.Augmentable;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.slf4j.Logger;
throw new IllegalAccessError("singleton enforcement");
}
-
/**
+ * Injects an extension.
+ *
* @param matchEntry match entry
* @param ofVersion openflow version
* @param matchPath match path
}
/**
+ * Processes all extensions.
+ *
* @param matchEntries match entries
* @param ofVersion openflow version
* @param matchPath match path
- * @param <EXT_POINT> extension point
+ * @param <E> extension point
* @return augmentation wrapper containing augmentation depending on matchPath
*/
@SuppressWarnings("unchecked")
- public static <EXT_POINT extends Augmentable<EXT_POINT>>
- AugmentTuple<EXT_POINT> processAllExtensions(Collection<MatchEntry> matchEntries,
- OpenflowVersion ofVersion, MatchPath matchPath) {
+ public static <E extends Augmentable<E>> AugmentTuple<E> processAllExtensions(Collection<MatchEntry> matchEntries,
+ OpenflowVersion ofVersion, MatchPath matchPath) {
List<ExtensionList> extensionsList = new ArrayList<>();
for (MatchEntry matchEntry : matchEntries) {
extensionsList.add(extensionListBld.build());
}
- AugmentTuple<EXT_POINT> augmentTuple = null;
+ AugmentTuple<E> augmentTuple = null;
if (!extensionsList.isEmpty()) {
switch (matchPath) {
case FLOWS_STATISTICS_UPDATE_MATCH:
- GeneralAugMatchNotifUpdateFlowStatsBuilder generalExtMatchAugBld1 = new GeneralAugMatchNotifUpdateFlowStatsBuilder();
+ GeneralAugMatchNotifUpdateFlowStatsBuilder generalExtMatchAugBld1 =
+ new GeneralAugMatchNotifUpdateFlowStatsBuilder();
generalExtMatchAugBld1.setExtensionList(extensionsList);
- augmentTuple = (AugmentTuple<EXT_POINT>)
+ augmentTuple = (AugmentTuple<E>)
new AugmentTuple<>(
GeneralAugMatchNotifUpdateFlowStats.class, generalExtMatchAugBld1.build());
break;
case PACKET_RECEIVED_MATCH:
- GeneralAugMatchNotifPacketInBuilder generalExtMatchAugBld2 = new GeneralAugMatchNotifPacketInBuilder();
+ GeneralAugMatchNotifPacketInBuilder generalExtMatchAugBld2 =
+ new GeneralAugMatchNotifPacketInBuilder();
generalExtMatchAugBld2.setExtensionList(extensionsList);
- augmentTuple = (AugmentTuple<EXT_POINT>)
+ augmentTuple = (AugmentTuple<E>)
new AugmentTuple<>(GeneralAugMatchNotifPacketIn.class, generalExtMatchAugBld2.build());
break;
case PACKET_IN_MESSAGE_MATCH:
- GeneralAugMatchPacketInMessageBuilder generalExtMatchAugBld5 = new GeneralAugMatchPacketInMessageBuilder();
+ GeneralAugMatchPacketInMessageBuilder generalExtMatchAugBld5 =
+ new GeneralAugMatchPacketInMessageBuilder();
generalExtMatchAugBld5.setExtensionList(extensionsList);
- augmentTuple = (AugmentTuple<EXT_POINT>)
+ augmentTuple = (AugmentTuple<E>)
new AugmentTuple<>(GeneralAugMatchPacketInMessage.class, generalExtMatchAugBld5.build());
break;
case SWITCH_FLOW_REMOVED_MATCH:
- GeneralAugMatchNotifSwitchFlowRemovedBuilder generalExtMatchAugBld3 = new GeneralAugMatchNotifSwitchFlowRemovedBuilder();
+ GeneralAugMatchNotifSwitchFlowRemovedBuilder generalExtMatchAugBld3 =
+ new GeneralAugMatchNotifSwitchFlowRemovedBuilder();
generalExtMatchAugBld3.setExtensionList(extensionsList);
- augmentTuple = (AugmentTuple<EXT_POINT>)
+ augmentTuple = (AugmentTuple<E>)
new AugmentTuple<>(
GeneralAugMatchNotifSwitchFlowRemoved.class, generalExtMatchAugBld3.build());
break;
case FLOWS_STATISTICS_RPC_MATCH:
- GeneralAugMatchRpcOutputFlowStatsBuilder generalExtMatchAugBld4 = new GeneralAugMatchRpcOutputFlowStatsBuilder();
+ GeneralAugMatchRpcOutputFlowStatsBuilder generalExtMatchAugBld4 =
+ new GeneralAugMatchRpcOutputFlowStatsBuilder();
generalExtMatchAugBld4.setExtensionList(extensionsList);
- augmentTuple = (AugmentTuple<EXT_POINT>)
+ augmentTuple = (AugmentTuple<E>)
new AugmentTuple<>(
GeneralAugMatchRpcOutputFlowStats.class, generalExtMatchAugBld4.build());
break;
}
/**
- * @param ofVersion
- * @param matchPath
- * @param matchEntry
- * @return
+ * Processes an extension.
+ *
+ * @param ofVersion openflow version
+ * @param matchPath match path
+ * @param matchEntry match entry
+ * @return an ExtensionListBuilder
*/
private static ExtensionListBuilder processExtension(MatchEntry matchEntry, short ofVersion, MatchPath matchPath) {
ExtensionListBuilder extListBld = null;
- /** TODO: EXTENSION PROPOSAL (match, OFJava to MD-SAL) */
+ // TODO: EXTENSION PROPOSAL (match, OFJava to MD-SAL)
MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key = new MatchEntrySerializerKey<>(
ofVersion, matchEntry.getOxmClass(), matchEntry.getOxmMatchField());
if (null != OFSessionUtil.getExtensionConvertorProvider()) {
- ConvertorFromOFJava<MatchEntry, MatchPath> convertor = OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
+ ConvertorFromOFJava<MatchEntry, MatchPath> convertor =
+ OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
if (convertor != null) {
ExtensionAugment<? extends Augmentation<Extension>> extensionMatch =
convertor.convert(matchEntry, matchPath);
}
return extListBld;
}
-
}
import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
- * @param <KEY> converter key
- * @param <CONVERTER> converter instance
+ * Closes converter registrations.
+ *
+ * @param <K> converter key
+ * @param <C> converter instance
*/
-public abstract class RegistrationCloser<KEY, CONVERTER> implements ObjectRegistration<CONVERTER> {
+public abstract class RegistrationCloser<K, C> implements ObjectRegistration<C> {
private ExtensionConverterManagerImpl registrator;
- private KEY key;
- private CONVERTER converter;
+ private K key;
+ private C converter;
/**
+ * Sets the registrator.
+ *
* @param registrator the registrator to set
*/
public void setRegistrator(ExtensionConverterManagerImpl registrator) {
this.registrator = registrator;
}
+
/**
+ * Sets the key.
+ *
* @param key the key to set
*/
- public void setKey(KEY key) {
+ public void setKey(K key) {
this.key = key;
}
+
/**
+ * Sets the converter.
+ *
* @param converter the converter to set
*/
- public void setConverter(CONVERTER converter) {
+ public void setConverter(C converter) {
this.converter = converter;
}
+
/**
- * @return the registrator
+ * Returns the registrator.
*/
public ExtensionConverterManagerImpl getRegistrator() {
return registrator;
}
+
/**
- * @return the key
+ * Returns the key.
*/
- public KEY getKey() {
+ public K getKey() {
return key;
}
+
/**
- * @return the converter
+ * Returns the converter.
*/
- public CONVERTER getConverter() {
+ public C getConverter() {
return converter;
}
@Override
- public CONVERTER getInstance() {
+ public C getInstance() {
return getConverter();
}
/**
- * standalone deregistrator
- * @param <TO> target type of wrapped convertor
+ * Standalone deregistrator.
+ *
+ * @param <T> target type of wrapped convertor
*/
- public static class RegistrationCloserToOFJava<TO extends DataContainer> extends
- RegistrationCloser<ConverterExtensionKey<? extends ExtensionKey>, ConvertorToOFJava<TO>> {
+ public static class RegistrationCloserToOFJava<T extends DataContainer> extends
+ RegistrationCloser<ConverterExtensionKey<? extends ExtensionKey>, ConvertorToOFJava<T>> {
@Override
public void close() {
}
/**
- * standalone deregistrator
- * @param <FROM> source type of wrapped convertor
- * @param <PATH> associated augmentation path
+ * Standalone deregistrator.
+ *
+ * @param <F> source type of wrapped convertor
+ * @param <P> associated augmentation path
*/
- public static class RegistrationCloserFromOFJava<FROM extends DataContainer, PATH extends AugmentationPath> extends RegistrationCloser<MessageTypeKey<?>, ConvertorFromOFJava<FROM, PATH>> {
-
+ public static class RegistrationCloserFromOFJava<F extends DataContainer, P extends AugmentationPath>
+ extends RegistrationCloser<MessageTypeKey<?>, ConvertorFromOFJava<F, P>> {
@Override
public void close() {
getRegistrator().unregister(getKey(), getConverter());
}
/**
- * standalone deregistrator
- * @param <TO> target type of wrapped convertor
+ * Standalone deregistrator.
+ *
+ * @param <T> target type of wrapped convertor
*/
- public static class RegistrationCloserActionToOFJava<TO extends DataContainer> extends
- RegistrationCloser<TypeVersionKey<? extends Action>, ConvertorActionToOFJava<Action, TO>> {
+ public static class RegistrationCloserActionToOFJava<T extends DataContainer> extends
+ RegistrationCloser<TypeVersionKey<? extends Action>, ConvertorActionToOFJava<Action, T>> {
@Override
public void close() {
}
/**
- * standalone deregistrator
- * @param <FROM> source type of wrapped convertor
- * @param <PATH> associated augmentation path
+ * Standalone deregistrator.
+ *
+ * @param <F> source type of wrapped convertor
+ * @param <P> associated augmentation path
*/
- public static class RegistrationCloserActionFromOFJava<FROM extends DataContainer, PATH extends AugmentationPath> extends
- RegistrationCloser<MessageTypeKey<?>, ConvertorActionFromOFJava<FROM, PATH>> {
+ public static class RegistrationCloserActionFromOFJava<F extends DataContainer, P extends AugmentationPath> extends
+ RegistrationCloser<MessageTypeKey<?>, ConvertorActionFromOFJava<F, P>> {
@Override
public void close() {
}
/**
- * standalone deregistrator
+ * Standalone deregistrator.
*
- * @param <TO> target type of wrapped convertor
+ * @param <T> target type of wrapped convertor
*/
- public static class RegistrationCloserMessageToOFJava<TO extends DataContainer, K extends ExperimenterMessageOfChoice> extends
- RegistrationCloser<TypeVersionKey<K>, ConverterMessageToOFJava<K, TO>> {
+ public static class RegistrationCloserMessageToOFJava<T extends DataContainer,
+ K extends ExperimenterMessageOfChoice>
+ extends RegistrationCloser<TypeVersionKey<K>, ConverterMessageToOFJava<K, T>> {
@Override
public void close() {
}
/**
- * standalone deregistrator
+ * Standalone deregistrator.
*
- * @param <FROM> source type of wrapped convertor
- * @param <PATH> associated augmentation path
+ * @param <F> source type of wrapped convertor
+ * @param <P> associated augmentation path
*/
- public static class RegistrationCloserMessageFromOFJava<FROM extends DataContainer, PATH extends AugmentationPath> extends
- RegistrationCloser<MessageTypeKey<?>, ConvertorMessageFromOFJava<FROM, PATH>> {
+ public static class RegistrationCloserMessageFromOFJava<F extends DataContainer, P extends AugmentationPath> extends
+ RegistrationCloser<MessageTypeKey<?>, ConvertorMessageFromOFJava<F, P>> {
@Override
public void close() {
getRegistrator().unregister(getKey(), getConverter());
}
}
-
-
}
public interface ConvertorExecutor {
/**
- * Lookup and use convertor by specified type, then converts source and returns converted result
+ * Lookup and use convertor by specified type, then converts source and returns converted result.
*
- * @param <FROM> the source type
- * @param <TO> the result type
- * @param <DATA> the data type
+ * @param <F> the source type
+ * @param <T> the result type
+ * @param <D> the data type
* @param source the source
* @param data convertor data
* @return the result (can be empty, if no convertor was found)
*/
- <FROM, TO, DATA extends ConvertorData> Optional<TO> convert(final FROM source, final DATA data);
+ <F, T, D extends ConvertorData> Optional<T> convert(final F source, final D data);
/**
- * Lookup and use convertor by specified type, then converts source collection and returns converted result
+ * Lookup and use convertor by specified type, then converts source collection and returns converted result.
*
- * @param <FROM> the source type
- * @param <TO> the result type
- * @param <DATA> the data type
+ * @param <F> the source type
+ * @param <T> the result type
+ * @param <D> the data type
* @param source the source collection
* @param data convertor data
* @return the result (can be empty, if no convertor was found)
*/
- <FROM, TO, DATA extends ConvertorData> Optional<TO> convert(final Collection<FROM> source, final DATA data);
-}
\ No newline at end of file
+ <F, T, D extends ConvertorData> Optional<T> convert(final Collection<F> source, final D data);
+}
import org.slf4j.LoggerFactory;
/**
- * Manages various convertors and allows to use them all in one generic way
+ * Manages various convertors and allows to use them all in one generic way.
*/
public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator {
private static final Logger LOG = LoggerFactory.getLogger(ConvertorManager.class);
private Map<Short, Map<Class<?>, Convertor<?, ?, ? extends ConvertorData>>> convertors;
/**
- * Create new instance of Convertor Manager
+ * Create new instance of Convertor Manager.
+ *
* @param supportedVersions supported versions
*/
public ConvertorManager(final Short... supportedVersions) {
if (supportedVersions.length == 1) {
final Optional<Short> versionOptional = stream.findFirst();
- versionOptional.ifPresent(version -> convertors = Collections.singletonMap(version, new ConcurrentHashMap<>()));
+ versionOptional.ifPresent(version -> convertors =
+ Collections.singletonMap(version, new ConcurrentHashMap<>()));
} else {
convertors = new ConcurrentHashMap<>();
stream.forEach(version -> convertors.putIfAbsent(version, new ConcurrentHashMap<>()));
}
@Override
- public ConvertorManager registerConvertor(final short version, final Convertor<?, ?, ? extends ConvertorData> convertor) {
+ public ConvertorManager registerConvertor(final short version,
+ final Convertor<?, ?, ? extends ConvertorData> convertor) {
final Map<Class<?>, Convertor<?, ?, ? extends ConvertorData>> convertorsForVersion =
convertors.get(version);
@Override
@SuppressWarnings("unchecked")
- public <FROM, TO, DATA extends ConvertorData> Optional<TO> convert(final FROM source, final DATA data) {
- Optional<TO> result = Optional.empty();
+ public <F, T, D extends ConvertorData> Optional<T> convert(final F source, final D data) {
+ Optional<T> result = Optional.empty();
if (Objects.isNull(source)) {
LOG.trace("Cannot extract type from null source");
return result;
}
- final Class<?> type = source instanceof DataContainer ?
- ((DataContainer)source).getImplementedInterface()
+ final Class<?> type = source instanceof DataContainer ? ((DataContainer) source).getImplementedInterface()
: source.getClass();
if (Objects.isNull(type)) {
return result;
}
- return findConvertor(data.getVersion(), type)
- .map(convertor -> (TO)convertor.convert(source, data));
+ return findConvertor(data.getVersion(), type).map(convertor -> (T)convertor.convert(source, data));
}
@Override
@SuppressWarnings("unchecked")
- public <FROM, TO, DATA extends ConvertorData> Optional<TO> convert(final Collection<FROM> source, final DATA data) {
- Optional<TO> result = Optional.empty();
+ public <F, T, D extends ConvertorData> Optional<T> convert(final Collection<F> source, final D data) {
+ Optional<T> result = Optional.empty();
if (Objects.isNull(source)) {
LOG.trace("Cannot extract type from null source");
return result;
}
- final Optional<FROM> firstOptional = source.stream().findFirst();
+ final Optional<F> firstOptional = source.stream().findFirst();
if (!firstOptional.isPresent()) {
LOG.trace("Cannot extract type from empty collection");
return result;
}
- final FROM first = firstOptional.get();
+ final F first = firstOptional.get();
- final Class<?> type = first instanceof DataContainer ?
- ((DataContainer)first).getImplementedInterface()
+ final Class<?> type = first instanceof DataContainer ? ((DataContainer) first).getImplementedInterface()
: first.getClass();
if (Objects.isNull(type)) {
}
return findConvertor(data.getVersion(), type)
- .map(convertor -> (TO)convertor.convert(source, data));
+ .map(convertor -> (T)convertor.convert(source, data));
}
/**
if (!convertor.isPresent()) {
for (final Class<?> convertorType : convertorsForVersion.keySet()) {
if (type.isAssignableFrom(convertorType)) {
- final Convertor<?, ?, ? extends ConvertorData> foundConvertor = convertorsForVersion.get(convertorType);
+ final Convertor<?, ?, ? extends ConvertorData> foundConvertor =
+ convertorsForVersion.get(convertorType);
convertor = Optional.ofNullable(foundConvertor);
if (convertor.isPresent()) {
convertorsForVersion.put(type, foundConvertor);
- LOG.warn("{} for version {} is now converted by {} using last resort method", type, version, foundConvertor);
+ LOG.warn("{} for version {} is now converted by {} using last resort method",
+ type, version, foundConvertor);
break;
}
}
return convertor;
}
-}
\ No newline at end of file
+}
/**
* Convertor manager factory.
*/
-public class ConvertorManagerFactory {
+public final class ConvertorManagerFactory {
+ private ConvertorManagerFactory() {
+ }
+
/**
* Create default convertor manager.
*
final TableFeaturesResponseConvertor tableFeaturesResponseConvertor = new TableFeaturesResponseConvertor();
final MeterConvertor meterConvertor = new MeterConvertor();
final MeterStatsResponseConvertor meterStatsResponseConvertor = new MeterStatsResponseConvertor();
- final MeterConfigStatsResponseConvertor meterConfigStatsResponseConvertor = new MeterConfigStatsResponseConvertor();
+ final MeterConfigStatsResponseConvertor meterConfigStatsResponseConvertor =
+ new MeterConfigStatsResponseConvertor();
final PortConvertor portConvertor = new PortConvertor();
final MatchConvertor matchConvertor = new MatchConvertor();
final MatchV10Convertor matchV10Convertor = new MatchV10Convertor();
final GroupStatsResponseConvertor groupStatsResponseConvertor = new GroupStatsResponseConvertor();
final PacketOutConvertor packetOutConvertor = new PacketOutConvertor();
final FlowConvertor flowConvertor = new FlowConvertor();
- final FlowInstructionResponseConvertor flowInstructionResponseConvertor = new FlowInstructionResponseConvertor();
+ final FlowInstructionResponseConvertor flowInstructionResponseConvertor =
+ new FlowInstructionResponseConvertor();
final FlowStatsResponseConvertor flowStatsResponseConvertor = new FlowStatsResponseConvertor();
final FlowFlagsConvertor flowFlagsConvertor = new FlowFlagsConvertor();
final FlowFlagsV10Convertor flowFlagsV10Convertor = new FlowFlagsV10Convertor();
* Decodes the SAL - Group Mod Message and encodes into a OF
* Library for the OFPT_GROUP_MOD Message. Input:SAL Layer Group command data.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* </pre>
*/
public class GroupConvertor extends Convertor<Group, GroupModInputBuilder, VersionDatapathIdConvertorData> {
- private static final List<Class<?>> TYPES = Arrays.asList(Group.class, AddGroupInput.class, RemoveGroupInput.class, UpdatedGroup.class);
+ private static final List<Class<?>> TYPES = Arrays.asList(Group.class, AddGroupInput.class,
+ RemoveGroupInput.class, UpdatedGroup.class);
+
/**
* Create default empty group mod input builder
* Use this method, if result from convertor is empty.
private static final Long OFPG_ANY = Long.parseLong("ffffffff", 16);
private static final Long DEFAULT_WATCH_GROUP = OFPG_ANY;
private static final Comparator<Bucket> COMPARATOR = (bucket1, bucket2) -> {
- if (bucket1.getBucketId() == null || bucket2.getBucketId() == null) return 0;
+ if (bucket1.getBucketId() == null || bucket2.getBucketId() == null) {
+ return 0;
+ }
return bucket1.getBucketId().getValue().compareTo(bucket2.getBucketId().getValue());
};
final ActionConvertorData data = new ActionConvertorData(version);
data.setDatapathId(datapathid);
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket groupBucket : buckets
- .getBucket()) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket groupBucket :
+ buckets.getBucket()) {
BucketsListBuilder bucketBuilder = new BucketsListBuilder();
salToOFBucketListWeight(groupBucket, bucketBuilder, groupType);
}
- private static void salToOFBucketListWatchPort(Bucket groupBucket, BucketsListBuilder bucketBuilder, int groupType) {
+ private static void salToOFBucketListWatchPort(Bucket groupBucket, BucketsListBuilder bucketBuilder,
+ int groupType) {
if (null != groupBucket.getWatchPort()) {
bucketBuilder.setWatchPort(new PortNumber(groupBucket.getWatchPort()));
} else {
}
}
- private static void salToOFBucketListWatchGroup(Bucket groupBucket, BucketsListBuilder bucketBuilder, int groupType) {
+ private static void salToOFBucketListWatchGroup(Bucket groupBucket, BucketsListBuilder bucketBuilder,
+ int groupType) {
if (null != groupBucket.getWatchGroup()) {
bucketBuilder.setWatchGroup(groupBucket.getWatchGroup());
} else {
// Only if the bucket is configured for the group then add it
// During group deletion do not push the buckets
if (groupModInputBuilder.getCommand() != GroupModCommand.OFPGCDELETE) {
- if ((source.getBuckets() != null) && (source.getBuckets().getBucket().size() != 0)) {
+ if (source.getBuckets() != null && source.getBuckets().getBucket().size() != 0) {
Collections.sort(source.getBuckets().getBucket(), COMPARATOR);
- List<BucketsList> bucketLists = salToOFBucketList(source.getBuckets(), data.getVersion(), source.getGroupType().getIntValue(), data.getDatapathId());
+ List<BucketsList> bucketLists = salToOFBucketList(source.getBuckets(), data.getVersion(),
+ source.getGroupType().getIntValue(), data.getDatapathId());
groupModInputBuilder.setBucketsList(bucketLists);
}
}
groupModInputBuilder.setVersion(data.getVersion());
return groupModInputBuilder;
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDesc;
/**
- * Converts GroupDesc message from library to MD SAL defined GroupDescStats
+ * Converts GroupDesc message from library to MD SAL defined GroupDescStats.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* }
* </pre>
*/
-public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>, List<GroupDescStats>, VersionConvertorData> {
+public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>, List<GroupDescStats>,
+ VersionConvertorData> {
private static final Set<Class<?>> TYPES = Collections.singleton(GroupDesc.class);
- private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(List<BucketsList> bucketDescStats, short version) {
+ private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(
+ List<BucketsList> bucketDescStats, short version) {
final ActionResponseConvertorData data = new ActionResponseConvertorData(version);
data.setActionPath(ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
for (BucketsList bucketDetails : bucketDescStats) {
BucketBuilder bucketDesc = new BucketBuilder();
- final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>> convertedSalActions =
- getConvertorExecutor().convert(
- bucketDetails.getAction(), data);
-
+ final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>>
+ convertedSalActions = getConvertorExecutor().convert(bucketDetails.getAction(), data);
if (convertedSalActions.isPresent()) {
List<Action> actions = new ArrayList<>();
int actionKey = 0;
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action : convertedSalActions.get()) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action :
+ convertedSalActions.get()) {
ActionBuilder wrappedAction = new ActionBuilder();
wrappedAction.setAction(action);
wrappedAction.setKey(new ActionKey(actionKey));
/**
* Converts group related statistics messages coming from switch to MD-SAL messages.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* </pre>
*/
public class GroupStatsResponseConvertor extends Convertor<
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats>,
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart
+ .reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats>,
List<GroupStats>,
VersionConvertorData> {
- private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats.class);
+ private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight
+ .openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart
+ .reply.group.GroupStats.class);
private Buckets toSALBuckets(List<BucketStats> bucketStats) {
BucketsBuilder salBuckets = new BucketsBuilder();
}
@Override
- public List<GroupStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats> source, VersionConvertorData data) {
+ public List<GroupStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
+ .multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats> source,
+ VersionConvertorData data) {
List<GroupStats> convertedSALGroups = new ArrayList<>();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply
- .multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats groupStats : source) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply
+ .body.multipart.reply.group._case.multipart.reply.group.GroupStats groupStats : source) {
GroupStatsBuilder salGroupStats = new GroupStatsBuilder();
salGroupStats.setBuckets(toSALBuckets(groupStats.getBucketStats()));
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.meter.band.experimenter._case.MeterBandExperimenter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.MeterConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.config._case.multipart.reply.meter.config.meter.config.Bands;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Converts list of OF library config meter stats to MD-SAL config meter stats.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* }
* </pre>
*/
-public class MeterConfigStatsResponseConvertor extends Convertor<List<MeterConfig>, List<MeterConfigStats>, VersionConvertorData> {
+public class MeterConfigStatsResponseConvertor extends Convertor<List<MeterConfig>, List<MeterConfigStats>,
+ VersionConvertorData> {
private static final Set<Class<?>> TYPES = Collections.singleton(MeterConfig.class);
return listMeterConfigStats;
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.meter.band.experimenter._case.MeterBandExperimenterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.Bands;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.BandsBuilder;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Converts a MD-SAL meter mod command into the OF library meter mod command.
+ *
* <p>
* Example usage:
* <pre>
*/
public class MeterConvertor extends Convertor<Meter, MeterModInputBuilder, VersionConvertorData> {
private static final Logger LOG = LoggerFactory.getLogger(MeterConvertor.class);
- private static final List<Class<?>> TYPES = Arrays.asList(Meter.class, AddMeterInput.class, RemoveMeterInput.class, UpdatedMeter.class);
+ private static final List<Class<?>> TYPES = Arrays.asList(Meter.class, AddMeterInput.class,
+ RemoveMeterInput.class, UpdatedMeter.class);
/**
* Create default empty meter mot input builder.
private static void getBandsFromSAL(MeterBandHeaders meterBandHeaders, List<Bands> bands) {
for (MeterBandHeader meterBandHeader : meterBandHeaders.getMeterBandHeader()) {
// The band types :drop,DSCP_Remark or experimenter.
- if (null != meterBandHeader.getMeterBandTypes() &&
- null != meterBandHeader.getMeterBandTypes().getFlags()) {
-
+ if (null != meterBandHeader.getMeterBandTypes() && null != meterBandHeader.getMeterBandTypes().getFlags()) {
if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtDrop()) {
if (meterBandHeader.getBandType() != null) {
- MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
MeterBandDropBuilder meterBandDropBuilder = new MeterBandDropBuilder();
meterBandDropBuilder.setType(MeterBandType.OFPMBTDROP);
Drop drop = (Drop) meterBandHeader.getBandType();
meterBandDropBuilder.setBurstSize(drop.getDropBurstSize());
meterBandDropBuilder.setRate(drop.getDropRate());
+ MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
dropCaseBuilder.setMeterBandDrop(meterBandDropBuilder.build());
MeterBand meterBandItem = dropCaseBuilder.build();
BandsBuilder bandsB = new BandsBuilder();
}
} else if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtDscpRemark()) {
if (meterBandHeader.getBandType() != null) {
- MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
MeterBandDscpRemarkBuilder meterBandDscpRemarkBuilder = new MeterBandDscpRemarkBuilder();
meterBandDscpRemarkBuilder.setType(MeterBandType.OFPMBTDSCPREMARK);
DscpRemark dscpRemark = (DscpRemark) meterBandHeader.getBandType();
meterBandDscpRemarkBuilder.setBurstSize(dscpRemark.getDscpRemarkBurstSize());
meterBandDscpRemarkBuilder.setRate(dscpRemark.getDscpRemarkRate());
meterBandDscpRemarkBuilder.setPrecLevel(dscpRemark.getPrecLevel());
+ MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
dscpCaseBuilder.setMeterBandDscpRemark(meterBandDscpRemarkBuilder.build());
MeterBand meterBandItem = dscpCaseBuilder.build();
BandsBuilder bandsB = new BandsBuilder();
}
} else if (meterBandHeader.getMeterBandTypes().getFlags().isOfpmbtExperimenter()) {
if (meterBandHeader.getBandType() != null) {
- MeterBandExperimenterCaseBuilder experimenterCaseBuilder = new MeterBandExperimenterCaseBuilder();
MeterBandExperimenterBuilder meterBandExperimenterBuilder = new MeterBandExperimenterBuilder();
meterBandExperimenterBuilder.setType(MeterBandType.OFPMBTEXPERIMENTER);
Experimenter experimenter = (Experimenter) meterBandHeader.getBandType();
expBuilder.setExperimenter(new ExperimenterId(experimenter.getExperimenter()));
meterBandExperimenterBuilder.addAugmentation(ExperimenterIdMeterBand.class, expBuilder.build());
// TODO - implement / finish experimenter meter band translation
+ MeterBandExperimenterCaseBuilder experimenterCaseBuilder =
+ new MeterBandExperimenterCaseBuilder();
experimenterCaseBuilder.setMeterBandExperimenter(meterBandExperimenterBuilder.build());
MeterBand meterBandItem = experimenterCaseBuilder.build();
BandsBuilder bandsB = new BandsBuilder();
import java.util.Collections;
import java.util.List;
import java.util.Set;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.Convertor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.BandId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.DurationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.meter.stats.MeterBandStats;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Converts list of OF library meter stats to MD-SAL meter stats.
*
+ * <p>
* Example usage:
* <pre>
* {@code
List<MeterStats>,
VersionConvertorData> {
- private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats.class);
+ private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight
+ .openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart
+ .reply.meter.MeterStats.class);
@Override
public Collection<Class<?>> getTypes() {
}
@Override
- public List<MeterStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats> source, VersionConvertorData data) {
+ public List<MeterStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
+ .multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats> source,
+ VersionConvertorData data) {
List<MeterStats> convertedSALMeters = new ArrayList<>();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.
- multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats meterStats : source) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply
+ .body.multipart.reply.meter._case.multipart.reply.meter.MeterStats meterStats : source) {
// Convert MeterStats message from library to MD SAL defined MeterStats
MeterStatsBuilder salMeterStats = new MeterStatsBuilder();
salMeterStats.setByteInCount(new Counter64(meterStats.getByteInCount()));
return convertedSALMeters;
}
-}
\ No newline at end of file
+}
/**
* Created by Anil Vishnoi (avishnoi@Brocade.com) on 8/2/16.
*/
-public class OFApprovedExperimenterIds {
+public interface OFApprovedExperimenterIds {
- public static final long MATCH_TCP_FLAGS_EXP_ID = 1330529792;
+ long MATCH_TCP_FLAGS_EXP_ID = 1330529792;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
import org.slf4j.Logger;
/**
* Converts a MD-SAL packet out data into the OF library packet out input.
*
+ * <p>
* Example usage:
* <pre>
* {@code
PortNumber inPortNr;
Long bufferId = OFConstants.OFP_NO_BUFFER;
Iterable<PathArgument> inArgs = null;
- PacketOutInputBuilder builder = new PacketOutInputBuilder();
if (source.getIngress() != null) {
inArgs = source.getIngress().getValue().getPathArguments();
}
List<Action> actions = new ArrayList<>();
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> inputActions = source.getAction();
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> inputActions =
+ source.getAction();
if (inputActions != null) {
final ActionConvertorData actionConvertorData = new ActionConvertorData(data.getVersion());
} else {
// TODO VD P! wait for way to move Actions (e.g. augmentation)
- ActionBuilder aBuild = new ActionBuilder();
OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
outputActionBuilder.setPort(outPort);
outputActionBuilder.setMaxLength(OFConstants.OFPCML_NO_BUFFER);
outputActionCaseBuilder.setOutputAction(outputActionBuilder.build());
- aBuild.setActionChoice(outputActionCaseBuilder.build());
- actions.add(aBuild.build());
+ ActionBuilder actionBuild = new ActionBuilder();
+ actionBuild.setActionChoice(outputActionCaseBuilder.build());
+ actions.add(actionBuild.build());
}
+ PacketOutInputBuilder builder = new PacketOutInputBuilder();
builder.setAction(actions);
builder.setData(source.getPayload());
builder.setVersion(data.getVersion());
return builder.build();
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.port.desc._case.multipart.reply.port.desc.PortsBuilder;
/**
- * Converts port mod, port status and port description MD-SAL messages to OF library data
+ * Converts port mod, port status and port description MD-SAL messages to OF library data.
*
+ * <p>
* Example usage:
* <pre>
* {@code
private static PortFeaturesV10 getPortFeaturesV10(
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures salPortFeatures) {
- return new PortFeaturesV10(salPortFeatures.isHundredMbFd(), salPortFeatures.isHundredMbHd(), salPortFeatures.isTenGbFd(), salPortFeatures.isTenMbFd(), salPortFeatures.isTenMbHd(),
- salPortFeatures.isOneGbFd(), salPortFeatures.isOneGbHd(), salPortFeatures.isAutoeng(), salPortFeatures.isCopper(), salPortFeatures.isFiber(),
- salPortFeatures.isPause(), salPortFeatures.isPauseAsym());
+ return new PortFeaturesV10(salPortFeatures.isHundredMbFd(), salPortFeatures.isHundredMbHd(),
+ salPortFeatures.isTenGbFd(), salPortFeatures.isTenMbFd(), salPortFeatures.isTenMbHd(),
+ salPortFeatures.isOneGbFd(), salPortFeatures.isOneGbHd(), salPortFeatures.isAutoeng(),
+ salPortFeatures.isCopper(), salPortFeatures.isFiber(), salPortFeatures.isPause(),
+ salPortFeatures.isPauseAsym());
}
/**
- * This method is called as a reply to OFPMP_PORT_DESCRIPTION
- * message(OF1.3.1)
+ * This method is called as a reply to OFPMP_PORT_DESCRIPTION message(OF1.3.1).
*
* @param source FlowCapablePort
* @param version openflow version
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.FlowCapablePort source,
short version) {
- PortsBuilder oFPortDescDataBuilder = new PortsBuilder();
+ PortsBuilder ofPortDescDataBuilder = new PortsBuilder();
- oFPortDescDataBuilder.setPortNo(
- OpenflowPortsUtil.getProtocolPortNumber(OpenflowVersion.get(version), source.getPortNumber())); // portNO
+ ofPortDescDataBuilder.setPortNo(OpenflowPortsUtil.getProtocolPortNumber(OpenflowVersion.get(version),
+ source.getPortNumber())); // portNO
- oFPortDescDataBuilder.setHwAddr(source.getHardwareAddress());
- oFPortDescDataBuilder.setName(source.getName());
+ ofPortDescDataBuilder.setHwAddr(source.getHardwareAddress());
+ ofPortDescDataBuilder.setName(source.getName());
PortConfig config = maskPortConfigFields(source.getConfiguration());
- oFPortDescDataBuilder.setConfig(config);
+ ofPortDescDataBuilder.setConfig(config);
PortState portState = getPortState(source.getState());
- oFPortDescDataBuilder.setState(portState);
- oFPortDescDataBuilder.setCurrentFeatures(getPortFeatures(source.getCurrentFeature()));
- oFPortDescDataBuilder.setAdvertisedFeatures(getPortFeatures(source.getAdvertisedFeatures()));
- oFPortDescDataBuilder.setSupportedFeatures(getPortFeatures(source.getSupported()));
- oFPortDescDataBuilder.setPeerFeatures(getPortFeatures(source.getPeerFeatures()));
- oFPortDescDataBuilder.setCurrSpeed(source.getCurrentSpeed());
- oFPortDescDataBuilder.setMaxSpeed(source.getMaximumSpeed());
+ ofPortDescDataBuilder.setState(portState);
+ ofPortDescDataBuilder.setCurrentFeatures(getPortFeatures(source.getCurrentFeature()));
+ ofPortDescDataBuilder.setAdvertisedFeatures(getPortFeatures(source.getAdvertisedFeatures()));
+ ofPortDescDataBuilder.setSupportedFeatures(getPortFeatures(source.getSupported()));
+ ofPortDescDataBuilder.setPeerFeatures(getPortFeatures(source.getPeerFeatures()));
+ ofPortDescDataBuilder.setCurrSpeed(source.getCurrentSpeed());
+ ofPortDescDataBuilder.setMaxSpeed(source.getMaximumSpeed());
- return oFPortDescDataBuilder.build();
+ return ofPortDescDataBuilder.build();
}
PortModInputBuilder portModInputBuilder = new PortModInputBuilder();
portModInputBuilder.setAdvertise(getPortFeatures(source.getAdvertisedFeatures()));
- portModInputBuilder.setPortNo(new PortNumber(
- OpenflowPortsUtil.getProtocolPortNumber(OpenflowVersion.get(data.getVersion()), source.getPortNumber())));
+ portModInputBuilder.setPortNo(new PortNumber(OpenflowPortsUtil.getProtocolPortNumber(
+ OpenflowVersion.get(data.getVersion()), source.getPortNumber())));
portModInputBuilder.setConfig(config);
portModInputBuilder.setMask(MoreObjects.firstNonNull(maskPortConfigFields(source.getMask()),
portModInputBuilder.setAdvertiseV10(getPortFeaturesV10(source.getAdvertisedFeatures()));
return portModInputBuilder.build();
}
-}
\ No newline at end of file
+}
/**
* Converts a MD-SAL table features into the OF library table features.
*
+ * <p>
* Example usage:
* <pre>
* {@code
VersionConvertorData> {
private static final Logger LOG = LoggerFactory.getLogger(TableFeaturesConvertor.class);
- private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> TABLE_FEATURE_PROPS_ORDERING =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties>build());
- private static final Map<Class<?>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField>> SAL_TO_OF_TABLE_FEATURES;
- private static final List<Class<?>> TYPES = Arrays.asList(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures.class, UpdatedTable.class);
+ private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features
+ .table.features.table.properties.TableFeatureProperties> TABLE_FEATURE_PROPS_ORDERING =
+ Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
+ .features.table.features.table.properties.TableFeatureProperties>build());
+ private static final Map<Class<?>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm
+ .rev150225.MatchField>> SAL_TO_OF_TABLE_FEATURES;
+ private static final List<Class<?>> TYPES = Arrays.asList(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.TableFeatures.class, UpdatedTable.class);
static {
- Builder<Class<?>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField>> builder = ImmutableMap.builder();
+ Builder<Class<?>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm
+ .rev150225.MatchField>> builder = ImmutableMap.builder();
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp.class, ArpOp.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha.class, ArpSha.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSpa.class, ArpSpa.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst.class, EthDst.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc.class, EthSrc.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType.class, EthType.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code.class, Icmpv4Code.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type.class, Icmpv4Type.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code.class, Icmpv6Code.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type.class, Icmpv6Type.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.class, InPhyPort.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code.class,
+ Icmpv4Code.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type.class,
+ Icmpv4Type.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code.class,
+ Icmpv6Code.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type.class,
+ Icmpv6Type.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.class,
+ InPhyPort.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort.class, InPort.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp.class, IpDscp.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn.class, IpEcn.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst.class, Ipv4Dst.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src.class, Ipv4Src.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst.class, Ipv6Dst.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.class, Ipv6Exthdr.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel.class, Ipv6Flabel.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll.class, Ipv6NdSll.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget.class, Ipv6NdTarget.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll.class, Ipv6NdTll.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.class,
+ Ipv6Exthdr.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel.class,
+ Ipv6Flabel.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll.class,
+ Ipv6NdSll.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget.class,
+ Ipv6NdTarget.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll.class,
+ Ipv6NdTll.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src.class, Ipv6Src.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata.class, Metadata.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos.class, MplsBos.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel.class, MplsLabel.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel.class,
+ MplsLabel.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc.class, MplsTc.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid.class, PbbIsid.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst.class, SctpDst.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc.class, UdpSrc.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp.class, VlanPcp.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid.class, VlanVid.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst.class, Ipv4Dst.class);
- builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src.class, Ipv4Src.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst.class,
+ Ipv4Dst.class);
+ builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src.class,
+ Ipv4Src.class);
builder.put(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpFlags.class, TcpFlags.class);
SAL_TO_OF_TABLE_FEATURES = builder.build();
}
private static List<TableFeatureProperties> toTableProperties(
- final org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TableProperties tableProperties) {
+ final org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features
+ .TableProperties tableProperties) {
if (tableProperties == null) {
return Collections.emptyList();
}
List<TableFeatureProperties> ofTablePropertiesList = new ArrayList<>();
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties>
- sortedTableProperties = TABLE_FEATURE_PROPS_ORDERING.sortedCopy(tableProperties.getTableFeatureProperties());
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table
+ .properties.TableFeatureProperties> sortedTableProperties = TABLE_FEATURE_PROPS_ORDERING.sortedCopy(
+ tableProperties.getTableFeatureProperties());
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties
- property : sortedTableProperties) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table
+ .properties.TableFeatureProperties property : sortedTableProperties) {
TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType propType = property
- .getTableFeaturePropType();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+ .TableFeaturePropType propType = property.getTableFeaturePropType();
setTableFeatureProperty(propType);
LOG.debug("Unknown TableFeaturePropType [{}]", propType.getClass());
}
- private static void setTableFeatureProperty(final ApplySetfieldMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMiss applySetfieldMiss = propType.getApplySetfieldMiss();
+ private static void setTableFeatureProperty(final ApplySetfieldMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.miss.ApplySetfieldMiss applySetfieldMiss = propType.getApplySetfieldMiss();
if (null != applySetfieldMiss) {
setFieldMatch = applySetfieldMiss.getSetFieldMatch();
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
- private static void setTableFeatureProperty(final ApplySetfield propType, final TableFeaturePropertiesBuilder propBuilder) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfield applySetfield = propType.getApplySetfield();
+ private static void setTableFeatureProperty(final ApplySetfield propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.ApplySetfield applySetfield = propType.getApplySetfield();
if (null != applySetfield) {
setFieldMatch = applySetfield.getSetFieldMatch();
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTAPPLYSETFIELD,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
- private static void setTableFeatureProperty(final WriteSetfieldMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMiss writeSetfieldMiss = propType.getWriteSetfieldMiss();
+ private static void setTableFeatureProperty(final WriteSetfieldMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.miss.WriteSetfieldMiss writeSetfieldMiss = propType.getWriteSetfieldMiss();
if (null != writeSetfieldMiss) {
setFieldMatch = writeSetfieldMiss.getSetFieldMatch();
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
- private static void setTableFeatureProperty(final WriteSetfield propType, final TableFeaturePropertiesBuilder propBuilder) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfield writeSetField = propType.getWriteSetfield();
+ private static void setTableFeatureProperty(final WriteSetfield propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.WriteSetfield writeSetField = propType.getWriteSetfield();
if (null != writeSetField) {
setFieldMatch = writeSetField.getSetFieldMatch();
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTWRITESETFIELD,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
- private static void setTableFeatureProperty(final Wildcards propType, final TableFeaturePropertiesBuilder propBuilder) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
+ private static void setTableFeatureProperty(final Wildcards propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
WildcardSetfield wildcardSetField = propType.getWildcardSetfield();
if (null != wildcardSetField) {
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTWILDCARDS,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
private static void setTableFeatureProperty(final Match propType, final TableFeaturePropertiesBuilder propBuilder) {
MatchSetfield matchSetField = propType.getMatchSetfield();
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch>
+ setFieldMatch = null;
if (null != matchSetField) {
setFieldMatch = matchSetField.getSetFieldMatch();
setSetFieldTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTMATCH,
- ((setFieldMatch == null) ? new ArrayList<>()
- : setFieldMatch));
+ setFieldMatch == null ? new ArrayList<>()
+ : setFieldMatch);
}
- private static void setTableFeatureProperty(final ApplyActionsMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMiss applyActionsMiss = propType
- .getApplyActionsMiss();
+ private static void setTableFeatureProperty(final ApplyActionsMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.actions.miss.ApplyActionsMiss applyActionsMiss = propType.getApplyActionsMiss();
setActionTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS,
- ((applyActionsMiss == null) ? new ArrayList<>()
- : applyActionsMiss.getAction()));
+ applyActionsMiss == null ? new ArrayList<>()
+ : applyActionsMiss.getAction());
}
- private static void setTableFeatureProperty(final ApplyActions propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.ApplyActions applyActions = propType.getApplyActions();
+ private static void setTableFeatureProperty(final ApplyActions propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.actions.ApplyActions applyActions = propType.getApplyActions();
setActionTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTAPPLYACTIONS,
- ((applyActions == null) ? new ArrayList<>()
- : applyActions.getAction()));
+ applyActions == null ? new ArrayList<>()
+ : applyActions.getAction());
}
- private static void setTableFeatureProperty(final WriteActionsMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMiss writeActionsMiss = propType.getWriteActionsMiss();
+ private static void setTableFeatureProperty(final WriteActionsMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.actions.miss.WriteActionsMiss writeActionsMiss = propType.getWriteActionsMiss();
setActionTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS,
- ((writeActionsMiss == null) ? new ArrayList<>()
- : writeActionsMiss.getAction()));
+ writeActionsMiss == null ? new ArrayList<>()
+ : writeActionsMiss.getAction());
}
- private static void setTableFeatureProperty(final WriteActions propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActions writeActions = propType.getWriteActions();
+ private static void setTableFeatureProperty(final WriteActions propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.actions.WriteActions writeActions = propType.getWriteActions();
setActionTableFeatureProperty(
propBuilder,
TableFeaturesPropType.OFPTFPTWRITEACTIONS,
- ((writeActions == null) ? new ArrayList<>()
- : writeActions.getAction()));
+ writeActions == null ? new ArrayList<>()
+ : writeActions.getAction());
}
- private static void setTableFeatureProperty(final NextTableMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- TablesMiss tables = propType
- .getTablesMiss();
+ private static void setTableFeatureProperty(final NextTableMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ TablesMiss tables = propType.getTablesMiss();
setNextTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTNEXTTABLESMISS,
- (tables == null) ? new ArrayList<>() : tables.getTableIds());
+ tables == null ? new ArrayList<>() : tables.getTableIds());
}
- private static void setTableFeatureProperty(final NextTable propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.Tables tables = propType
- .getTables();
+ private static void setTableFeatureProperty(final NextTable propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.next.table.Tables tables = propType.getTables();
setNextTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTNEXTTABLES,
- (tables == null) ? new ArrayList<>() : tables.getTableIds());
+ tables == null ? new ArrayList<>() : tables.getTableIds());
}
- private static void setTableFeatureProperty(final InstructionsMiss propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMiss instructions = propType
- .getInstructionsMiss();
+ private static void setTableFeatureProperty(final InstructionsMiss propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.instructions.miss.InstructionsMiss instructions = propType.getInstructionsMiss();
setInstructionTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS,
- (instructions == null) ? new ArrayList<>() : instructions.getInstruction());
+ instructions == null ? new ArrayList<>() : instructions.getInstruction());
}
- private static void setTableFeatureProperty(final Instructions propType, final TableFeaturePropertiesBuilder propBuilder) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.Instructions instructions = propType
- .getInstructions();
+ private static void setTableFeatureProperty(final Instructions propType,
+ final TableFeaturePropertiesBuilder propBuilder) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.instructions.Instructions instructions = propType.getInstructions();
setInstructionTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTINSTRUCTIONS,
- (instructions == null) ? new ArrayList<>() : instructions.getInstruction());
+ instructions == null ? new ArrayList<>() : instructions.getInstruction());
}
private static void setInstructionTableFeatureProperty(final TableFeaturePropertiesBuilder builder,
- final TableFeaturesPropType type, final List<Instruction> instructionList) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction> instructionTypeList = new ArrayList<>();
+ final TableFeaturesPropType type, final List<Instruction> instructionList) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping
+ .Instruction> instructionTypeList = new ArrayList<>();
for (Instruction currInstruction : instructionList) {
InstructionBuilder instructionType = new InstructionBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction instruction = currInstruction
- .getInstruction();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction instruction =
+ currInstruction.getInstruction();
if (instruction instanceof GoToTableCase) {
GotoTableCaseBuilder goToTableCaseBuilder = new GotoTableCaseBuilder();
builder.addAugmentation(InstructionRelatedTableFeatureProperty.class, propBuilder.build());
}
- private static void setNextTableFeatureProperty(final TableFeaturePropertiesBuilder builder, final TableFeaturesPropType type,
- final List<Short> tableIds) {
+ private static void setNextTableFeatureProperty(final TableFeaturePropertiesBuilder builder,
+ final TableFeaturesPropType type, final List<Short> tableIds) {
List<NextTableIds> nextTableIdsList = new ArrayList<>();
for (Short tableId : tableIds) {
}
private static void setActionTableFeatureProperty(final TableFeaturePropertiesBuilder builder,
- final TableFeaturesPropType type,
- final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> salActions) {
+ final TableFeaturesPropType type,
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>
+ salActions) {
List<Action> actionList = new ArrayList<>();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action currAction : salActions) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action currAction :
+ salActions) {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionType = currAction
.getAction();
ActionBuilder actionBuilder = new ActionBuilder();
private static void setSetFieldTableFeatureProperty(
final TableFeaturePropertiesBuilder builder,
final TableFeaturesPropType type,
- final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFields) {
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match
+ .SetFieldMatch> setFields) {
List<MatchEntry> matchEntriesList = new ArrayList<>();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch currMatch : setFields) {
- Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField> currMatchType = currMatch
- .getMatchType();
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch
+ currMatch : setFields) {
+ Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField>
+ currMatchType = currMatch.getMatchType();
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField> ofTableFeatureClass
- = SAL_TO_OF_TABLE_FEATURES.get(currMatchType);
+ Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField>
+ ofTableFeatureClass = SAL_TO_OF_TABLE_FEATURES.get(currMatchType);
setMatchEntry(matchEntryBuilder, ofTableFeatureClass, currMatch.isHasMask());
matchEntriesList.add(matchEntryBuilder.build());
}
}
private static void setMatchEntry(final MatchEntryBuilder builder,
- final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField> field,
- final Boolean hasMask) {
- if(field == TcpFlags.class) {
+ Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField> field,
+ final Boolean hasMask) {
+ if (field == TcpFlags.class) {
builder.setOxmClass(ExperimenterClass.class);
} else {
builder.setOxmClass(OpenflowBasicClass.class);
}
@Override
- public List<TableFeatures> convert(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures source, VersionConvertorData data) {
+ public List<TableFeatures> convert(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures source,
+ VersionConvertorData data) {
List<TableFeatures> ofTableFeaturesList = new ArrayList<>();
TableFeaturesBuilder ofTableFeatures = new TableFeaturesBuilder();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures salTableFeatures : source
- .getTableFeatures()) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures
+ salTableFeatures : source.getTableFeatures()) {
ofTableFeatures.setTableId(salTableFeatures.getTableId());
ofTableFeatures.setName(salTableFeatures.getName());
ofTableFeatures.setMetadataMatch(salTableFeatures.getMetadataMatch());
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TableProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TablePropertiesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Converts a OF library table features into the MD-SAL library table features.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* }
* </pre>
*/
-public class TableFeaturesResponseConvertor extends Convertor<MultipartReplyTableFeatures, List<TableFeatures>, VersionConvertorData> {
+public class TableFeaturesResponseConvertor
+ extends Convertor<MultipartReplyTableFeatures, List<TableFeatures>, VersionConvertorData> {
private static final Logger LOG = LoggerFactory.getLogger(TableFeaturesResponseConvertor.class);
private static final Map<TableFeaturesPropType, ActionExecutor> TABLE_FEATURE_PROPERTY_TYPE_TO_ACTION;
- private static final Map<Class<?>, org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> OF_TO_SAL_ACTION;
- private static final Map<Class<? extends MatchField>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField>> OF_TO_SAL_TABLE_FEATURE_PROPERTIES;
+ private static final Map<Class<?>,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> OF_TO_SAL_ACTION;
+ private static final Map<Class<? extends MatchField>, Class<? extends org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.MatchField>> OF_TO_SAL_TABLE_FEATURE_PROPERTIES;
private static final Set<Class<?>> TYPES = Collections.singleton(MultipartReplyTableFeatures.class);
static {
final Builder<TableFeaturesPropType, ActionExecutor> builder = ImmutableMap.builder();
builder.put(TableFeaturesPropType.OFPTFPTINSTRUCTIONS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder instructionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder();
- instructionBuilder
- .setInstructions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder()
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.InstructionsBuilder instructionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+ .table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder();
+ instructionBuilder.setInstructions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026
+ .table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder()
.setInstruction(setInstructionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(instructionBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder instructionMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder();
- instructionMissBuilder
- .setInstructionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder()
- .setInstruction(setInstructionTableFeatureProperty(property)).build());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.InstructionsMissBuilder instructionMissBuilder = new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type
+ .InstructionsMissBuilder();
+ instructionMissBuilder.setInstructionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder()
+ .setInstruction(setInstructionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(instructionMissBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTNEXTTABLES, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder nextTableBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder();
- nextTableBuilder
- .setTables(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.TablesBuilder()
- .setTableIds(setNextTableFeatureProperty(property)).build());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.NextTableBuilder nextTableBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table
+ .types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder();
+ nextTableBuilder.setTables(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
+ .feature.prop.type.table.feature.prop.type.next.table.TablesBuilder()
+ .setTableIds(setNextTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(nextTableBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder nextTableMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.NextTableMissBuilder nextTableMissBuilder = new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type
+ .NextTableMissBuilder();
nextTableMissBuilder
.setTablesMiss(new TablesMissBuilder()
.setTableIds(setNextTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(nextTableMissBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTWRITEACTIONS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder writeActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder();
- writeActionsBuilder
- .setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder()
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.WriteActionsBuilder writeActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+ .table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder();
+ writeActionsBuilder.setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder()
.setAction(setActionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(writeActionsBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder writeActionsMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder();
- writeActionsMissBuilder
- .setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder()
- .setAction(setActionTableFeatureProperty(property)).build());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.WriteActionsMissBuilder writeActionsMissBuilder = new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type
+ .WriteActionsMissBuilder();
+ writeActionsMissBuilder.setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder()
+ .setAction(setActionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(writeActionsMissBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTAPPLYACTIONS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder applyActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder();
- applyActionsBuilder
- .setApplyActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.ApplyActionsBuilder()
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.ApplyActionsBuilder applyActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+ .table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder();
+ applyActionsBuilder.setApplyActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026
+ .table.feature.prop.type.table.feature.prop.type.apply.actions.ApplyActionsBuilder()
.setAction(setActionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(applyActionsBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS, (property, propBuilder) -> {
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder applyActionsMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder();
- applyActionsMissBuilder
- .setApplyActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMissBuilder()
- .setAction(setActionTableFeatureProperty(property)).build());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature
+ .prop.type.ApplyActionsMissBuilder applyActionsMissBuilder = new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type
+ .ApplyActionsMissBuilder();
+ applyActionsMissBuilder.setApplyActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMissBuilder()
+ .setAction(setActionTableFeatureProperty(property)).build());
propBuilder.setTableFeaturePropType(applyActionsMissBuilder.build());
});
builder.put(TableFeaturesPropType.OFPTFPTMATCH, (property, propBuilder) -> {
builder.put(TableFeaturesPropType.OFPTFPTWILDCARDS, (property, propBuilder) -> {
WildcardSetfieldBuilder wildcardsBuilder = new WildcardSetfieldBuilder();
wildcardsBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new WildcardsBuilder().setWildcardSetfield(wildcardsBuilder.build()).build());
+ propBuilder.setTableFeaturePropType(new WildcardsBuilder()
+ .setWildcardSetfield(wildcardsBuilder.build()).build());
});
builder.put(TableFeaturesPropType.OFPTFPTWRITESETFIELD, (property, propBuilder) -> {
WriteSetfieldBuilder writeSetfieldBuilder = new WriteSetfieldBuilder();
writeSetfieldBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder().setWriteSetfield(writeSetfieldBuilder.build()).build());
+ propBuilder.setTableFeaturePropType(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder()
+ .setWriteSetfield(writeSetfieldBuilder.build()).build());
});
builder.put(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS, (property, propBuilder) -> {
WriteSetfieldMissBuilder writeSetfieldMissBuilder = new WriteSetfieldMissBuilder();
writeSetfieldMissBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder().setWriteSetfieldMiss(writeSetfieldMissBuilder.build()).build());
+ propBuilder.setTableFeaturePropType(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder()
+ .setWriteSetfieldMiss(writeSetfieldMissBuilder.build()).build());
});
builder.put(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD, (property, propBuilder) -> {
ApplySetfieldBuilder applySetfieldBuilder = new ApplySetfieldBuilder();
applySetfieldBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder().setApplySetfield(applySetfieldBuilder.build()).build());
+ propBuilder.setTableFeaturePropType(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder()
+ .setApplySetfield(applySetfieldBuilder.build()).build());
});
builder.put(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS, (property, propBuilder) -> {
ApplySetfieldMissBuilder applySetfieldMissBuilder = new ApplySetfieldMissBuilder();
applySetfieldMissBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder().setApplySetfieldMiss(applySetfieldMissBuilder.build()).build());
+ propBuilder.setTableFeaturePropType(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types
+ .rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder()
+ .setApplySetfieldMiss(applySetfieldMissBuilder.build()).build());
});
- builder.put(TableFeaturesPropType.OFPTFPTEXPERIMENTER, (property, propBuilder) -> LOG.debug("Experimenter Table features is unhandled"));
+ builder.put(TableFeaturesPropType.OFPTFPTEXPERIMENTER, (property, propBuilder) ->
+ LOG.debug("Experimenter Table features is unhandled"));
- builder.put(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS, (property, propBuilder) -> LOG.debug("Experimenter miss Table features is unhandled"));
+ builder.put(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS, (property, propBuilder) ->
+ LOG.debug("Experimenter miss Table features is unhandled"));
TABLE_FEATURE_PROPERTY_TYPE_TO_ACTION = builder.build();
-
}
static {
- Builder<Class<?>, org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> builder = ImmutableMap.builder();
-
- builder.put(OutputActionCase.class, new OutputActionCaseBuilder().setOutputAction(new OutputActionBuilder().build()).build());
- builder.put(GroupCase.class, new GroupActionCaseBuilder().setGroupAction(new GroupActionBuilder().build()).build());
- builder.put(CopyTtlOutCase.class, new CopyTtlOutCaseBuilder().setCopyTtlOut(new CopyTtlOutBuilder().build()).build());
- builder.put(CopyTtlInCase.class, new CopyTtlInCaseBuilder().setCopyTtlIn(new CopyTtlInBuilder().build()).build());
- builder.put(SetMplsTtlCase.class, new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(new SetMplsTtlActionBuilder().build()).build());
- builder.put(DecMplsTtlCase.class, new DecMplsTtlCaseBuilder().setDecMplsTtl(new DecMplsTtlBuilder().build()).build());
- builder.put(PushVlanCase.class, new PushVlanActionCaseBuilder().setPushVlanAction(new PushVlanActionBuilder().build()).build());
- builder.put(PopVlanCase.class, new PopVlanActionCaseBuilder().setPopVlanAction(new PopVlanActionBuilder().build()).build());
- builder.put(PushMplsCase.class, new PushMplsActionCaseBuilder().setPushMplsAction(new PushMplsActionBuilder().build()).build());
- builder.put(PopMplsCase.class, new PopMplsActionCaseBuilder().setPopMplsAction(new PopMplsActionBuilder().build()).build());
- builder.put(SetQueueCase.class, new SetQueueActionCaseBuilder().setSetQueueAction(new SetQueueActionBuilder().build()).build());
- builder.put(SetNwTtlCase.class, new SetNwTtlActionCaseBuilder().setSetNwTtlAction(new SetNwTtlActionBuilder().build()).build());
+ Builder<Class<?>, org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> builder =
+ ImmutableMap.builder();
+
+ builder.put(OutputActionCase.class,
+ new OutputActionCaseBuilder().setOutputAction(new OutputActionBuilder().build()).build());
+ builder.put(GroupCase.class,
+ new GroupActionCaseBuilder().setGroupAction(new GroupActionBuilder().build()).build());
+ builder.put(CopyTtlOutCase.class,
+ new CopyTtlOutCaseBuilder().setCopyTtlOut(new CopyTtlOutBuilder().build()).build());
+ builder.put(CopyTtlInCase.class,
+ new CopyTtlInCaseBuilder().setCopyTtlIn(new CopyTtlInBuilder().build()).build());
+ builder.put(SetMplsTtlCase.class,
+ new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(new SetMplsTtlActionBuilder().build()).build());
+ builder.put(DecMplsTtlCase.class,
+ new DecMplsTtlCaseBuilder().setDecMplsTtl(new DecMplsTtlBuilder().build()).build());
+ builder.put(PushVlanCase.class,
+ new PushVlanActionCaseBuilder().setPushVlanAction(new PushVlanActionBuilder().build()).build());
+ builder.put(PopVlanCase.class,
+ new PopVlanActionCaseBuilder().setPopVlanAction(new PopVlanActionBuilder().build()).build());
+ builder.put(PushMplsCase.class,
+ new PushMplsActionCaseBuilder().setPushMplsAction(new PushMplsActionBuilder().build()).build());
+ builder.put(PopMplsCase.class,
+ new PopMplsActionCaseBuilder().setPopMplsAction(new PopMplsActionBuilder().build()).build());
+ builder.put(SetQueueCase.class,
+ new SetQueueActionCaseBuilder().setSetQueueAction(new SetQueueActionBuilder().build()).build());
+ builder.put(SetNwTtlCase.class,
+ new SetNwTtlActionCaseBuilder().setSetNwTtlAction(new SetNwTtlActionBuilder().build()).build());
builder.put(DecNwTtlCase.class, new DecNwTtlCaseBuilder().setDecNwTtl(new DecNwTtlBuilder().build()).build());
builder.put(SetFieldCase.class, new SetFieldCaseBuilder().setSetField(new SetFieldBuilder().build()).build());
- builder.put(PushPbbCase.class, new PushPbbActionCaseBuilder().setPushPbbAction(new PushPbbActionBuilder().build()).build());
- builder.put(PopPbbCase.class, new PopPbbActionCaseBuilder().setPopPbbAction(new PopPbbActionBuilder().build()).build());
- builder.put(SetNwSrcCase.class, new SetNwSrcActionCaseBuilder().setSetNwSrcAction(new SetNwSrcActionBuilder().build()).build());
- builder.put(SetNwDstCase.class, new SetNwDstActionCaseBuilder().setSetNwDstAction(new SetNwDstActionBuilder().build()).build());
+ builder.put(PushPbbCase.class,
+ new PushPbbActionCaseBuilder().setPushPbbAction(new PushPbbActionBuilder().build()).build());
+ builder.put(PopPbbCase.class,
+ new PopPbbActionCaseBuilder().setPopPbbAction(new PopPbbActionBuilder().build()).build());
+ builder.put(SetNwSrcCase.class,
+ new SetNwSrcActionCaseBuilder().setSetNwSrcAction(new SetNwSrcActionBuilder().build()).build());
+ builder.put(SetNwDstCase.class,
+ new SetNwDstActionCaseBuilder().setSetNwDstAction(new SetNwDstActionBuilder().build()).build());
OF_TO_SAL_ACTION = builder.build();
}
static {
- final Builder<Class<? extends MatchField>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField>> builder = ImmutableMap.builder();
+ final Builder<Class<? extends MatchField>, Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table
+ .types.rev131026.MatchField>> builder = ImmutableMap.builder();
builder.put(ArpOp.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp.class);
builder.put(ArpSha.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha.class);
builder.put(EthDst.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst.class);
builder.put(EthSrc.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc.class);
builder.put(EthType.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType.class);
- builder.put(Icmpv4Code.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code.class);
- builder.put(Icmpv4Type.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type.class);
- builder.put(Icmpv6Code.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code.class);
- builder.put(Icmpv6Type.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type.class);
- builder.put(InPhyPort.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.class);
+ builder.put(Icmpv4Code.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code.class);
+ builder.put(Icmpv4Type.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type.class);
+ builder.put(Icmpv6Code.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code.class);
+ builder.put(Icmpv6Type.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type.class);
+ builder.put(InPhyPort.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.class);
builder.put(InPort.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort.class);
builder.put(IpDscp.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp.class);
builder.put(IpEcn.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn.class);
builder.put(Ipv4Dst.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst.class);
builder.put(Ipv4Src.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src.class);
builder.put(Ipv6Dst.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst.class);
- builder.put(Ipv6Exthdr.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.class);
- builder.put(Ipv6Flabel.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel.class);
- builder.put(Ipv6NdSll.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll.class);
- builder.put(Ipv6NdTarget.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget.class);
- builder.put(Ipv6NdTll.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll.class);
+ builder.put(Ipv6Exthdr.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.class);
+ builder.put(Ipv6Flabel.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel.class);
+ builder.put(Ipv6NdSll.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll.class);
+ builder.put(Ipv6NdTarget.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget.class);
+ builder.put(Ipv6NdTll.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll.class);
builder.put(Ipv6Src.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src.class);
builder.put(Metadata.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata.class);
builder.put(MplsBos.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos.class);
- builder.put(MplsLabel.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel.class);
+ builder.put(MplsLabel.class,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel.class);
builder.put(MplsTc.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc.class);
builder.put(PbbIsid.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid.class);
builder.put(SctpDst.class, org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst.class);
.build();
}
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> salTablePropertiesList = new ArrayList<>();
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table
+ .properties.TableFeatureProperties> salTablePropertiesList = new ArrayList<>();
TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
int index = 0;
private static List<Instruction> setInstructionTableFeatureProperty(final TableFeatureProperties properties) {
List<Instruction> instructionList = new ArrayList<>();
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder builder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder
+ builder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .list.InstructionBuilder();
int index = 0;
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731
InstructionChoice currInstructionType = currInstruction.getInstructionChoice();
if (currInstructionType instanceof GotoTableCase) {
- builder.setInstruction((new GoToTableCaseBuilder()
+ builder.setInstruction(new GoToTableCaseBuilder()
.setGoToTable(new GoToTableBuilder().build())
- .build()));
+ .build());
} else if (currInstructionType instanceof WriteMetadataCase) {
- builder.setInstruction((new WriteMetadataCaseBuilder()
+ builder.setInstruction(new WriteMetadataCaseBuilder()
.setWriteMetadata(new WriteMetadataBuilder().build())
- .build()));
+ .build());
} else if (currInstructionType instanceof WriteActionsCase) {
- builder.setInstruction((new WriteActionsCaseBuilder()
+ builder.setInstruction(new WriteActionsCaseBuilder()
.setWriteActions(new WriteActionsBuilder().build())
- .build()));
+ .build());
} else if (currInstructionType instanceof ApplyActionsCase) {
- builder.setInstruction((new ApplyActionsCaseBuilder()
+ builder.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder().build())
- .build()));
+ .build());
} else if (currInstructionType instanceof ClearActionsCase) {
- builder.setInstruction((new ClearActionsCaseBuilder()
+ builder.setInstruction(new ClearActionsCaseBuilder()
.setClearActions(new ClearActionsBuilder().build())
- .build()));
+ .build());
} else if (currInstructionType instanceof MeterCase) {
- builder.setInstruction((new MeterCaseBuilder()
+ builder.setInstruction(new MeterCaseBuilder()
.setMeter(new MeterBuilder().build())
- .build()));
+ .build());
}
// TODO: Experimenter instructions are unhandled
.getNextTableIds().stream().map(NextTableIds::getTableId).collect(Collectors.toList());
}
- private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> setActionTableFeatureProperty(
- final TableFeatureProperties properties) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList = new ArrayList<>();
+ private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>
+ setActionTableFeatureProperty(final TableFeatureProperties properties) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList =
+ new ArrayList<>();
int order = 0;
for (Action action : properties
.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction()) {
if (action != null && null != action.getActionChoice()) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder
+ actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+ .list.ActionBuilder();
actionBuilder.setOrder(order++);
ActionChoice actionType = action.getActionChoice();
- org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action salAction = OF_TO_SAL_ACTION.get(actionType.getImplementedInterface());
+ org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action salAction =
+ OF_TO_SAL_ACTION.get(actionType.getImplementedInterface());
actionBuilder.setAction(salAction);
actionList.add(actionBuilder.build());
List<TableFeatures> salTableFeaturesList = new ArrayList<>();
TableFeaturesBuilder salTableFeatures = new TableFeaturesBuilder();
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.
- multipart.reply.table.features._case.multipart.reply.table.features.TableFeatures ofTableFeatures : source
- .getTableFeatures()) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply
+ .body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeatures
+ ofTableFeatures : source.getTableFeatures()) {
salTableFeatures.setTableId(ofTableFeatures.getTableId());
salTableFeatures.setName(ofTableFeatures.getName());
if (ofTableFeatures.getMetadataMatch() != null) {
- salTableFeatures.setMetadataMatch(new BigInteger(OFConstants.SIGNUM_UNSIGNED, ofTableFeatures.getMetadataMatch()));
+ salTableFeatures.setMetadataMatch(new BigInteger(OFConstants.SIGNUM_UNSIGNED,
+ ofTableFeatures.getMetadataMatch()));
}
if (ofTableFeatures.getMetadataWrite() != null) {
- salTableFeatures.setMetadataWrite(new BigInteger(OFConstants.SIGNUM_UNSIGNED, ofTableFeatures.getMetadataWrite()));
+ salTableFeatures.setMetadataWrite(new BigInteger(OFConstants.SIGNUM_UNSIGNED,
+ ofTableFeatures.getMetadataWrite()));
}
if (ofTableFeatures.getConfig() != null) {
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorProcessor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.OrderComparator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
- * Converts SAL actions into OF Library actions
+ * Converts SAL actions into OF Library actions.
*
+ * <p>
* Example usage:
* <pre>
* {@code
List<Action>,
ActionConvertorData> {
- private static final ConvertorProcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action, ActionConvertorData> PROCESSOR = new ConvertorProcessor<
+ private static final ConvertorProcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+ .action.Action, Action, ActionConvertorData> PROCESSOR = new ConvertorProcessor<
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
Action,
ActionConvertorData>()
.addCase(new SalToOfSetNwTosActionV10Case())
// Try to convert action grouping using converters from openflowplugin-extension
.addCase(new SalToOfGeneralExtensionGroupingCase());
- private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action.class);
- private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> ACTION_ORDERING =
- Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>build());
+
+ private static final Set<Class<?>> TYPES = Collections.singleton(org.opendaylight.yang.gen.v1.urn.opendaylight
+ .action.types.rev131112.action.list.Action.class);
+ private static final Ordering<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+ .action.list.Action> ACTION_ORDERING = Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn
+ .opendaylight.action.types.rev131112.action.list.Action>build());
@Override
public Collection<Class<?>> getTypes() {
}
@Override
- public List<Action> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> source, ActionConvertorData data) {
+ public List<Action> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+ .list.Action> source, ActionConvertorData data) {
// Prepare list of converted actions
final List<Action> result = new ArrayList<>();
// Iterate over SAL actions, run them through tokenizer and then add them to list of converted actions
if (source != null) {
- final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> sortedActions =
- ACTION_ORDERING.sortedCopy(source);
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>
+ sortedActions = ACTION_ORDERING.sortedCopy(source);
- for (final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action : sortedActions) {
- final Optional<Action> convertedAction = PROCESSOR.process(action.getAction(), data, getConvertorExecutor());
+ for (final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action :
+ sortedActions) {
+ final Optional<Action> convertedAction = PROCESSOR.process(action.getAction(), data,
+ getConvertorExecutor());
if (convertedAction.isPresent()) {
result.add(convertedAction.get());
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorProcessor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Converts OF actions associated with bucket to SAL Actions.
*
+ * <p>
* Example usage:
* <pre>
* {@code
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>,
ActionResponseConvertorData> {
- private static final ConvertorProcessor<ActionChoice, org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, ActionResponseConvertorData> PROCESSOR = new ConvertorProcessor<
+ private static final ConvertorProcessor<ActionChoice, org.opendaylight.yang.gen.v1.urn.opendaylight.action.types
+ .rev131112.action.Action, ActionResponseConvertorData> PROCESSOR = new ConvertorProcessor<
ActionChoice,
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
ActionResponseConvertorData>()
}
@Override
- public List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> convert(List<Action> source, ActionResponseConvertorData data) {
- final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> result = new ArrayList<>();
+ public List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>
+ convert(List<Action> source, ActionResponseConvertorData data) {
+ final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> result =
+ new ArrayList<>();
final OpenflowVersion ofVersion = OpenflowVersion.get(data.getVersion());
// Iterate over Openflow actions, run them through tokenizer and then add them to list of converted actions
if (source != null) {
for (final Action action : source) {
- final Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> convertedAction = PROCESSOR.process(action.getActionChoice(), data, getConvertorExecutor());
+ final Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>
+ convertedAction = PROCESSOR.process(action.getActionChoice(), data, getConvertorExecutor());
if (convertedAction.isPresent()) {
result.add(convertedAction.get());
}
@Override
- public Optional<Action> process(@Nonnull final CopyTtlInCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final CopyTtlInCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
CopyTtlInBuilder copyTtlInaction = new CopyTtlInBuilder();
return Optional.of(new CopyTtlInCaseBuilder().setCopyTtlIn(copyTtlInaction.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final CopyTtlOutCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final CopyTtlOutCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
CopyTtlOutBuilder copyTtlOutaction = new CopyTtlOutBuilder();
return Optional.of(new CopyTtlOutCaseBuilder().setCopyTtlOut(copyTtlOutaction.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final DecMplsTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final DecMplsTtlCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
DecMplsTtlBuilder decMplsTtl = new DecMplsTtlBuilder();
return Optional.of(new DecMplsTtlCaseBuilder().setDecMplsTtl(decMplsTtl.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final DecNwTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final DecNwTtlCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
DecNwTtlBuilder decNwTtl = new DecNwTtlBuilder();
return Optional.of(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final GroupCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final GroupCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
GroupAction groupActionFromOF = source.getGroupAction();
GroupActionBuilder groupAction = new GroupActionBuilder();
groupAction.setGroupId(groupActionFromOF.getGroupId());
}
@Override
- public Optional<Action> process(@Nonnull final OutputActionCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final OutputActionCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
final OpenflowVersion ofVersion = OpenflowVersion.get(data.getVersion());
OutputActionBuilder outputAction = new OutputActionBuilder();
OutputAction outputActionFromOF = source.getOutputAction();
if (outputActionFromOF.getPort() != null) {
- PortNumberUni protocolAgnosticPort = OpenflowPortsUtil.getProtocolAgnosticPort(ofVersion, outputActionFromOF.getPort().getValue());
+ PortNumberUni protocolAgnosticPort = OpenflowPortsUtil.getProtocolAgnosticPort(ofVersion,
+ outputActionFromOF.getPort().getValue());
String portNumberAsString = OpenflowPortsUtil.portNumberToString(protocolAgnosticPort);
outputAction.setOutputNodeConnector(new Uri(portNumberAsString));
} else {
}
@Override
- public Optional<Action> process(@Nonnull final PopMplsCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PopMplsCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PopMplsAction popMplsActionFromOF = source.getPopMplsAction();
PopMplsActionBuilder popMplsAction = new PopMplsActionBuilder();
popMplsAction.setEthernetType(popMplsActionFromOF.getEthertype().getValue());
}
@Override
- public Optional<Action> process(@Nonnull final PopPbbCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PopPbbCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PopPbbActionBuilder popPbb = new PopPbbActionBuilder();
return Optional.of(new PopPbbActionCaseBuilder().setPopPbbAction(popPbb.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final PopVlanCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PopVlanCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PopVlanActionBuilder popVlan = new PopVlanActionBuilder();
return Optional.of(new PopVlanActionCaseBuilder().setPopVlanAction(popVlan.build()).build());
}
}
@Override
- public Optional<Action> process(@Nonnull final PushMplsCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PushMplsCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PushMplsAction pushMplsActionFromOF = source.getPushMplsAction();
PushMplsActionBuilder pushMplsAction = new PushMplsActionBuilder();
pushMplsAction.setEthernetType(pushMplsActionFromOF.getEthertype().getValue());
}
@Override
- public Optional<Action> process(@Nonnull final PushPbbCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PushPbbCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PushPbbAction pushPbbActionFromOf = source.getPushPbbAction();
PushPbbActionBuilder pushPbbAction = new PushPbbActionBuilder();
pushPbbAction.setEthernetType(pushPbbActionFromOf.getEthertype().getValue());
}
@Override
- public Optional<Action> process(@Nonnull final PushVlanCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final PushVlanCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PushVlanAction pushVlanActionFromOF = source.getPushVlanAction();
PushVlanActionBuilder pushVlanAction = new PushVlanActionBuilder();
pushVlanAction.setEthernetType(pushVlanActionFromOF.getEthertype().getValue());
}
@Override
- public Optional<Action> process(@Nonnull final SetDlDstCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetDlDstCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetDlDstActionCaseBuilder()
.setSetDlDstAction(new SetDlDstActionBuilder()
.setAddress(source.getSetDlDstAction().getDlDstAddress())
}
@Override
- public Optional<Action> process(@Nonnull final SetDlSrcCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetDlSrcCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetDlSrcActionCaseBuilder()
.setSetDlSrcAction(new SetDlSrcActionBuilder()
.setAddress(source.getSetDlSrcAction().getDlSrcAddress())
}
@Override
- public Optional<Action> process(@Nonnull final SetFieldCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
- final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(data.getVersion());
+ public Optional<Action> process(@Nonnull final SetFieldCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
+ final VersionDatapathIdConvertorData datapathIdConvertorData =
+ new VersionDatapathIdConvertorData(data.getVersion());
final SetFieldAction setFieldAction = source.getSetFieldAction();
final SetFieldBuilder setField = new SetFieldBuilder();
final Optional<MatchBuilder> matchOptional = convertorExecutor.convert(setFieldAction, datapathIdConvertorData);
}
@Override
- public Optional<Action> process(@Nonnull final SetMplsTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetMplsTtlCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
SetMplsTtlAction setMplsTtlActionFromOF = source.getSetMplsTtlAction();
SetMplsTtlActionBuilder mplsTtlAction = new SetMplsTtlActionBuilder();
}
@Override
- public Optional<Action> process(@Nonnull final SetNwDstCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetNwDstCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetNwDstActionCaseBuilder()
- .setSetNwDstAction(new SetNwDstActionBuilder()
- .setAddress(new Ipv4Builder()
- .setIpv4Address(IpConversionUtil.createPrefix(source.getSetNwDstAction().getIpAddress()))
- .build())
- .build())
+ .setSetNwDstAction(new SetNwDstActionBuilder().setAddress(new Ipv4Builder()
+ .setIpv4Address(IpConversionUtil.createPrefix(source.getSetNwDstAction().getIpAddress()))
+ .build()).build())
.build());
}
}
}
@Override
- public Optional<Action> process(@Nonnull final SetNwSrcCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetNwSrcCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetNwSrcActionCaseBuilder()
- .setSetNwSrcAction(new SetNwSrcActionBuilder()
- .setAddress(new Ipv4Builder()
- .setIpv4Address(IpConversionUtil.createPrefix(source.getSetNwSrcAction().getIpAddress()))
- .build())
- .build())
+ .setSetNwSrcAction(new SetNwSrcActionBuilder().setAddress(new Ipv4Builder()
+ .setIpv4Address(IpConversionUtil.createPrefix(source.getSetNwSrcAction().getIpAddress()))
+ .build()).build())
.build());
}
}
}
@Override
- public Optional<Action> process(@Nonnull final SetNwTosCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetNwTosCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetNwTosActionCaseBuilder()
.setSetNwTosAction(new SetNwTosActionBuilder()
.setTos((int) source.getSetNwTosAction().getNwTos())
}
@Override
- public Optional<Action> process(@Nonnull final SetNwTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetNwTtlCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
SetNwTtlAction setNwTtlActionFromOf = source.getSetNwTtlAction();
SetNwTtlActionBuilder setNwTtl = new SetNwTtlActionBuilder();
setNwTtl.setNwTtl(setNwTtlActionFromOf.getNwTtl());
}
@Override
- public Optional<Action> process(@Nonnull final SetQueueCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetQueueCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
SetQueueAction queueActionFromOF = source.getSetQueueAction();
SetQueueActionBuilder setQueueAction = new SetQueueActionBuilder();
setQueueAction.setQueueId(queueActionFromOF.getQueueId());
}
@Override
- public Optional<Action> process(@Nonnull final SetTpDstCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetTpDstCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetTpDstActionCaseBuilder()
.setSetTpDstAction(new SetTpDstActionBuilder()
.setPort(new PortNumber(source.getSetTpDstAction().getPort().getValue().intValue()))
}
@Override
- public Optional<Action> process(@Nonnull final SetTpSrcCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetTpSrcCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetTpSrcActionCaseBuilder()
.setSetTpSrcAction(new SetTpSrcActionBuilder()
.setPort(new PortNumber(source.getSetTpSrcAction().getPort().getValue().intValue()))
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorCase;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
}
@Override
- public Optional<Action> process(@Nonnull final SetVlanVidCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetVlanVidCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetVlanIdActionCaseBuilder()
.setSetVlanIdAction(new SetVlanIdActionBuilder()
.setVlanId(new VlanId(source.getSetVlanVidAction().getVlanVid()))
}
@Override
- public Optional<Action> process(@Nonnull final SetVlanPcpCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final SetVlanPcpCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new SetVlanPcpActionCaseBuilder()
.setSetVlanPcpAction(new SetVlanPcpActionBuilder()
.setVlanPcp(new VlanPcp(source.getSetVlanPcpAction().getVlanPcp()))
}
@Override
- public Optional<Action> process(@Nonnull final StripVlanCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final StripVlanCase source, final ActionResponseConvertorData data,
+ ConvertorExecutor convertorExecutor) {
PopVlanActionBuilder popVlan = new PopVlanActionBuilder();
return Optional.of(new PopVlanActionCaseBuilder().setPopVlanAction(popVlan.build()).build());
}
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final CopyTtlInCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final CopyTtlInCase source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new ActionBuilder()
.setActionChoice(new CopyTtlInCaseBuilder().build())
.build());
}
-}
\ No newline at end of file
+}
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final CopyTtlOutCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final CopyTtlOutCase source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new ActionBuilder()
.setActionChoice(new CopyTtlOutCaseBuilder().build())
.build());
}
-}
\ No newline at end of file
+}
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final DecMplsTtlCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final DecMplsTtlCase source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new ActionBuilder()
.setActionChoice(new DecMplsTtlCaseBuilder().build())
.build());
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final DecNwTtlCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final DecNwTtlCase source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.of(new ActionBuilder()
.setActionChoice(new DecNwTtlCaseBuilder().build())
.build());
}
-}
\ No newline at end of file
+}
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final DropActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final DropActionCase source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
return Optional.empty();
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SalToOfGeneralExtensionGroupingCase extends ConvertorCase<GeneralExtensionGrouping, Action, ActionConvertorData> {
+public class SalToOfGeneralExtensionGroupingCase
+ extends ConvertorCase<GeneralExtensionGrouping, Action, ActionConvertorData> {
private static final Logger LOG = LoggerFactory.getLogger(SalToOfGeneralExtensionGroupingCase.class);
public SalToOfGeneralExtensionGroupingCase() {
@Nonnull
@Override
- public Optional<Action> process(@Nonnull final GeneralExtensionGrouping source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
+ public Optional<Action> process(@Nonnull final GeneralExtensionGrouping source, final ActionConvertorData data,
+ ConvertorExecutor convertorExecutor) {
final short version = data.getVersion();
- /**
+
+ /*
* TODO: EXTENSION PROPOSAL (action, MD-SAL to OFJava)
* - we might need sessionContext as converter input
*
*/
-
Extension extAction = source.getExtension();
- ConverterExtensionKey<? extends ExtensionKey> key = new ConverterExtensionKey<>(source.getExtensionKey(), version);
+ ConverterExtensionKey<? extends ExtensionKey> key =
+ new ConverterExtensionKey<>(source.getExtensionKey(), version);
ConvertorToOFJava<Action> convertor = OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
return convertor != null ? Optional.of(convertor.convert(extAction)) : Optional.empty();
}
-}
\ No newline at end of file
+}