Search in sources :

Example 11 with Type

use of org.apache.xbean.asm6.Type in project openflowplugin by opendaylight.

the class OfToSalIcmpv4TypeCase method process.

@Override
public Optional<MatchBuilder> process(@Nonnull Icmpv4TypeCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
    final MatchBuilder matchBuilder = data.getMatchBuilder();
    final Icmpv4MatchBuilder icmpv4MatchBuilder = data.getIcmpv4MatchBuilder();
    Icmpv4Type icmpv4Type = source.getIcmpv4Type();
    Short type = icmpv4Type.getIcmpv4Type();
    if (type != null) {
        icmpv4MatchBuilder.setIcmpv4Type(type);
        matchBuilder.setIcmpv4Match(icmpv4MatchBuilder.build());
    }
    return Optional.of(matchBuilder);
}
Also used : Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) Icmpv4Type(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4Type) Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)

Example 12 with Type

use of org.apache.xbean.asm6.Type in project component-runtime by Talend.

the class RepositoryModelBuilderTest method notRootConfig.

@Test
void notRootConfig() {
    final RepositoryModel model = new RepositoryModelBuilder().create(new ComponentManager.AllServices(emptyMap()), singleton(new ComponentFamilyMeta("test", emptyList(), "noicon", "test", "test") {

        {
            final ParameterMeta store = new ParameterMeta(null, DataStore1.class, ParameterMeta.Type.OBJECT, "config.store", "store", new String[0], emptyList(), emptyList(), new HashMap<String, String>() {

                {
                    put("tcomp::configurationtype::type", "datastore");
                    put("tcomp::configurationtype::name", "testDatastore");
                }
            });
            final ParameterMeta wrapper = new ParameterMeta(null, WrappingStore.class, ParameterMeta.Type.OBJECT, "config", "config", new String[0], singletonList(store), emptyList(), emptyMap());
            getPartitionMappers().put("test", new PartitionMapperMeta(this, "mapper", "noicon", 1, PartitionMapper1.class, singletonList(wrapper), m -> null, (a, b) -> null, true) {
            });
        }
    }), new MigrationHandlerFactory(new ReflectionService(new ParameterModelService())));
    final List<Config> configs = model.getFamilies().stream().flatMap(f -> f.getConfigs().stream()).collect(toList());
    assertEquals(1, configs.size());
}
Also used : Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) ComponentFamilyMeta(org.talend.sdk.component.runtime.manager.ComponentFamilyMeta) HashMap(java.util.HashMap) ClassReader(org.apache.xbean.asm6.ClassReader) Collections.singletonList(java.util.Collections.singletonList) DataStore1(org.talend.test.DataStore1) JarEntry(java.util.jar.JarEntry) Collections.singleton(java.util.Collections.singleton) ClassRemapper(org.apache.xbean.asm6.commons.ClassRemapper) WithTemporaryFolder(org.talend.sdk.component.junit.base.junit5.WithTemporaryFolder) ParameterModelService(org.talend.sdk.component.runtime.manager.reflect.ParameterModelService) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) EXPAND_FRAMES(org.apache.xbean.asm6.ClassReader.EXPAND_FRAMES) JarOutputStream(java.util.jar.JarOutputStream) Remapper(org.apache.xbean.asm6.commons.Remapper) ParameterMeta(org.talend.sdk.component.runtime.manager.ParameterMeta) Collections.emptyMap(java.util.Collections.emptyMap) COMPUTE_FRAMES(org.apache.xbean.asm6.ClassWriter.COMPUTE_FRAMES) Container(org.talend.sdk.component.container.Container) Collections.emptyList(java.util.Collections.emptyList) Optional.ofNullable(java.util.Optional.ofNullable) FileOutputStream(java.io.FileOutputStream) WrappingStore(org.talend.test.WrappingStore) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) IdGenerator(org.talend.sdk.component.runtime.manager.util.IdGenerator) File(java.io.File) TestInfo(org.junit.jupiter.api.TestInfo) RepositoryModel(org.talend.sdk.component.design.extension.RepositoryModel) Test(org.junit.jupiter.api.Test) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) Stream(java.util.stream.Stream) TemporaryFolder(org.talend.sdk.component.junit.base.junit5.TemporaryFolder) JarLocation.jarLocation(org.apache.ziplock.JarLocation.jarLocation) ClassWriter(org.apache.xbean.asm6.ClassWriter) ComponentManager(org.talend.sdk.component.runtime.manager.ComponentManager) MigrationHandlerFactory(org.talend.sdk.component.runtime.manager.reflect.MigrationHandlerFactory) ReflectionService(org.talend.sdk.component.runtime.manager.reflect.ReflectionService) InputStream(java.io.InputStream) PartitionMapper1(org.talend.test.PartitionMapper1) RepositoryModel(org.talend.sdk.component.design.extension.RepositoryModel) ReflectionService(org.talend.sdk.component.runtime.manager.reflect.ReflectionService) PartitionMapper1(org.talend.test.PartitionMapper1) ParameterMeta(org.talend.sdk.component.runtime.manager.ParameterMeta) ComponentManager(org.talend.sdk.component.runtime.manager.ComponentManager) ComponentFamilyMeta(org.talend.sdk.component.runtime.manager.ComponentFamilyMeta) ParameterModelService(org.talend.sdk.component.runtime.manager.reflect.ParameterModelService) MigrationHandlerFactory(org.talend.sdk.component.runtime.manager.reflect.MigrationHandlerFactory) Test(org.junit.jupiter.api.Test)

Aggregations

Type (org.apache.xbean.asm5.Type)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)3 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)3 Icmpv4TypeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder)3 Icmpv6TypeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCaseBuilder)3 TcpSrcCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCaseBuilder)3 Icmpv4TypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder)3 Icmpv6TypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.type._case.Icmpv6TypeBuilder)3 TcpSrcBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.src._case.TcpSrcBuilder)3 Type (jodd.asm5.Type)2 Dscp (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp)2 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)2 EtherType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType)2 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)2 IpDscp (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp)2 EthDstCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder)2 EthSrcCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder)2