use of org.onosproject.incubator.net.tunnel.Tunnel in project onos by opennetworkinglab.
the class TunnelManager method borrowTunnel.
@Override
public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type, Annotations... annotations) {
Collection<Tunnel> tunnels = store.borrowTunnel(consumerId, src, dst, type, annotations);
if (tunnels == null || tunnels.isEmpty()) {
Tunnel tunnel = new DefaultTunnel(null, src, dst, type, null, null, null, null, annotations);
Set<ProviderId> ids = getProviders();
for (ProviderId providerId : ids) {
TunnelProvider provider = getProvider(providerId);
provider.setupTunnel(tunnel, null);
}
}
return tunnels;
}
use of org.onosproject.incubator.net.tunnel.Tunnel in project onos by opennetworkinglab.
the class TunnelManager method setupTunnel.
@Override
public TunnelId setupTunnel(ApplicationId producerId, ElementId srcElementId, Tunnel tunnel, Path path) {
// TODO: producerId to check if really required to consider while setup the tunnel.
checkNotNull(tunnel, TUNNNEL_NULL);
TunnelId tunnelId = store.createOrUpdateTunnel(tunnel, State.INIT);
if (tunnelId != null) {
Set<ProviderId> ids = getProviders();
Tunnel newT = queryTunnel(tunnelId);
for (ProviderId providerId : ids) {
TunnelProvider provider = getProvider(providerId);
provider.setupTunnel(srcElementId, newT, path);
}
}
return tunnelId;
}
use of org.onosproject.incubator.net.tunnel.Tunnel in project onos by opennetworkinglab.
the class TunnelManager method borrowTunnel.
@Override
public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Annotations... annotations) {
Collection<Tunnel> tunnels = store.borrowTunnel(consumerId, src, dst, annotations);
if (tunnels == null || tunnels.isEmpty()) {
Tunnel tunnel = new DefaultTunnel(null, src, dst, null, null, null, null, null, annotations);
Set<ProviderId> ids = getProviders();
for (ProviderId providerId : ids) {
TunnelProvider provider = getProvider(providerId);
provider.setupTunnel(tunnel, null);
}
}
return tunnels;
}
Aggregations