public final class PathPolicyUtils extends Object
PathPolicyUtils class is a collection of utility class methods
for path policy.| Modifier and Type | Field and Description |
|---|---|
static long |
COST_UNDEF
The pseudo link cost value which represents the cost is not defined.
|
static Long |
DEFAULT_LINK_COST
Default link cost used when the path policy does not exist.
|
static int |
DEFAULT_POLICY
The path policy ID associated with the system default routing policy.
|
| Modifier and Type | Method and Description |
|---|---|
static RpcException |
getDuplicatePortException(Object loc)
Return a new
RpcException that indicates duplicate port
descriptor is detected. |
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathPolicy> |
getIdentifier(Integer id)
Create the instance identifier for the specified path policy.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathCost> |
getIdentifier(Integer id,
VtnPortDesc vdesc)
Create the instance identifier for the specified path cost
configuration.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathCost> |
getIdentifier(int id,
VtnPathCostConfig vpc)
Create the instance identifier for the specified path cost information.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathPolicy> |
getIdentifier(VtnPathPolicyConfig vpp)
Create the instance identifier for the given
VtnPathPolicyConfig
instance. |
static RpcException |
getInvalidCostException(Long cost,
Throwable cause)
Return a new
RpcException that indicates the given link cost
valud is invalid. |
static RpcException |
getInvalidDefaultCostException(Long cost,
Throwable cause)
Return a new
RpcException that indicates the given default cost
valud is invalid. |
static RpcException |
getInvalidPolicyIdException(Integer id,
Throwable cause)
Return a new
RpcException that indicates the given path policy
ID is invalid. |
static RpcException |
getNoSwitchPortException()
Return a new
RpcException that indicates no switch port is
specified. |
static RpcException |
getNotFoundException(Integer id)
Return a new
RpcException that indicates the specified path
policy is not present. |
static RpcException |
getNotFoundException(Integer id,
Throwable cause)
Return a new
RpcException that indicates the specified path
policy is not present. |
static RpcException |
getNullPathCostException()
Return a new
RpcException that indicates the path cost
configuration is null. |
static RpcException |
getNullPolicyIdException()
Return a new
RpcException that indicates the path policy ID
is missing. |
static VtnPathCostBuilder |
newBuilder(VtnPathCostConfig vpcc)
Create a new
VtnPathCostBuilder instance that contains the
given path cost configuration. |
static VtnPathPolicyBuilder |
newBuilder(VtnPathPolicyConfig vppc)
Create a new
VtnPathPolicyBuilder instance that contains the
given path policy configuration. |
static VtnPathCost |
readVtnPathCost(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
int id,
VtnPortDesc vdesc)
Read the cost information associated with the given port location
in the given path policy.
|
static List<VtnPathPolicy> |
readVtnPathPolicies(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx)
Read all the path policies from the MD-SAL datastore.
|
static VtnPathPolicy |
readVtnPathPolicy(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
Integer id)
Read path policy configuration specified by the given ID.
|
static void |
setCost(VtnPathCostBuilder builder,
Long cost)
Set the path cost into the given path cost builder.
|
static void |
setDefaultCost(VtnPathPolicyBuilder builder,
Long cost)
Set the default cost into the given path policy builder.
|
static void |
setId(VtnPathPolicyBuilder builder,
Integer id)
Set the path policy identifier into the given path policy builder.
|
static void |
setPortDesc(VtnPathCostBuilder builder,
VtnPortDesc vdesc)
Set the switch port descriptor into the given path cost builder.
|
public static final int DEFAULT_POLICY
public static final Long DEFAULT_LINK_COST
public static final long COST_UNDEF
public static RpcException getNotFoundException(Integer id)
RpcException that indicates the specified path
policy is not present.id - The identifier of the path policy.RpcException.public static RpcException getNotFoundException(Integer id, Throwable cause)
RpcException that indicates the specified path
policy is not present.id - The identifier of the path policy.cause - A Throwable which indicates the cause of error.RpcException.public static RpcException getInvalidPolicyIdException(Integer id, Throwable cause)
RpcException that indicates the given path policy
ID is invalid.id - The identifier of the path policy.cause - A throwable that indicates the cause of error.RpcException.public static RpcException getInvalidDefaultCostException(Long cost, Throwable cause)
RpcException that indicates the given default cost
valud is invalid.cost - Value for default cost.cause - A throwable that indicates the cause of error.RpcException.public static RpcException getInvalidCostException(Long cost, Throwable cause)
RpcException that indicates the given link cost
valud is invalid.cost - Link cost.cause - A throwable that indicates the cause of error.RpcException.public static RpcException getNullPolicyIdException()
RpcException that indicates the path policy ID
is missing.RpcException.public static RpcException getNullPathCostException()
RpcException that indicates the path cost
configuration is null.RpcException.public static RpcException getDuplicatePortException(Object loc)
RpcException that indicates duplicate port
descriptor is detected.loc - An object that represents the switch port location.RpcException.public static RpcException getNoSwitchPortException()
RpcException that indicates no switch port is
specified.RpcException.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathPolicy> getIdentifier(Integer id)
id - The identifier of the path policy.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathPolicy> getIdentifier(VtnPathPolicyConfig vpp)
VtnPathPolicyConfig
instance.vpp - A VtnPathPolicyConfig instance.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathCost> getIdentifier(Integer id, VtnPortDesc vdesc)
id - The identifier of the path policy.vdesc - A VtnPortDesc instance.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnPathCost> getIdentifier(int id, VtnPathCostConfig vpc)
id - The identifier of the path policy.vpc - A VtnPathCostConfig instance.InstanceIdentifier instance.public static void setId(VtnPathPolicyBuilder builder, Integer id) throws RpcException
builder - A VtnPathPolicyBuilder instance.id - The identifier for the path policy.RpcException - The given path policy ID is invalid.NullPointerException - builder is null.public static void setDefaultCost(VtnPathPolicyBuilder builder, Long cost) throws RpcException
builder - A VtnPathPolicyBuilder instance.cost - The default cost value.RpcException - The given default cost is invalid.NullPointerException - builder is null.public static void setCost(VtnPathCostBuilder builder, Long cost) throws RpcException
builder - A VtnPathCostBuilder instance.cost - The path cost value.RpcException - The given path cost is invalid.NullPointerException - builder is null.public static void setPortDesc(VtnPathCostBuilder builder, VtnPortDesc vdesc) throws RpcException
builder - A VtnPathCostBuilder instance.vdesc - The switch port descriptor.RpcException - The given switch port descriptor is invalid.NullPointerException - builder is null.public static VtnPathPolicyBuilder newBuilder(VtnPathPolicyConfig vppc) throws RpcException
VtnPathPolicyBuilder instance that contains the
given path policy configuration.vppc - A VtnPathPolicyConfig instance that contains the
path policy configuration.VtnPathPolicyBuilder instance.RpcException - The given configuration contains invalid value.NullPointerException - vppc is null.public static VtnPathCostBuilder newBuilder(VtnPathCostConfig vpcc) throws RpcException
VtnPathCostBuilder instance that contains the
given path cost configuration.vpcc - A VtnPathCostConfig instance that contains the
path cost configuration.VtnPathCostBuilder instance.RpcException - The given configuration contains invalid value.public static List<VtnPathPolicy> readVtnPathPolicies(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx) throws VTNException
rtx - A ReadTransaction instance.VtnPathPolicy instances.VTNException - An error occurred.public static VtnPathPolicy readVtnPathPolicy(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, Integer id) throws VTNException
rtx - A ReadTransaction instance.id - The path policy identifier.VtnPathPolicy instance.VTNException - An error occurred.public static VtnPathCost readVtnPathCost(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, int id, VtnPortDesc vdesc) throws VTNException
rtx - A ReadTransaction instance.id - The path policy identifier.vdesc - A VtnPortDesc instance if found.
null if not found.VtnPathCost instance.VTNException - An error occurred.Copyright © 2018 OpenDaylight. All rights reserved.