Search in sources :

Example 86 with Eid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.

the class LispSouthboundPlugin method restoreDaoFromDatastore.

/**
 * Restore all keys from MDSAL datastore.
 */
public void restoreDaoFromDatastore() {
    final List<AuthenticationKey> authKeys = dsbe.getAllAuthenticationKeys();
    LOG.info("Restoring {} keys from datastore into southbound DAO", authKeys.size());
    for (AuthenticationKey authKey : authKeys) {
        final Eid key = authKey.getEid();
        final MappingAuthkey mappingAuthkey = authKey.getMappingAuthkey();
        LOG.debug("Adding authentication key '{}' with key-ID {} for {}", mappingAuthkey.getKeyString(), mappingAuthkey.getKeyType(), LispAddressStringifier.getString(key));
        akdb.addAuthenticationKey(key, mappingAuthkey);
    }
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) AuthenticationKey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey) MappingAuthkey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey)

Example 87 with Eid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.

the class LispUtilTest method buildAddMappingInputTest.

/**
 * Tests {@link LispUtil#buildAddMappingInput} method.
 */
@Test
public void buildAddMappingInputTest() {
    final MappingRecord mappingRecord = new MappingRecordBuilder().setAction(MappingRecord.Action.NoAction).setAuthoritative(true).setEid(EID).setLocatorRecord(Lists.newArrayList(getDefaultLocatorRecord())).setMapVersion((short) 0).setRecordTtl(RECORD_TTL).build();
    final AddMappingInput expectedResult = new AddMappingInputBuilder().setMappingRecord(mappingRecord).build();
    final AddMappingInput result = LispUtil.buildAddMappingInput(EID, Lists.newArrayList(LOCATOR_RECORD));
    assertEquals(expectedResult, result);
}
Also used : 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) AddMappingInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput) AddMappingInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInputBuilder) Test(org.junit.Test)

Example 88 with Eid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.

the class SubnetDataProcessorTest method createTest.

/**
 * Tests {@link SubnetDataProcessor#create} method.
 */
@Test
public void createTest() throws ExecutionException, InterruptedException {
    final MappingAuthkey mappingAuthkey = new MappingAuthkeyBuilder().setKeyString(UUID_STRING).setKeyType(1).build();
    final AddKeyInput addKeyInput = new AddKeyInputBuilder().setEid(EID).setMappingAuthkey(mappingAuthkey).build();
    commonStubbing();
    Mockito.when(odlMappingserviceServiceMock.addKey(addKeyInput)).thenReturn(future);
    subnetDataProcessor.create(subnet);
    assertEquals(true, rpcResult.isSuccessful());
}
Also used : AddKeyInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddKeyInput) MappingAuthkey(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey) MappingAuthkeyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder) AddKeyInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddKeyInputBuilder) Test(org.junit.Test)

Example 89 with Eid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.

the class SubnetDataProcessorTest method deleteTest.

/**
 * Tests {@link SubnetDataProcessor#delete} method.
 */
@Test
public void deleteTest() throws ExecutionException, InterruptedException {
    final RemoveKeyInput removeKeyInput = new RemoveKeyInputBuilder().setEid(EID).build();
    commonStubbing();
    Mockito.when(odlMappingserviceServiceMock.removeKey(removeKeyInput)).thenReturn(future);
    subnetDataProcessor.delete(subnet);
    assertEquals(true, rpcResult.isSuccessful());
}
Also used : RemoveKeyInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveKeyInputBuilder) RemoveKeyInput(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveKeyInput) Test(org.junit.Test)

Example 90 with Eid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.

the class PortDataProcessor method update.

@Override
public void update(Port port) {
    final String hostId = port.getAugmentation(PortBindingExtension.class).getHostId();
    if (hostId == null) {
        LOG.error("Updating port to lisp mapping service failed. Port does not have a HostID. Port: {}", port.toString());
        return;
    }
    List<FixedIps> fixedIPs = port.getFixedIps();
    if (fixedIPs != null && fixedIPs.size() > 0) {
        Eid eidAddress;
        for (FixedIps ip : fixedIPs) {
            eidAddress = getEid(port, ip);
            PortData portData = new PortData(port.getUuid().getValue(), eidAddress);
            hostInformationManager.addHostRelatedInfo(hostId, portData);
        }
    }
    LOG.info("Neutron Port updated: Port name: " + port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0) : "No Fixed IP assigned"));
    LOG.debug("Neutron Port Updated : " + port.toString());
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) PortData(org.opendaylight.lispflowmapping.neutron.mappingmanager.PortData) FixedIps(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps) PortBindingExtension(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.PortBindingExtension)

Aggregations

Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)173 Test (org.junit.Test)98 EidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)51 GotMapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)28 MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)28 MappingRecord (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)27 SourceDestKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey)19 ILispDAO (org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)18 MappingRecordBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder)18 MapRegister (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister)17 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)16 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)15 ItrRloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.ItrRloc)14 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)13 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)13 Rloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc)12 MapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify)11 ArrayList (java.util.ArrayList)10 Ipv4PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinary)10 Ipv6PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6PrefixBinary)10