Package org.onosproject.segmentrouting
Class TunnelHandler
- java.lang.Object
-
- org.onosproject.segmentrouting.TunnelHandler
-
public class TunnelHandler extends Object
Tunnel Handler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTunnelHandler.ResultResult of tunnel creation or removal.
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description TunnelHandler(org.onosproject.net.link.LinkService linkService, DeviceConfiguration deviceConfiguration, Map<org.onosproject.net.DeviceId,DefaultGroupHandler> groupHandlerMap, org.onosproject.store.service.EventuallyConsistentMap<String,Tunnel> tunnelStore)Constructs tunnel handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TunnelHandler.ResultcreateTunnel(Tunnel tunnel)Creates a tunnel.TunnelgetTunnel(String tid)Returns the tunnel with the tunnel ID given.List<Tunnel>getTunnels()Returns all tunnels.TunnelHandler.ResultremoveTunnel(Tunnel tunnelInfo)Removes the tunnel with the tunnel ID given.
-
-
-
Constructor Detail
-
TunnelHandler
public TunnelHandler(org.onosproject.net.link.LinkService linkService, DeviceConfiguration deviceConfiguration, Map<org.onosproject.net.DeviceId,DefaultGroupHandler> groupHandlerMap, org.onosproject.store.service.EventuallyConsistentMap<String,Tunnel> tunnelStore)Constructs tunnel handler.- Parameters:
linkService- link servicedeviceConfiguration- device configurationgroupHandlerMap- group handler maptunnelStore- tunnel store
-
-
Method Detail
-
createTunnel
public TunnelHandler.Result createTunnel(Tunnel tunnel)
Creates a tunnel.- Parameters:
tunnel- tunnel reference to create a tunnel- Returns:
- WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully
-
removeTunnel
public TunnelHandler.Result removeTunnel(Tunnel tunnelInfo)
Removes the tunnel with the tunnel ID given.- Parameters:
tunnelInfo- tunnel information to delete tunnels- Returns:
- TUNNEL_NOT_FOUND if the tunnel to remove does not exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully.
-
getTunnel
public Tunnel getTunnel(String tid)
Returns the tunnel with the tunnel ID given.- Parameters:
tid- Tunnel ID- Returns:
- Tunnel reference
-
-