Package org.onosproject.net.pi.service
Interface PiPipeconfService
-
- All Superinterfaces:
ListenerService<PiPipeconfEvent,PiPipeconfListener>
@Beta public interface PiPipeconfService extends ListenerService<PiPipeconfEvent,PiPipeconfListener>
A service to manage the configurations of protocol-independent pipelines.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
bindToDevice(PiPipeconfId pipeconfId, DeviceId deviceId)
Signals that the given pipeconf is associated to the given infrastructure device.java.lang.String
getMergedDriver(DeviceId deviceId, PiPipeconfId pipeconfId)
Returns the name of a driver that is equivalent to the base driver of the given device plus all the pipeline-specific behaviors exposed by the given pipeconf (previously registered usingregister(PiPipeconf)
).java.util.Optional<PiPipeconf>
getPipeconf(DeviceId deviceId)
Returns the pipeconf instance associated with the given device, if present.java.util.Optional<PiPipeconf>
getPipeconf(PiPipeconfId id)
Returns the pipeconf instance associated with the given identifier, if present.java.lang.Iterable<PiPipeconf>
getPipeconfs()
Returns all pipeconfs registered.java.util.Optional<PiPipeconfId>
ofDevice(DeviceId deviceId)
Deprecated.in ONOS 2.1 usegetPipeconf(DeviceId)
insteadvoid
register(PiPipeconf pipeconf)
Registers the given pipeconf making it available to other subsystems.void
unregister(PiPipeconfId pipeconfId)
Unregisters the given pipeconf.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
register
void register(PiPipeconf pipeconf) throws java.lang.IllegalStateException
Registers the given pipeconf making it available to other subsystems.- Parameters:
pipeconf
- a pipeconf- Throws:
java.lang.IllegalStateException
- if the same pipeconf identifier is already registered.
-
unregister
void unregister(PiPipeconfId pipeconfId) throws java.lang.IllegalStateException
Unregisters the given pipeconf. Once unregistered, other subsystems will not be able to access the pipeconf content.- Parameters:
pipeconfId
- a pipeconfId- Throws:
java.lang.IllegalStateException
- if the same pipeconf identifier is already registered.
-
getPipeconfs
java.lang.Iterable<PiPipeconf> getPipeconfs()
Returns all pipeconfs registered.- Returns:
- a collection of pipeconfs
-
getPipeconf
java.util.Optional<PiPipeconf> getPipeconf(PiPipeconfId id)
Returns the pipeconf instance associated with the given identifier, if present. If not present, it means that no pipeconf with such identifier has been registered so far.- Parameters:
id
- a pipeconf identifier- Returns:
- an optional pipeconf
-
getPipeconf
java.util.Optional<PiPipeconf> getPipeconf(DeviceId deviceId)
Returns the pipeconf instance associated with the given device, if present. If not present, it means no pipeconf has been associated with that device so far.- Parameters:
deviceId
- a device identifier- Returns:
- an optional pipeconf
-
bindToDevice
void bindToDevice(PiPipeconfId pipeconfId, DeviceId deviceId)
Signals that the given pipeconf is associated to the given infrastructure device. As a result of this method, the pipeconf for the given device can be later retrieved usingofDevice(DeviceId)
- Parameters:
pipeconfId
- a pipeconf identifierdeviceId
- a device identifier
-
getMergedDriver
java.lang.String getMergedDriver(DeviceId deviceId, PiPipeconfId pipeconfId)
Returns the name of a driver that is equivalent to the base driver of the given device plus all the pipeline-specific behaviors exposed by the given pipeconf (previously registered usingregister(PiPipeconf)
). If such driver does not exist, this method creates one and registers is with all necessary ONOS subsystems, such that the returned name can be used to retrieve the driver instance usingDriverResolver.getDriver(String)
.This method needs to be called on all nodes of the cluster that wants to use such merged driver.
Returns null if such merged driver cannot be created.
- Parameters:
deviceId
- a device identifierpipeconfId
- a pipeconf identifier- Returns:
- driver name or null.
-
ofDevice
@Deprecated java.util.Optional<PiPipeconfId> ofDevice(DeviceId deviceId)
Deprecated.in ONOS 2.1 usegetPipeconf(DeviceId)
insteadReturns the pipeconf identifier currently associated with the given device identifier, if present. If not present, it means no pipeconf has been associated with that device so far.- Parameters:
deviceId
- device identifier- Returns:
- an optional pipeconf identifier
-
-