Search in sources :

Example 1 with AuthenticationKeyKey

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

the class DataStoreBackEndTest method updateAuthenticationKeyTest.

/**
 * Tests {@link DataStoreBackEnd#updateAuthenticationKey} method.
 */
@Test
public void updateAuthenticationKeyTest() {
    final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
    dataStoreBackEnd.updateAuthenticationKey(authenticationKey);
    Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey), Mockito.eq(true));
    // result
    AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
    assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
Also used : AuthenticationKeyKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey) AuthenticationKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 2 with AuthenticationKeyKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey 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 3 with AuthenticationKeyKey

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

the class InstanceIdentifierUtil method createAuthenticationKeyIid.

public static InstanceIdentifier<AuthenticationKey> createAuthenticationKeyIid(Eid eid) {
    Preconditions.checkNotNull(eid, "Key needs and EID entry!");
    VirtualNetworkIdentifierKey vniKey = new VirtualNetworkIdentifierKey(new VniUri(Long.toString(getLispInstanceId(eid))));
    AuthenticationKeyKey authKeyKey = new AuthenticationKeyKey(new EidUri(LispAddressStringifier.getURIString(eid)));
    return InstanceIdentifier.create(MappingDatabase.class).child(VirtualNetworkIdentifier.class, vniKey).child(AuthenticationKey.class, authKeyKey);
}
Also used : AuthenticationKeyKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey) 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)

Example 4 with AuthenticationKeyKey

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

the class DataStoreBackEndTest method addAuthenticationKeyTest.

/**
 * Tests {@link DataStoreBackEnd#addAuthenticationKey} method.
 */
@Test
public void addAuthenticationKeyTest() {
    final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
    dataStoreBackEnd.addAuthenticationKey(authenticationKey);
    Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey), Mockito.eq(true));
    // result
    AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
    assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
Also used : AuthenticationKeyKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey) AuthenticationKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 5 with AuthenticationKeyKey

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

the class DataStoreBackEndTest method removeAuthenticationKeyTest.

/**
 * Tests {@link DataStoreBackEnd#removeAuthenticationKey} method.
 */
@Test
public void removeAuthenticationKeyTest() {
    final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
    dataStoreBackEnd.removeAuthenticationKey(authenticationKey);
    Mockito.verify(wTxMock).delete(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture());
    // result
    AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
    assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
Also used : AuthenticationKeyKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey) AuthenticationKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

AuthenticationKeyKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey)5 AuthenticationKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey)4 Test (org.junit.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 EidUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri)2 VniUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri)2 VirtualNetworkIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier)2 MappingDatabaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabaseBuilder)1 AuthenticationKeyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder)1 Mapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping)1 MappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder)1 XtrIdMapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMapping)1 XtrIdMappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingBuilder)1 VirtualNetworkIdentifierBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierBuilder)1 VirtualNetworkIdentifierKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierKey)1