public void clean();
- public void shouldListenOnXtrPort(boolean listenOnXtrPort);
-
public void setShouldUseSmr(boolean smr);
public boolean shouldUseSmr();
- public void setXtrPort(int port);
-
public MapNotify handleMapRegister(MapRegister mb);
public MapReply handleMapRequest(MapRequest mr);
/**
* An interface for configuring the lisp plugin address.
*/
-public interface IConfigLispPlugin {
+public interface IConfigLispSouthboundPlugin {
public void setLispAddress(String address);
+
+ public void shouldListenOnXtrPort(boolean shouldListenOnXtrPort);
+ public void setXtrPort(int port);
}
import java.io.Closeable;
import java.io.IOException;
-import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispPlugin;
+import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispSouthboundPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
public void updateContext(LispConfigModule module) {
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
- IConfigLispPlugin service = (IConfigLispPlugin) bundleContext
- .getService(bundleContext.getServiceReference(IConfigLispPlugin.class.getName()));
+ IConfigLispSouthboundPlugin service = (IConfigLispSouthboundPlugin) bundleContext
+ .getService(bundleContext.getServiceReference(IConfigLispSouthboundPlugin.class.getName()));
service.setLispAddress(module.getBindAddress());
}
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapNotifyInputBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapReplyInputBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SetXtrPortInputBuilder;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ShouldListenOnXtrPortInputBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.Address;
mapServer.setOverwrite(overwrite);
}
- @Override
- public void shouldListenOnXtrPort(boolean listenOnXtrPort) {
- getLispSB().shouldListenOnXtrPort(new ShouldListenOnXtrPortInputBuilder().setShouldListenOnXtrPort(listenOnXtrPort).build());
- }
-
- @Override
- public void setXtrPort(int port) {
- getLispSB().setXtrPort(new SetXtrPortInputBuilder().setXtrPort(new PortNumber(port)).build());
- }
-
}
import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
-import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispPlugin;
+import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispSouthboundPlugin;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.EidToLocatorRecord.Action;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafApplicationDataAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafKeyValueAddress;
private byte[] mapRequestPacket;
private byte[] mapRegisterPacketWithNotify;
private byte[] mapRegisterPacketWithoutNotify;
- private IConfigLispPlugin configLispPlugin;
+ private IConfigLispSouthboundPlugin configLispPlugin;
String lispBindAddress = "127.0.0.1";
String ourAddress = "127.0.0.2";
private LispAFIAddress locatorEid;
public void testRecievingNonProxyOnXtrPort() throws SocketTimeoutException, SocketException, Throwable {
cleanUP();
- lms.shouldListenOnXtrPort(true);
+ configLispPlugin.shouldListenOnXtrPort(true);
notificationCalled = false;
final String eid = "10.10.10.10";
String rloc = "127.0.0.3";
}
assertNotNull(ILispDAO.class.getName() + " service wasn't found in bundle context ", this.clusterService);
- r = bc.getServiceReference(IConfigLispPlugin.class.getName());
+ r = bc.getServiceReference(IConfigLispSouthboundPlugin.class.getName());
if (r != null) {
- this.configLispPlugin = (IConfigLispPlugin) bc.getService(r);
+ this.configLispPlugin = (IConfigLispSouthboundPlugin) bc.getService(r);
}
- assertNotNull(IConfigLispPlugin.class.getName() + " service wasn't found in bundle context ", this.configLispPlugin);
+ assertNotNull(IConfigLispSouthboundPlugin.class.getName() + " service wasn't found in bundle context ", this.configLispPlugin);
configLispPlugin.setLispAddress(lispBindAddress);
// Uncomment this code to Know which services were actually loaded to
private void cleanUP() {
after();
lms.clean();
- lms.shouldListenOnXtrPort(false);
+ configLispPlugin.shouldListenOnXtrPort(false);
socket = initSocket(socket, LispMessage.PORT_NUM);
}
import org.opendaylight.lispflowmapping.southbound.lisp.ILispSouthboundService;
import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundService;
import org.opendaylight.lispflowmapping.southbound.lisp.LispXtrSouthboundService;
-import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispPlugin;
+import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispSouthboundPlugin;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispflowmappingService;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapNotifyInput;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapReplyInput;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SendMapRequestInput;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.SetXtrPortInput;
-import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.ShouldListenOnXtrPortInput;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.transportaddress.TransportAddress;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.osgi.framework.BundleContext;
import com.google.common.net.InetAddresses;
-public class LispSouthboundPlugin extends AbstractBindingAwareProvider implements IConfigLispPlugin, CommandProvider, LispflowmappingService {
+public class LispSouthboundPlugin extends AbstractBindingAwareProvider implements IConfigLispSouthboundPlugin, CommandProvider, LispflowmappingService {
protected static final Logger logger = LoggerFactory.getLogger(LispSouthboundPlugin.class);
private static Object startLock = new Object();
private void registerWithOSGIConsole() {
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
bundleContext.registerService(CommandProvider.class.getName(), this, null);
- bundleContext.registerService(IConfigLispPlugin.class.getName(), this, null);
+ bundleContext.registerService(IConfigLispSouthboundPlugin.class.getName(), this, null);
}
protected void stopImpl(BundleContext context) {
}
@Override
- public Future<RpcResult<Void>> shouldListenOnXtrPort(ShouldListenOnXtrPortInput input) {
- logger.debug("got a call to shouldListenOnXtrPort");
- if (listenOnXtrPort == input.isShouldListenOnXtrPort()) {
- logger.debug("no action done, ond and new value are identical, " + listenOnXtrPort);
- return null;
- }
- listenOnXtrPort = input.isShouldListenOnXtrPort();
+ public void shouldListenOnXtrPort(boolean shouldListenOnXtrPort) {
+ listenOnXtrPort = shouldListenOnXtrPort;
if (listenOnXtrPort) {
- logger.debug("restarting xtr thread");
+ logger.debug("restarting xtr thread");
restartXtrThread();
} else {
- logger.debug("terminating thread");
+ logger.debug("terminating thread");
stopXtrThread();
}
- return null;
}
@Override
- public Future<RpcResult<Void>> setXtrPort(SetXtrPortInput input) {
- this.xtrPort = input.getXtrPort().getValue();
+ public void setXtrPort(int port) {
+ this.xtrPort = port;
if (listenOnXtrPort) {
restartXtrThread();
}
- return null;
}
}
/target
/target
/target
+/target
}
}
- rpc shouldListenOnXtrPort {
- input {
- leaf shouldListenOnXtrPort {
- type boolean;
- }
- }
- }
-
- rpc setXtrPort {
- input {
- leaf xtrPort {
- type inet:port-number;
- }
- }
- }
-
notification addMapping {
uses MapRegisterNotification;
}