Search in sources :

Example 6 with EidUri

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.

the class InstanceIdentifierUtil method createMappingIid.

public static InstanceIdentifier<Mapping> createMappingIid(Eid eid, MappingOrigin orig) {
    Preconditions.checkNotNull(eid, "Mapping needs an EID entry!");
    VirtualNetworkIdentifierKey vniKey = new VirtualNetworkIdentifierKey(new VniUri(Long.toString(getLispInstanceId(eid))));
    MappingKey eidKey = new MappingKey(new EidUri(LispAddressStringifier.getURIString(eid)), orig);
    return InstanceIdentifier.create(MappingDatabase.class).child(VirtualNetworkIdentifier.class, vniKey).child(Mapping.class, eidKey);
}
Also used : VniUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri) VirtualNetworkIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier) EidUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri) VirtualNetworkIdentifierKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierKey) XtrIdMappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingKey) MappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingKey)

Example 7 with EidUri

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.

the class InstanceIdentifierUtil method createXtrIdMappingIid.

public static InstanceIdentifier<XtrIdMapping> createXtrIdMappingIid(Eid eid, MappingOrigin orig, XtrId xtrId) {
    Preconditions.checkNotNull(eid, "Mapping needs an EID entry!");
    Preconditions.checkNotNull(xtrId, "Mapping needs an xTR-ID entry!");
    VirtualNetworkIdentifierKey vniKey = new VirtualNetworkIdentifierKey(new VniUri(Long.toString(getLispInstanceId(eid))));
    MappingKey eidKey = new MappingKey(new EidUri(LispAddressStringifier.getURIString(eid)), orig);
    XtrIdMappingKey xtrIdKey = new XtrIdMappingKey(new XtrIdUri(LispAddressStringifier.getURIString(xtrId)));
    return InstanceIdentifier.create(MappingDatabase.class).child(VirtualNetworkIdentifier.class, vniKey).child(Mapping.class, eidKey).child(XtrIdMapping.class, xtrIdKey);
}
Also used : XtrIdMappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingKey) MappingDatabase(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase) VniUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri) EidUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri) VirtualNetworkIdentifierKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierKey) Mapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping) XtrIdMapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMapping) XtrIdMappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingKey) MappingKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingKey) XtrIdUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.XtrIdUri)

Example 8 with EidUri

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.

the class DataStoreBackEndTest method getDefaultMappingDatabase.

private static MappingDatabaseBuilder getDefaultMappingDatabase() {
    final Mapping mapping_1 = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().build()).build();
    final Mapping mapping_2 = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().setEid(EID_IPV4_2).build()).build();
    final Mapping mapping_3 = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().setEid(EID_IPV4_3).build()).build();
    final Mapping mapping_4 = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().setEid(EID_IPV4_4).build()).build();
    final AuthenticationKey authenticationKey_1 = new AuthenticationKeyBuilder().setKey(new AuthenticationKeyKey(new EidUri("uri-1"))).build();
    final AuthenticationKey authenticationKey_2 = new AuthenticationKeyBuilder().setKey(new AuthenticationKeyKey(new EidUri("uri-2"))).build();
    final AuthenticationKey authenticationKey_3 = new AuthenticationKeyBuilder().setKey(new AuthenticationKeyKey(new EidUri("uri-3"))).build();
    final AuthenticationKey authenticationKey_4 = new AuthenticationKeyBuilder().setKey(new AuthenticationKeyKey(new EidUri("uri-4"))).build();
    final VirtualNetworkIdentifier vni_1 = new VirtualNetworkIdentifierBuilder().setVni(new VniUri("vni/uri/1")).setMapping(Lists.newArrayList(mapping_1, mapping_2)).setAuthenticationKey(Lists.newArrayList(authenticationKey_1, authenticationKey_2)).build();
    final VirtualNetworkIdentifier vni_2 = new VirtualNetworkIdentifierBuilder().setVni(new VniUri("vni/uri/2")).setMapping(Lists.newArrayList(mapping_3, mapping_4)).setAuthenticationKey(Lists.newArrayList(authenticationKey_3, authenticationKey_4)).build();
    return new MappingDatabaseBuilder().setVirtualNetworkIdentifier(Lists.newArrayList(vni_1, vni_2));
}
Also used : AuthenticationKeyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder) VirtualNetworkIdentifierBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierBuilder) AuthenticationKeyKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey) XtrIdMappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingBuilder) MappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder) VniUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri) AuthenticationKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey) VirtualNetworkIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier) EidUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri) MappingDatabaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabaseBuilder) Mapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping) XtrIdMapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMapping)

Example 9 with EidUri

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.

the class DSBEInputUtil method toMapping.

public static Mapping toMapping(MappingOrigin origin, Eid key, SiteId siteId, MappingData mappingData) {
    MappingRecord record = (mappingData != null) ? mappingData.getRecord() : null;
    List<SiteId> siteIds = (siteId != null) ? Arrays.asList(siteId) : null;
    return new MappingBuilder().setEidUri(new EidUri(LispAddressStringifier.getURIString(key))).setOrigin(origin).setSiteId(siteIds).setMappingRecord(record).build();
}
Also used : SiteId(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId) MappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder) XtrIdMappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingBuilder) MappingRecord(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord) EidUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri)

Example 10 with EidUri

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri in project lispflowmapping by opendaylight.

the class DSBEInputUtil method toMapping.

public static Mapping toMapping(MappingOrigin origin, Eid key, @Nullable MappingData mappingData) {
    MappingRecord record = (mappingData != null) ? mappingData.getRecord() : new MappingRecordBuilder().setEid(key).build();
    SiteId siteId = (record != null) ? record.getSiteId() : null;
    List<SiteId> siteIds = (siteId != null) ? Arrays.asList(siteId) : null;
    return new MappingBuilder().setEidUri(new EidUri(LispAddressStringifier.getURIString(key))).setOrigin(origin).setSiteId(siteIds).setMappingRecord(record).build();
}
Also used : SiteId(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId) MappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder) XtrIdMappingBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingBuilder) MappingRecord(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord) MappingRecordBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder) EidUri(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri)

Aggregations

EidUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri)16 MappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder)11 MappingRecordBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder)5 Mapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping)5 Test (org.junit.Test)4 MappingRecord (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)4 VniUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri)4 XtrIdMappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingBuilder)4 AuthenticationKeyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder)3 VirtualNetworkIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier)3 VirtualNetworkIdentifierKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierKey)3 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)2 AddMappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMappingBuilder)2 SiteId (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId)2 AuthenticationKeyKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey)2 MappingKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingKey)2 XtrIdMapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMapping)2 XtrIdMappingKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingKey)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 ArrayList (java.util.ArrayList)1