use of org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey in project openflowplugin by opendaylight.
the class ActionExtensionHelper method processAlienAction.
/**
* Processes an alien action.
*
* @param action openflow action
* @param ofVersion openflow version
* @param actionPath openflow action path
* @return augmentation wrapper containing augmentation depending on matchPath
*/
public static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action processAlienAction(final Action action, final OpenflowVersion ofVersion, final ActionPath actionPath) {
ConvertorActionFromOFJava<Action, ActionPath> convertor = null;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null;
final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider();
if (Objects.isNull(extensionConvertorProvider)) {
return null;
}
if (action.getActionChoice() instanceof ExperimenterIdCase) {
ExperimenterIdCase actionCase = (ExperimenterIdCase) action.getActionChoice();
// TODO: EXTENSION PROPOSAL (action, OFJava to MD-SAL)
ExperimenterActionSerializerKey key = new ExperimenterActionSerializerKey(ofVersion.getVersion(), actionCase.getExperimenter().getExperimenter().getValue(), actionCase.getExperimenter().getSubType());
convertor = extensionConvertorProvider.getActionConverter(key);
} else if (action.getActionChoice() != null) {
ActionSerializerKey<?> key = new ActionSerializerKey(EncodeConstants.OF13_VERSION_ID, action.getActionChoice().getImplementedInterface(), null);
convertor = extensionConvertorProvider.getActionConverter(key);
}
if (convertor != null) {
alienAction = convertor.convert(action, actionPath);
}
return alienAction;
}
use of org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey in project openflowplugin by opendaylight.
the class NiciraExtensionCodecRegistratorImplTest method registerActionSerializerTest.
@Test
public void registerActionSerializerTest() {
niciraExtensionCodecRegistrator.registerActionSerializer(actionSerializerKey, actionSerializer);
ActionSerializerKey key1 = NiciraUtil.createOfJavaKeyFrom(actionSerializerKey);
Mockito.verify(provider).registerActionSerializer(Matchers.eq(key1), Matchers.any(OFGeneralSerializer.class));
}
use of org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey in project openflowplugin by opendaylight.
the class NiciraExtensionCodecRegistratorImplTest method unregisterActionSerializerTest.
@Test
public void unregisterActionSerializerTest() {
niciraExtensionCodecRegistrator.registerActionSerializer(actionSerializerKey, actionSerializer);
ActionSerializerKey key1 = NiciraUtil.createOfJavaKeyFrom(actionSerializerKey);
niciraExtensionCodecRegistrator.unregisterActionSerializer(actionSerializerKey);
Mockito.verify(provider).unregisterSerializer(Matchers.eq(key1));
}
Aggregations