public final class VTNRoutingManager extends DataStoreListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext> implements VTNSubSystem, VtnPathPolicyService
Constructor and Description |
---|
VTNRoutingManager(VTNManagerProvider provider)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(VTNRoutingListener l)
Add the given VTN routing listener.
|
Future<org.opendaylight.yangtools.yang.common.RpcResult<ClearPathPolicyOutput>> |
clearPathPolicy()
Remove all the path policies.
|
void |
close()
Close the VTN routing service.
|
protected org.opendaylight.vtn.manager.internal.routing.TopologyEventContext |
enterEvent()
Invoked when
AbstractDataChangeListener.onDataTreeChanged(Collection) has just been
called. |
protected void |
exitEvent(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx)
Invoked when
AbstractDataChangeListener.onDataTreeChanged(Collection) is going to leave. |
protected org.slf4j.Logger |
getLogger()
Return a logger instance.
|
RouteResolver |
getRouteResolver(Integer id)
Return a packet route resolver.
|
protected org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnLink> |
getWildcardPath()
Return a wildcard instance identifier that specifies data objects
to be listened.
|
VTNFuture<?> |
initConfig(boolean master)
Post a MD-SAL datastore transaction task that initializes the
configuration.
|
void |
initRpcServices(org.opendaylight.controller.sal.binding.api.RpcProviderRegistry rpcReg,
CompositeAutoCloseable regs)
Register RPC implementation required by the subsystem.
|
protected boolean |
isUpdated(VtnLink before,
VtnLink after)
Determine whether the specified data was updated or not.
|
protected void |
onCreated(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx,
IdentifiedData<VtnLink> data)
Invoked when a new data has been created in the datastore.
|
protected void |
onRemoved(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx,
IdentifiedData<VtnLink> data)
Invoked when a data has been removed from the datastore.
|
protected void |
onUpdated(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx,
ChangedData<VtnLink> data)
Invoked when a data in the datastore has been updated.
|
Future<org.opendaylight.yangtools.yang.common.RpcResult<RemovePathCostOutput>> |
removePathCost(RemovePathCostInput input)
Remove link cost configurations for all the given switch ports in the
given path policy configuration.
|
Future<org.opendaylight.yangtools.yang.common.RpcResult<Void>> |
removePathPolicy(RemovePathPolicyInput input)
Remove the path policy specified by the path policy identifier.
|
Future<org.opendaylight.yangtools.yang.common.RpcResult<SetPathCostOutput>> |
setPathCost(SetPathCostInput input)
Associate the cost of transmitting a packet with the specified
switch port in the specified path policy.
|
Future<org.opendaylight.yangtools.yang.common.RpcResult<SetPathPolicyOutput>> |
setPathPolicy(SetPathPolicyInput input)
Create or modify the path policy.
|
handleTree
checkPath, getTargetType, isRequiredEvent, nullValue, onDataTreeChanged, registerListener
addCloseable
public VTNRoutingManager(VTNManagerProvider provider)
provider
- VTN Manager provider service.public void addListener(VTNRoutingListener l)
l
- A VTN routing listener.public RouteResolver getRouteResolver(Integer id)
id
- The identifier of the path policy.RouteResolver
instance if found.
null
if not fonud.public void close()
close
in interface AutoCloseable
close
in class CloseableContainer
protected org.opendaylight.vtn.manager.internal.routing.TopologyEventContext enterEvent()
AbstractDataChangeListener.onDataTreeChanged(Collection)
has just been
called.enterEvent
in class AbstractDataChangeListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
protected void exitEvent(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx)
AbstractDataChangeListener.onDataTreeChanged(Collection)
is going to leave.
Note that this method may be called even if no modified data was notified.
exitEvent
in class AbstractDataChangeListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
ectx
- An event context created by AbstractDataChangeListener.enterEvent()
.protected void onCreated(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx, IdentifiedData<VtnLink> data)
onCreated
in class DataStoreListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
ectx
- An event context created by this instance.data
- An IdentifiedData
instance which contains the
created data.protected void onUpdated(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx, ChangedData<VtnLink> data)
onUpdated
in class DataStoreListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
ectx
- An event context created by this instance.data
- A ChangedData
instance which contains the
changed data.protected void onRemoved(org.opendaylight.vtn.manager.internal.routing.TopologyEventContext ectx, IdentifiedData<VtnLink> data)
onRemoved
in class DataStoreListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
ectx
- An event context created by this instance.data
- An IdentifiedData
instance which contains the
removed data.protected boolean isUpdated(@Nonnull VtnLink before, @Nonnull VtnLink after)
DataStoreListener.onUpdated(Object, ChangedData)
is called only if this method
returns true
.
isUpdated
in class DataStoreListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
before
- The target data object before modification.after
- The target data object after modification.true
if the target data was updated.
false
otherwise.protected org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnLink> getWildcardPath()
getWildcardPath
in class AbstractDataChangeListener<VtnLink,org.opendaylight.vtn.manager.internal.routing.TopologyEventContext>
protected org.slf4j.Logger getLogger()
Note that this method will be called before the constructor returns.
getLogger
in class CloseableContainer
Logger
instance.public VTNFuture<?> initConfig(boolean master)
initConfig
in interface VTNSubSystem
master
- true
if the local node is the configuration
provider.VTNFuture
instance associated with the task for
initialization. null
means that there is nothing to
do on initialization.public void initRpcServices(org.opendaylight.controller.sal.binding.api.RpcProviderRegistry rpcReg, CompositeAutoCloseable regs)
initRpcServices
in interface VTNSubSystem
rpcReg
- A RpcProviderRegistry
service instance.regs
- A CompositeAutoCloseable
instance to store
RPC registration.public Future<org.opendaylight.yangtools.yang.common.RpcResult<SetPathPolicyOutput>> setPathPolicy(SetPathPolicyInput input)
setPathPolicy
in interface VtnPathPolicyService
input
- Input of the RPC.Future
associated with the RPC task.public Future<org.opendaylight.yangtools.yang.common.RpcResult<Void>> removePathPolicy(RemovePathPolicyInput input)
removePathPolicy
in interface VtnPathPolicyService
input
- Input of the RPC.Future
associated with the RPC task.public Future<org.opendaylight.yangtools.yang.common.RpcResult<SetPathCostOutput>> setPathCost(SetPathCostInput input)
setPathCost
in interface VtnPathPolicyService
input
- Input of the RPC.Future
associated with the RPC task.public Future<org.opendaylight.yangtools.yang.common.RpcResult<RemovePathCostOutput>> removePathCost(RemovePathCostInput input)
removePathCost
in interface VtnPathPolicyService
input
- Input of the RPC.Future
associated with the RPC task.public Future<org.opendaylight.yangtools.yang.common.RpcResult<ClearPathPolicyOutput>> clearPathPolicy()
clearPathPolicy
in interface VtnPathPolicyService
Future
associated with the RPC task.Copyright © 2018 OpenDaylight. All rights reserved.