Search in sources :

Example 16 with AuthenticationKey

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

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

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

AuthenticationKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey)12 AuthenticationKeyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder)6 Test (org.junit.Test)5 AuthenticationKeyKey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyKey)5 EidUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)3 Mapping (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping)3 VirtualNetworkIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier)3 DataObjectModification (org.opendaylight.controller.md.sal.binding.api.DataObjectModification)2 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)2 MappingAuthkey (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey)2 VniUri (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.VniUri)2 MappingBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 DataTreeIdentifier (org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier)1 DataTreeModification (org.opendaylight.controller.md.sal.binding.api.DataTreeModification)1 IMappingSystem (org.opendaylight.lispflowmapping.interfaces.mapcache.IMappingSystem)1