public final class MappingRegistry extends Object
Modifier and Type | Method and Description |
---|---|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MacMapAllowed> |
getAllowedPath(MacVlan mv)
Return path to the MAC mapping that maps the specified L2 host.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MacMapDenied> |
getDeniedPath(MacVlan mv)
Return path to the set of MAC mappings that denies the specified
L2 host.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MapReferenceList> |
getDeniedPath(MacVlan mv,
String id)
Return path to the MAC mapping that denies the specified L2 host.
|
static org.apache.commons.lang3.tuple.Pair<MacVlan,String> |
getMacMapAllowed(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
MacVlan mv)
Return an entry of the mac-map-allowed list that maps the specified host
by MAC mapping.
|
static TenantNodeIdentifier<?,?> |
getMapping(TxContext ctx,
EtherAddress eaddr,
SalPort sport,
int vid)
Return the identifier for the virtual network mapping which maps the
specified host.
|
static MacMapIdentifier |
getMapping(TxContext ctx,
MacVlan mv)
Return the identifier for the MAC mapping which maps the specified host.
|
static VNodeIdentifier<?> |
getMapping(TxContext ctx,
PortVlan pv)
Return the identifier for the virtual network mapping which reserves the
specified VLAN on a swtich port.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VlanMapping> |
getPath(NodeVlan nv)
Return path to the VLAN mapping associated with the given pair of
switch and VLAN ID.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortMapping> |
getPath(PortVlan pv)
Return path to the port mapping associated with the given pair of
switch port and VLAN ID.
|
static VlanMapIdentifier |
getVlanMapping(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
SalPort sport,
int vid)
Return the identifier for the VLAN mapping which maps the specified
VLAN on a switch port.
|
static boolean |
inactivateMacMap(TxContext ctx,
MacMapIdentifier mapId,
PortFilter filter)
Inactivate all the MAC mappings detected on switch ports specified by
the port filter.
|
static boolean |
isPortMapped(TxContext ctx,
PortVlan pv)
Determine whether the given pair of switch port and VLAN ID is mapped
to the virtual interface or not.
|
static boolean |
isVlanMapped(TxContext ctx,
NodeVlan nv)
Determine whether the given VLAN on a switch is mapped by VLAN mapping
or not.
|
static void |
logMacMapInactivated(MacMapIdentifier ident,
MacVlan mv,
SalPort sport)
Record a trace log that notifies the specified MAC mapping has been
inactivated.
|
static com.google.common.base.Optional<VlanMapping> |
read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
NodeVlan nv)
Read the vlan-mapping container associated with the given pair of
switch and VLAN ID.
|
static com.google.common.base.Optional<PortMapping> |
read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
PortVlan pv)
Read the port-mapping container associated with the given pair of
switch port and VLAN ID.
|
static com.google.common.base.Optional<MacMapAllowed> |
readAllowed(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
MacVlan mv)
Read the mac-map-allowed container associated with the given L2 host.
|
static Set<MacVlan> |
readAllowedSet(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx)
Read a set of L2 hosts present in the the mac-map-allowed container.
|
static com.google.common.base.Optional<MapReferenceList> |
readDenied(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
MacVlan mv,
String id)
Read the map-reference-list container that indicates the denied host
in the MAC mapping configuration.
|
static void |
registerMacMap(TxContext ctx,
MacMapIdentifier mapId,
MacMapChange change)
Register MAC mapping configuration.
|
static boolean |
registerPortMap(TxContext ctx,
VInterfaceIdentifier<?> ifId,
PortVlan newPv,
PortVlan oldPv,
boolean purge)
Register mapping between physical switch port and virtual interface.
|
static void |
registerVlanMap(TxContext ctx,
VlanMapIdentifier mapId,
NodeVlan nvlan,
boolean purge)
Register mapping between vBridge and VLAN.
|
static void |
releasePort(TxContext ctx,
PortVlan pv,
MacMapIdentifier ident)
Release the specified VLAN on a switch port reserved by the MAC mapping.
|
static void |
releasePort(TxContext ctx,
Set<PortVlan> rels,
MacMapIdentifier ident)
Release the specified VLAN on a switch port reserved by the MAC mapping.
|
static void |
unregisterVlanMap(TxContext ctx,
VlanMapIdentifier mapId,
NodeVlan nvlan,
boolean purge)
Unregister the VLAN mapping.
|
public static void registerVlanMap(TxContext ctx, VlanMapIdentifier mapId, NodeVlan nvlan, boolean purge) throws VTNException
nvlan
specifies a VLAN network on a specific node and
true
is specified to purge
, this method purges
network caches corresponding to the network superseded by a new
VLAN mapping.
ctx
- MD-SAL datastore transaction context.mapId
- The identifier for the VLAN mapping.nvlan
- A NodeVlan
instance that specifies the VLAN
to be mapped.purge
- If true
, this method purges obsolete network
caches as appropriate.VTNException
- An error occurred.public static void unregisterVlanMap(TxContext ctx, VlanMapIdentifier mapId, NodeVlan nvlan, boolean purge) throws VTNException
ctx
- MD-SAL datastore transaction context.mapId
- The identifier for the VLAN mapping to be unregistered.nvlan
- A NodeVlan
object which specifies the VLAN
to be unmapped.purge
- If true
is specified, this method purges caches
corresponding to the unmapped VLAN.VTNException
- A fatal error occurred.public static boolean registerPortMap(TxContext ctx, VInterfaceIdentifier<?> ifId, PortVlan newPv, PortVlan oldPv, boolean purge) throws VTNException
null
value is specified to oldPv
,
the port mapping that maps the VLAN specified by oldPv
is
removed in the same transaction. In this case the VLAN specified by
oldPv
must be currently mapped to the virtual interface
specified by ifId
.
true
is specified to purge
, this method purges
network caches corresponding to obsolete mapping.
ctx
- MD-SAL datastore transaction context.ifId
- The identifier for the virtual interface which maps the
specified VLAN.newPv
- A pair of physical switch port and VLAN ID to be mapped.
No port mapping is registered if null
is
specified.oldPv
- A pair of physical switch port and VLAN ID to be unmapped.
No port mapping is removed if null
is specified.purge
- If true
, this method purges obsolete network
caches as appropriate.true
if the port mapping was changed.
false
if not changed.VTNException
- An error occurred.public static void registerMacMap(TxContext ctx, MacMapIdentifier mapId, MacMapChange change) throws VTNException
ctx
- MD-SAL datastore transaction context.mapId
- The identifier for the MAC mapping.change
- A MacMapChange
instance which keeps differences
to be applied.MacMapConflictException
- At least one host configured in the allowed host set is already
mapped to vBridge by MAC mapping.VTNException
- An error occurred.public static boolean isPortMapped(TxContext ctx, PortVlan pv) throws VTNException
ctx
- MD-SAL datastore transaction context.pv
- A pair of the switch port and VLAN ID.true
if the given port is mapped to the virtual
interface. false
otherwise.VTNException
- An error occurred.public static boolean isVlanMapped(TxContext ctx, NodeVlan nv) throws VTNException
ctx
- MD-SAL datastore transaction context.nv
- A pair of the switch and VLAN ID.true
if the given port is mapped to the virtual
interface. false
otherwise.VTNException
- An error occurred.public static TenantNodeIdentifier<?,?> getMapping(TxContext ctx, EtherAddress eaddr, SalPort sport, int vid) throws VTNException
This method checks port mapping, MAC mapping, and VLAN mapping configurations in order, and returns the identifier for the virtual mapping found first.
ctx
- MD-SAL datastore transaction context.eaddr
- An EtherAddress
instance that specifies the host.
Specifying null
results in undefined behavior.sport
- A SalPort
instance corresponding to the switch
port where the specified host was detected.
Specifying null
results in undefined behavior.vid
- A VLAN ID.TenantNodeIdentifier
instance that specifies
the virtual mapping if found.
null
is returned if not found.VTNException
- An error occurred.public static VNodeIdentifier<?> getMapping(TxContext ctx, PortVlan pv) throws VTNException
This method searches for a port or MAC mapping which reserves the specified VLAN.
ctx
- MD-SAL datastore transaction context.pv
- A PortVlan
instance which represents a VLAN on a
specific switch port.VNodeIdentifier
instance that specifies the
virtual mapping if found.
null
is returned if not found.VTNException
- An error occurred.public static MacMapIdentifier getMapping(TxContext ctx, MacVlan mv) throws VTNException
Note that this method only sees the MAC mapping configuration. It never checks whether the MAC mapping is actually activated or not.
ctx
- MD-SAL datastore transaction context.mv
- A MacVlan
instance which specifies the L2 host.MacMapIdentifier
instance that maps the the specified
host if found. null
if not found.VTNException
- An error occurred.public static org.apache.commons.lang3.tuple.Pair<MacVlan,String> getMacMapAllowed(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, MacVlan mv) throws VTNException
This method only sees the MAC mapping configuration. It never checks whether the MAC mapping is actually activated or not.
rtx
- A read-only transaction for the MD-SAL datastore.mv
- A MacVlan
instance which specifies the L2 host.MacVlan
instance and a string representation
of MacMapIdentifier
instance if found.
null
if not found.VTNException
- An error occurred.public static VlanMapIdentifier getVlanMapping(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, SalPort sport, int vid) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.sport
- A SalPort
instance corresponding to a switch port.vid
- A VLAN ID.VlanMapIdentifier
instance if found.
null
if not found.VTNException
- An error occurred.public static boolean inactivateMacMap(TxContext ctx, MacMapIdentifier mapId, PortFilter filter) throws VTNException
Note that this method never purges network caches corresponding to invalidated mappings, such as flow entry.
ctx
- MD-SAL datastore transaction context.mapId
- The identifier for the target MAC mapping.filter
- A PortFilter
instance which selects switch ports.true
is returned if at least one host is still mapped
by the MAC mapping.
false
is returned the specified MAC mapping is
no longer active.VTNException
- A fatal error occurred.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortMapping> getPath(PortVlan pv)
pv
- A pair of the switch port and VLAN ID.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VlanMapping> getPath(NodeVlan nv)
nv
- A pair of the switch and VLAN ID.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MacMapAllowed> getAllowedPath(MacVlan mv)
mv
- A MacVlan
instance that specifies the L2 host.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MacMapDenied> getDeniedPath(MacVlan mv)
mv
- A MacVlan
instance that specifies the L2 host.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MapReferenceList> getDeniedPath(MacVlan mv, String id)
mv
- A MacVlan
instance that specifies the L2 host.id
- A string representation of the MAC mapping identifier.public static com.google.common.base.Optional<PortMapping> read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, PortVlan pv) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.pv
- A pair of the switch port and VLAN ID.Optional
instance that contains the result of the
read operation.VTNException
- An error occurred.public static com.google.common.base.Optional<VlanMapping> read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, NodeVlan nv) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.nv
- A pair of the switch and VLAN ID.Optional
instance that contains the result of the
read operation.VTNException
- An error occurred.public static com.google.common.base.Optional<MacMapAllowed> readAllowed(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, MacVlan mv) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.mv
- A MacVlan
instance that specifies the L2 host.Optional
instance that contains the result of the
read operation.VTNException
- An error occurred.public static Set<MacVlan> readAllowedSet(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.MacVlan
instances that indicates a set of
keys present in the mac-map-allowed container.VTNException
- An error occurred.public static com.google.common.base.Optional<MapReferenceList> readDenied(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, MacVlan mv, String id) throws VTNException
rtx
- A read-only transaction for the MD-SAL datastore.mv
- A MacVlan
instance that specifies the L2 host.id
- A string representation of the MAC mapping identifier.Optional
instance that contains the result of the
read operation.VTNException
- An error occurred.public static void releasePort(TxContext ctx, PortVlan pv, MacMapIdentifier ident) throws VTNException
ctx
- MD-SAL datastore transaction context.pv
- A PortVlan
instance which represents a VLAN on a
specific switch port.ident
- The identifier for the MAC mapping.VTNException
- An error occurred.public static void releasePort(TxContext ctx, Set<PortVlan> rels, MacMapIdentifier ident) throws VTNException
ctx
- MD-SAL datastore transaction context.rels
- A set of PortVlan
instances corresponding to
VLANs on switch port.ident
- The identifier for the MAC mapping.VTNException
- An error occurred.public static void logMacMapInactivated(MacMapIdentifier ident, MacVlan mv, SalPort sport)
Copyright © 2018 OpenDaylight. All rights reserved.