2 * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.lispflowmapping.implementation;
10 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService;
11 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell;
12 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 * @author Lorand Jakab
24 public class MappingServiceShell implements IMappingServiceShell {
25 protected static final Logger LOG = LoggerFactory.getLogger(MappingServiceShell.class);
27 private final IMappingService mappingService;
29 public MappingServiceShell(final IMappingService mappingService) {
30 this.mappingService = mappingService;
34 public String printMappings() {
35 return mappingService.printMappings();
39 public void addDefaultKeyIPv4() {
40 Eid eid = LispAddressUtil.toEid(new Ipv4Prefix("0.0.0.0/0"), null);
41 MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build();
42 mappingService.addAuthenticationKey(eid, key);