public final class PathMapUtils extends Object
PathMapUtils class is a collection of utility class methods
for path map.| Modifier and Type | Method and Description |
|---|---|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> |
getIdentifier(Integer index)
Create the instance identifier for the global path map specified by the
given map index.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> |
getIdentifier(String name,
Integer index)
Create the instance identifier for the VTN path map specified by the
given VTN name and map index.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> |
getIdentifier(VTenantIdentifier ident,
Integer index)
Create the instance identifier for the VTN path map specified by the
given VTN identifier and map index.
|
static Integer |
getIndex(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
Return the path map index in the given instance identifier.
|
static RpcException |
getInvalidMapIndexException(Integer index,
Throwable cause)
Return a new
RpcException that indicates the given path map
index is invalid. |
static RpcException |
getNullMapIndexException()
Return a new
RpcException that indicates the path map ID is
missing. |
static boolean |
isEmpty(VtnPathMapList vplist)
Determine whether the given path map container is empty or not.
|
static boolean |
isUpdated(VtnPathMap old,
VtnPathMap vpm)
Determine whether the specified path map was actually updated or not.
|
static void |
log(org.slf4j.Logger logger,
ChangedData<?> data)
Record an informational log message that indicates a path map has been
changed.
|
static void |
log(org.slf4j.Logger logger,
IdentifiedData<?> data,
VtnUpdateType type)
Record an informational log message that indicates a path map has been
created or removed.
|
static VtnPathMap |
readPathMap(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
Integer index)
Read the path map associated with the given index in the global path
map list.
|
static VtnPathMap |
readPathMap(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
VTenantIdentifier ident,
Integer index)
Read the path map associated with the given index in the given VTN.
|
static List<VtnPathMap> |
readPathMaps(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx)
Read the path maps in the global path map list.
|
static List<VtnPathMap> |
readPathMaps(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
VTenantIdentifier ident)
Read the VTN path maps in the given VTN.
|
static String |
toString(VtnPathMap vpm)
Return a string that describes the specified path map.
|
static VtnPathMapBuilder |
toVtnPathMapBuilder(VtnPathMapConfig vpmc)
Convert the given
VtnPathMapConfig instance into a
VtnPathMapBuilder instance. |
static void |
verifyMapIndex(Integer index)
Ensure that the given map index is valid.
|
static void |
verifyMapIndex(Set<Integer> set,
Integer index)
Ensure that there is not duplicate map index in the path map list.
|
public static RpcException getNullMapIndexException()
RpcException that indicates the path map ID is
missing.RpcException.public static RpcException getInvalidMapIndexException(Integer index, Throwable cause)
RpcException that indicates the given path map
index is invalid.index - The path map index.cause - A throwable that indicates the cause of error.RpcException.public static VtnPathMapBuilder toVtnPathMapBuilder(VtnPathMapConfig vpmc) throws RpcException
VtnPathMapConfig instance into a
VtnPathMapBuilder instance.
If the given instance does not contain the path policy ID, this method set zero as the path policy ID.
vpmc - A VtnPathMapConfig instance.VtnPathMapBuilder instance that contains values
in the given VtnPathMapConfig instance.RpcException - The given VtnPathMapConfig instance contains invalid data.public static void verifyMapIndex(Set<Integer> set, Integer index) throws RpcException
set - A set of map indices.index - An index to be tested.RpcException - An error occurred.public static void verifyMapIndex(Integer index) throws RpcException
index - An index to be tested.RpcException - The given map index is invalid.public static Integer getIndex(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
path - An InstanceIdentifier instance.null if not found.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> getIdentifier(Integer index) throws RpcException
index - The index assigned to the global path map.InstanceIdentifier instance.RpcException - The given map index is invalid.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> getIdentifier(String name, Integer index) throws RpcException
This method is used to retrieve path map in existing VTN.
name - The name of the VTN.index - The index assigned to the path map in the specified VTN.InstanceIdentifier instance.RpcException - The given VTN name or map index is invalid.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathMap> getIdentifier(VTenantIdentifier ident, Integer index) throws RpcException
ident - The identifier for the target VTN.index - The index assigned to the path map in the specified VTN.InstanceIdentifier instance.RpcException - The given map index is invalid.public static boolean isEmpty(VtnPathMapList vplist)
vplist - A VtnPathMapList instance.true only if the given path map container is empty.public static List<VtnPathMap> readPathMaps(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx) throws VTNException
rtx - A ReadTransaction instance associated with the
read transaction for the MD-SAL datastore.VTNException - An error occurred.public static VtnPathMap readPathMap(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, Integer index) throws VTNException
rtx - A ReadTransaction instance associated with the
read transaction for the MD-SAL datastore.index - The index that specifies the path map.VtnPathMap instance if found.
null if not found.VTNException - An error occurred.public static List<VtnPathMap> readPathMaps(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, VTenantIdentifier ident) throws VTNException
rtx - A ReadTransaction instance associated with the
read transaction for the MD-SAL datastore.ident - The identifier for the target VTN.VTNException - An error occurred.public static VtnPathMap readPathMap(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, VTenantIdentifier ident, Integer index) throws VTNException
rtx - A ReadTransaction instance associated with the
read transaction for the MD-SAL datastore.ident - The identifier for the target VTN.index - The index that specifies the path map.VtnPathMap instance if found.
null if not found.VTNException - An error occurred.public static boolean isUpdated(@Nonnull VtnPathMap old, @Nonnull VtnPathMap vpm)
Note that this method expects that both before and
after have the same index.
old - The path map before modification.vpm - The path map after modification.true if the specified path map was actually updated.
false otherwise.public static String toString(VtnPathMap vpm)
vpm - The path map.
Note that this method expects that the specified path map
is valid.public static void log(org.slf4j.Logger logger,
IdentifiedData<?> data,
VtnUpdateType type)
logger - A logger instance.data - An IdentifiedData instance that contains a
path map.type - VtnUpdateType.CREATED on added,
VtnUpdateType.REMOVED on removed.public static void log(org.slf4j.Logger logger,
ChangedData<?> data)
logger - A logger instance.data - An ChangedData instance that contains a path map.Copyright © 2018 OpenDaylight. All rights reserved.