Search in sources :

Example 1 with TUNNEL_PEER

use of org.onosproject.net.behaviour.upf.UpfEntityType.TUNNEL_PEER in project up4 by omec-project.

the class Up4DeviceManager method deleteAll.

@Override
public void deleteAll(UpfEntityType entityType) throws UpfProgrammableException {
    switch(entityType) {
        case TERMINATION_DOWNLINK:
            getLeaderUpfProgrammable().deleteAll(entityType);
            up4Store.reset();
            break;
        case INTERFACE:
            Collection<? extends UpfEntity> intfs = getLeaderUpfProgrammable().readAll(UpfEntityType.INTERFACE).stream().filter(t -> !((UpfInterface) t).isDbufReceiver()).collect(Collectors.toList());
            for (UpfEntity i : intfs) {
                getLeaderUpfProgrammable().delete(i);
            }
            break;
        case TUNNEL_PEER:
            Collection<? extends UpfEntity> tunnels = getLeaderUpfProgrammable().readAll(UpfEntityType.TUNNEL_PEER).stream().filter(t -> ((UpfGtpTunnelPeer) t).tunPeerId() != DBUF_TUNNEL_ID).collect(Collectors.toList());
            for (UpfEntity tun : tunnels) {
                getLeaderUpfProgrammable().delete(tun);
            }
            break;
        default:
            getLeaderUpfProgrammable().deleteAll(entityType);
    }
}
Also used : Up4Config(org.omecproject.up4.config.Up4Config) UpfMeter(org.onosproject.net.behaviour.upf.UpfMeter) NetworkConfigRegistry(org.onosproject.net.config.NetworkConfigRegistry) FlowEntryState(org.onosproject.net.flow.FlowEntry.FlowEntryState) DefaultFlowRule(org.onosproject.net.flow.DefaultFlowRule) DeviceService(org.onosproject.net.device.DeviceService) APP_SUBJECT_FACTORY(org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY) Future(java.util.concurrent.Future) Executors.newSingleThreadScheduledExecutor(java.util.concurrent.Executors.newSingleThreadScheduledExecutor) FlowRuleService(org.onosproject.net.flow.FlowRuleService) Pair(org.apache.commons.lang3.tuple.Pair) MeterCellId(org.onosproject.net.meter.MeterCellId) MeterService(org.onosproject.net.meter.MeterService) Map(java.util.Map) ApplicationId(org.onosproject.core.ApplicationId) MastershipService(org.onosproject.mastership.MastershipService) APPLICATION_METER(org.onosproject.net.behaviour.upf.UpfEntityType.APPLICATION_METER) Up4DbufConfig(org.omecproject.up4.config.Up4DbufConfig) Ip4Address(org.onlab.packet.Ip4Address) UpfDevice(org.onosproject.net.behaviour.upf.UpfDevice) Deactivate(org.osgi.service.component.annotations.Deactivate) Set(java.util.Set) UpfInterface(org.onosproject.net.behaviour.upf.UpfInterface) ConfigFactory(org.onosproject.net.config.ConfigFactory) DeviceEvent(org.onosproject.net.device.DeviceEvent) SESSION_DOWNLINK(org.onosproject.net.behaviour.upf.UpfEntityType.SESSION_DOWNLINK) TERMINATION_UPLINK(org.onosproject.net.behaviour.upf.UpfEntityType.TERMINATION_UPLINK) Tools.getLongProperty(org.onlab.util.Tools.getLongProperty) DeviceId(org.onosproject.net.DeviceId) Dictionary(java.util.Dictionary) DbufClient(org.omecproject.dbuf.client.DbufClient) MeterRequest(org.onosproject.net.meter.MeterRequest) TUNNEL_PEER(org.onosproject.net.behaviour.upf.UpfEntityType.TUNNEL_PEER) NetworkConfigEvent(org.onosproject.net.config.NetworkConfigEvent) FlowRuleEvent(org.onosproject.net.flow.FlowRuleEvent) ComponentContext(org.osgi.service.component.ComponentContext) ArrayList(java.util.ArrayList) Component(org.osgi.service.component.annotations.Component) Lists(com.google.common.collect.Lists) Up4Service(org.omecproject.up4.Up4Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) UpfCounter(org.onosproject.net.behaviour.upf.UpfCounter) StreamSupport(java.util.stream.StreamSupport) UpfEntityType(org.onosproject.net.behaviour.upf.UpfEntityType) FlowRuleListener(org.onosproject.net.flow.FlowRuleListener) ComponentConfigService(org.onosproject.cfg.ComponentConfigService) FlowRuleOperations(org.onosproject.net.flow.FlowRuleOperations) UPF_RECONCILE_INTERVAL(org.omecproject.up4.impl.OsgiPropertyConstants.UPF_RECONCILE_INTERVAL) DeviceListener(org.onosproject.net.device.DeviceListener) Meter(org.onosproject.net.meter.Meter) Properties(java.util.Properties) TERMINATION_DOWNLINK(org.onosproject.net.behaviour.upf.UpfEntityType.TERMINATION_DOWNLINK) UpfTerminationUplink(org.onosproject.net.behaviour.upf.UpfTerminationUplink) NetworkConfigListener(org.onosproject.net.config.NetworkConfigListener) UpfProgrammable(org.onosproject.net.behaviour.upf.UpfProgrammable) DefaultMeter(org.onosproject.net.meter.DefaultMeter) Context(io.grpc.Context) UpfTerminationDownlink(org.onosproject.net.behaviour.upf.UpfTerminationDownlink) CoreService(org.onosproject.core.CoreService) LoggerFactory(org.slf4j.LoggerFactory) Tools.groupedThreads(org.onlab.util.Tools.groupedThreads) Up4EventListener(org.omecproject.up4.Up4EventListener) ByteBuffer(java.nio.ByteBuffer) PiPipeconfEvent(org.onosproject.net.pi.service.PiPipeconfEvent) UpfGtpTunnelPeer(org.onosproject.net.behaviour.upf.UpfGtpTunnelPeer) UpfEntity(org.onosproject.net.behaviour.upf.UpfEntity) DEFAULT_SLICE_ID(org.omecproject.up4.impl.AppConstants.DEFAULT_SLICE_ID) DefaultDbufClient(org.omecproject.dbuf.client.DefaultDbufClient) Ip4Prefix(org.onlab.packet.Ip4Prefix) MeterEvent(org.onosproject.net.meter.MeterEvent) MeterScope(org.onosproject.net.meter.MeterScope) AbstractListenerManager(org.onosproject.event.AbstractListenerManager) Device(org.onosproject.net.Device) Collection(java.util.Collection) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) List(java.util.List) FlowRule(org.onosproject.net.flow.FlowRule) PiPipeconfListener(org.onosproject.net.pi.service.PiPipeconfListener) UPF_RECONCILE_INTERVAL_DEFAULT(org.omecproject.up4.impl.OsgiPropertyConstants.UPF_RECONCILE_INTERVAL_DEFAULT) SESSION_METER(org.onosproject.net.behaviour.upf.UpfEntityType.SESSION_METER) PiPipeconfService(org.onosproject.net.pi.service.PiPipeconfService) PiMeterCellId(org.onosproject.net.pi.runtime.PiMeterCellId) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) MeterListener(org.onosproject.net.meter.MeterListener) Activate(org.osgi.service.component.annotations.Activate) ExecutorService(java.util.concurrent.ExecutorService) UpfSessionDownlink(org.onosproject.net.behaviour.upf.UpfSessionDownlink) UpfProgrammableException(org.onosproject.net.behaviour.upf.UpfProgrammableException) Logger(org.slf4j.Logger) Up4Event(org.omecproject.up4.Up4Event) Maps(com.google.common.collect.Maps) MeterState(org.onosproject.net.meter.MeterState) ReferenceCardinality(org.osgi.service.component.annotations.ReferenceCardinality) TimeUnit(java.util.concurrent.TimeUnit) DefaultMeterRequest(org.onosproject.net.meter.DefaultMeterRequest) Modified(org.osgi.service.component.annotations.Modified) Reference(org.osgi.service.component.annotations.Reference) COUNTER(org.onosproject.net.behaviour.upf.UpfEntityType.COUNTER) UpfEntity(org.onosproject.net.behaviour.upf.UpfEntity)

Aggregations

Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Sets (com.google.common.collect.Sets)1 Context (io.grpc.Context)1 ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Dictionary (java.util.Dictionary)1 List (java.util.List)1 Map (java.util.Map)1 Properties (java.util.Properties)1 Set (java.util.Set)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors.newSingleThreadScheduledExecutor (java.util.concurrent.Executors.newSingleThreadScheduledExecutor)1 Future (java.util.concurrent.Future)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Collectors (java.util.stream.Collectors)1 StreamSupport (java.util.stream.StreamSupport)1