public class CACAction
extends Object
Provides a set of actions to be returned by CAC algorithms. These actions are:
String
to specify that reasonAlthough the CACAction
class is common for all actions, its meaning (i.e.
action type) depends on the constructor used to get an instance. Take a look
on the description of the constructors to obtain more information.
Important: 'Accept' and 'block' actions only can be returned when the processed event is a connection request. Upon connection release, these events are forbidden. This fact is checked by the kernel after the execution of the algorithmm.
Important: Actions don't take effect within the algorithm. This means,
for example, that if you release a connection in order to accommodate another one,
methods like netState.getLinkAvailableCapacityInErlangs()
will return
the previous values to the execution of the algorithm, 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: When connections are forced to be released using the action, the previously scheduled 'release connection' event is then removed.
ICACAlgorithm
,
CACEvent
Modifier and Type | Class and Description |
---|---|
static class |
CACAction.ActionType
Type of action.
|
Constructor and Description |
---|
CACAction(int connIdToRelease)
Constructor to define a 'release connection' action.
|
CACAction(int[] seqLinks,
double trafficVolumeInErlangs)
Constructor to define an 'accept request' action.
|
CACAction(int connIdToModify,
int[] seqLinks,
double trafficVolumeInErlangs)
Constructor to define a 'modify connection' action.
|
CACAction(String reasonToBlockConnection)
Constructor to define a 'block request' action.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptConnectionSequenceOfLinks()
Returns the sequence of links for the accepted connection.
|
double |
getAcceptConnectionTrafficVolumeInErlangs()
Returns the traffic volume for the accepted request.
|
CACAction.ActionType |
getActionType()
Returns the action type.
|
String |
getBlockConnectionReason()
Returns the reason for blocking a request.
|
int |
getModifyConnectionId()
Returns the connection identifier of the connection to be modified.
|
int[] |
getModifyConnectionSequenceOfLinks()
Returns the new sequence of links for the modified connection.
|
double |
getModifyConnectionTrafficVolumeInErlangs()
Returns the new traffic volume for the modified connection.
|
int |
getReleaseConnectionId()
Returns the connection identifier of the connection to be released.
|
String |
toString()
Returns a
String representation of the object. |
public CACAction(String reasonToBlockConnection)
reasonToBlockConnection
- String defining the reason to block the request (can be null
)public CACAction(int[] seqLinks, double trafficVolumeInErlangs)
seqLinks
- Sequence of linkstrafficVolumeInErlangs
- Traffic volume accepted (can be lower to the one requested)public CACAction(int connIdToModify, int[] seqLinks, double trafficVolumeInErlangs)
connIdToModify
- Connection identifierseqLinks
- Sequence of linkstrafficVolumeInErlangs
- New traffic volume in Erlangspublic CACAction(int connIdToRelease)
Constructor to define a 'release connection' action.
Important: This action doesn't trigger a 'connection release' event
connIdToRelease
- Connection identifierpublic CACAction.ActionType getActionType()
public String toString()
String
representation of the object.toString
in class Object
String
representation of the objectpublic int[] getAcceptConnectionSequenceOfLinks()
public double getAcceptConnectionTrafficVolumeInErlangs()
public String getBlockConnectionReason()
public int getModifyConnectionId()
public double getModifyConnectionTrafficVolumeInErlangs()
public int[] getModifyConnectionSequenceOfLinks()
public int getReleaseConnectionId()