예제 #1
0
 @Override
 public void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(src, LINK_POINT_NULL);
   checkNotNull(dst, LINK_POINT_NULL);
   store.removeLink(networkId, src, dst);
 }
예제 #2
0
 @Override
 public void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(deviceId, DEVICE_NULL);
   checkNotNull(portNumber, "Port number cannot be null");
   store.removePort(networkId, deviceId, portNumber);
 }
예제 #3
0
 @Deactivate
 public void deactivate() {
   store.unsetDelegate(delegate);
   eventDispatcher.removeSink(VirtualNetworkEvent.class);
   intentService.removeListener(intentListener);
   log.info("Stopped");
 }
예제 #4
0
 @Activate
 public void activate() {
   store.setDelegate(delegate);
   eventDispatcher.addSink(VirtualNetworkEvent.class, listenerRegistry);
   intentService.addListener(intentListener);
   log.info("Started");
 }
예제 #5
0
 @Override
 public VirtualPort createVirtualPort(
     NetworkId networkId, DeviceId deviceId, PortNumber portNumber, Port realizedBy) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(deviceId, DEVICE_NULL);
   checkNotNull(portNumber, "Port description cannot be null");
   return store.addPort(networkId, deviceId, portNumber, realizedBy);
 }
예제 #6
0
 /**
  * Maps the virtual connect point to a physical connect point.
  *
  * @param networkId network identifier
  * @param virtualCp virtual connect point
  * @return physical connect point
  */
 private ConnectPoint mapVirtualToPhysicalPort(NetworkId networkId, ConnectPoint virtualCp) {
   Set<VirtualPort> ports = store.getPorts(networkId, virtualCp.deviceId());
   for (VirtualPort port : ports) {
     if (port.number().equals(virtualCp.port())) {
       return new ConnectPoint(port.realizedBy().element().id(), port.realizedBy().number());
     }
   }
   return null;
 }
예제 #7
0
 @Override
 public VirtualHost createVirtualHost(
     NetworkId networkId,
     HostId hostId,
     MacAddress mac,
     VlanId vlan,
     HostLocation location,
     Set<IpAddress> ips) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(hostId, DEVICE_NULL);
   return store.addHost(networkId, hostId, mac, vlan, location, ips);
 }
예제 #8
0
  @Override
  public VirtualLink createVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst) {
    checkNotNull(networkId, NETWORK_NULL);
    checkNotNull(src, LINK_POINT_NULL);
    checkNotNull(dst, LINK_POINT_NULL);
    ConnectPoint physicalSrc = mapVirtualToPhysicalPort(networkId, src);
    checkNotNull(physicalSrc, LINK_POINT_NULL);
    ConnectPoint physicalDst = mapVirtualToPhysicalPort(networkId, dst);
    checkNotNull(physicalDst, LINK_POINT_NULL);

    VirtualNetworkProvider provider = getProvider(DefaultVirtualLink.PID);
    Link.State state = Link.State.INACTIVE;
    if (provider != null) {
      boolean traversable = provider.isTraversable(physicalSrc, physicalDst);
      state = traversable ? Link.State.ACTIVE : Link.State.INACTIVE;
    }
    return store.addLink(networkId, src, dst, state, null);
  }
예제 #9
0
 /**
  * Returns the virtual network matching the network identifier.
  *
  * @param networkId network identifier
  * @return virtual network
  */
 private VirtualNetwork getVirtualNetwork(NetworkId networkId) {
   checkNotNull(networkId, NETWORK_NULL);
   return store.getNetwork(networkId);
 }
예제 #10
0
 @Override
 public Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId) {
   checkNotNull(tenantId, TENANT_NULL);
   return store.getNetworks(tenantId);
 }
예제 #11
0
 @Override
 public void unregisterTenantId(TenantId tenantId) {
   checkNotNull(tenantId, TENANT_NULL);
   store.removeTenantId(tenantId);
 }
예제 #12
0
 @Override
 public Set<TenantId> getTenantIds() {
   return store.getTenantIds();
 }
예제 #13
0
 @Override
 public VirtualNetwork createVirtualNetwork(TenantId tenantId) {
   checkNotNull(tenantId, TENANT_NULL);
   return store.addNetwork(tenantId);
 }
예제 #14
0
 @Override
 public void removeVirtualNetwork(NetworkId networkId) {
   checkNotNull(networkId, NETWORK_NULL);
   store.removeNetwork(networkId);
 }
예제 #15
0
 @Override
 public VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(deviceId, DEVICE_NULL);
   return store.addDevice(networkId, deviceId);
 }
예제 #16
0
 @Override
 public Set<VirtualLink> getVirtualLinks(NetworkId networkId) {
   checkNotNull(networkId, NETWORK_NULL);
   return store.getLinks(networkId);
 }
예제 #17
0
 @Override
 public void removeVirtualDevice(NetworkId networkId, DeviceId deviceId) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(deviceId, DEVICE_NULL);
   store.removeDevice(networkId, deviceId);
 }
예제 #18
0
 @Override
 public Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId) {
   checkNotNull(networkId, NETWORK_NULL);
   return store.getPorts(networkId, deviceId);
 }
예제 #19
0
 @Override
 public void removeVirtualHost(NetworkId networkId, HostId hostId) {
   checkNotNull(networkId, NETWORK_NULL);
   checkNotNull(hostId, DEVICE_NULL);
   store.removeHost(networkId, hostId);
 }