public class ProvisioningAction
extends java.lang.Object
Provides a set of actions to be returned by provisioning algorithms. These actions are:
Although the ProvisioningAction
class is common for all actions, its meaning (i.e.
action type) depends on the static method used to get an instance. Take a look
on the description of the static methods to obtain more information.
Important: Actions don't take effect within the algorithm. This means,
for example, that if you remove a route, methods like netState.getNumberOfRoutes()
will return
the previous value including that route, instead of the current according
to the actions. Network state is actually modified by the kernel after
the execution of the algorithm, so users should deal with current network state
by their own.
Important: Identifiers for new elements (i.e. route, protection segment)
follow an incremental scheme, and no index is reused when some element is removed.
The (first) next identifier of each element can be accessed via netState.getNextXXXId())
method.
Modifier and Type | Class and Description |
---|---|
static class |
ProvisioningAction.ActionType
Type of action.
|
Modifier and Type | Method and Description |
---|---|
static ProvisioningAction |
addProtectionSegment(double reservedBandwidthInErlangs,
int[] seqLinks,
java.util.Map<java.lang.String,java.lang.String> segmentAttributes)
Adds a new protection segment.
|
static ProvisioningAction |
addProtectionSegmentToRouteBackupSegmentList(long segmentId,
long routeId)
Adds a protection segment to the backup list of a given route.
|
static ProvisioningAction |
addRoute(int demandId,
double trafficVolumeInErlangs,
int[] seqLinks,
long[] backupSegmentList,
java.util.Map<java.lang.String,java.lang.String> routeAttributes)
Adds a route.
|
ProvisioningAction.ActionType |
getActionType()
Returns the action type.
|
static ProvisioningAction |
modifyRoute(long routeId,
double trafficVolumeInErlangs,
long[] seqLinksAndSegments,
java.util.Map<java.lang.String,java.lang.String> routeAttributes)
Modifies a route.
|
static ProvisioningAction |
removeAllProtectionSegmentsFromRouteBackupSegmentList(long routeId)
Removes all protection segments associated to a given route.
|
static ProvisioningAction |
removeAllRoutes()
Removes all routes.
|
static ProvisioningAction |
removeProtectionSegment(long segmentId)
Removes a protection segment.
|
static ProvisioningAction |
removeProtectionSegmentFromRouteBackupSegmentList(long segmentId,
long routeId)
Removes a protection segment from the backup list of a given route.
|
static ProvisioningAction |
removeRoute(long routeId)
Removes a route.
|
java.lang.String |
toString() |
public ProvisioningAction.ActionType getActionType()
public static ProvisioningAction addProtectionSegment(double reservedBandwidthInErlangs, int[] seqLinks, java.util.Map<java.lang.String,java.lang.String> segmentAttributes)
reservedBandwidthInErlangs
- Reserved bandwidth in ErlangsseqLinks
- Sequence of linkssegmentAttributes
- Attributes (null means no attributes)public static ProvisioningAction addProtectionSegmentToRouteBackupSegmentList(long segmentId, long routeId)
segmentId
- Protection segment identifierrouteId
- Route identifierpublic static ProvisioningAction addRoute(int demandId, double trafficVolumeInErlangs, int[] seqLinks, long[] backupSegmentList, java.util.Map<java.lang.String,java.lang.String> routeAttributes)
demandId
- Demand identifiertrafficVolumeInErlangs
- Traffic volume in ErlangsseqLinks
- Sequence of links (protection segments cannot be used when adding routes)backupSegmentList
- Backup segment list (null means empty)routeAttributes
- Attributes (null means no attributes)public static ProvisioningAction modifyRoute(long routeId, double trafficVolumeInErlangs, long[] seqLinksAndSegments, java.util.Map<java.lang.String,java.lang.String> routeAttributes)
routeId
- Route identifiertrafficVolumeInErlangs
- Traffic volume in Erlangs (-1 means no change)seqLinksAndSegments
- Sequence of links and protection segments (null means no change). Protection segments are denoted with an identifier equal to -1 - protection segment identifierrouteAttributes
- Route attributes (null means no change)public static ProvisioningAction removeAllProtectionSegmentsFromRouteBackupSegmentList(long routeId)
Removes all protection segments associated to a given route.
Important: If any of the segments is being used, the kernel will throw an error.
routeId
- Route identifierpublic static ProvisioningAction removeAllRoutes()
public static ProvisioningAction removeProtectionSegment(long segmentId)
Removes a protection segment. Automatically is removed from the backup list of each associated route.
Important: If it is being used, the kernel will throw an error.
segmentId
- Protection segment identifierpublic static ProvisioningAction removeProtectionSegmentFromRouteBackupSegmentList(long segmentId, long routeId)
Important: If it is being used, the kernel will throw an error.
segmentId
- Protection segment identifierrouteId
- Route identifierpublic static ProvisioningAction removeRoute(long routeId)
routeId
- Route identifierpublic java.lang.String toString()
toString
in class java.lang.Object