Class AmiAction
This class extends AmiMessage and provides additional functionality
for managing headers related to AMI actions, including the action type,
action ID, and channel ID. It also formats the action message in text format
for AMI communication.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.siperf.amistream.protocol.messages.AmiMessage
AmiMessage.ActionCastMethods, AmiMessage.Package -
Constructor Summary
ConstructorsConstructorDescriptionAmiAction(AmiActionType actionType, ConnectionType processorType, String processorId) Constructs a newAmiActionusing the specified action type, processor type, and processor ID.AmiAction(ActionHeader actionHeader, ConnectionType processorType, String processorId) Constructs a newAmiActionwith the specified action header, processor type, and processor ID. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a header to the AMI action message.Returns theActionHeaderassociated with this AMI action.Returns the action ID for this AMI action.Returns theActionIdHeaderassociated with this AMI action.Returns the action type of this AMI action.Returns theChannelHeaderassociated with this AMI action.Returns the channel ID associated with this AMI action.toString()Returns the string representation of this AMI action.Converts this AMI action to its text representation.Methods inherited from class com.siperf.amistream.protocol.messages.AmiMessage
cast, containsActionId, containsHeader, containsHeader, getDirection, getHeader, getHeader, getHeader, getIoTimestamp, getMessageType, getProcessorId, getProcessorType, hasChannelIdHeader, toAmiFormat
-
Constructor Details
-
AmiAction
Constructs a newAmiActionusing the specified action type, processor type, and processor ID.This constructor creates an action with a new
ActionHeaderbased on the specified action type.- Parameters:
actionType- theAmiActionTyperepresenting the action type.processorType- theConnectionTyperepresenting the type of processor.processorId- the ID of the processor initiating the action.
-
AmiAction
Constructs a newAmiActionwith the specified action header, processor type, and processor ID.This constructor allows the action header to be passed in directly, enabling more customization.
- Parameters:
actionHeader- theActionHeaderrepresenting the action type.processorType- theConnectionTyperepresenting the type of processor.processorId- the ID of the processor initiating the action.
-
-
Method Details
-
getActionType
Returns the action type of this AMI action.- Returns:
- the
AmiActionTypeof the action, ornullif no action header is set.
-
getActionHeader
Returns theActionHeaderassociated with this AMI action.- Returns:
- the
ActionHeaderfor this action, ornullif not set.
-
getActionId
Returns the action ID for this AMI action.This method retrieves the action ID from the
ActionIdHeader, ornullif not set.- Overrides:
getActionIdin classAmiMessage- Returns:
- the action ID, or
nullif not set.
-
getActionIdHeader
Returns theActionIdHeaderassociated with this AMI action.- Overrides:
getActionIdHeaderin classAmiMessage- Returns:
- the
ActionIdHeaderfor this action, ornullif not set.
-
getChannelId
Returns the channel ID associated with this AMI action.This method retrieves the channel ID from the
ChannelHeader, ornullif not set.- Overrides:
getChannelIdin classAmiMessage- Returns:
- the channel ID, or
nullif not set.
-
getChannelHeader
Returns theChannelHeaderassociated with this AMI action.- Overrides:
getChannelHeaderin classAmiMessage- Returns:
- the
ChannelHeaderfor this action, ornullif not set.
-
addHeader
Adds a header to the AMI action message.This method adds headers of type
ActionHeader,ActionIdHeader, orChannelHeader. If the header is of another type, it is added to the parent class headers.- Overrides:
addHeaderin classAmiMessage- Parameters:
header- theHeaderto be added to the AMI action.
-
toTextPresentation
Converts this AMI action to its text representation.The format follows the convention: "AmiAction[actionType, channelId, actionId]". If the channel ID or action ID is not set, "N/A" is used instead.
- Overrides:
toTextPresentationin classAmiMessage- Returns:
- the string representation of this AMI action.
-
toString
Returns the string representation of this AMI action.This is equivalent to calling
toTextPresentation().- Overrides:
toStringin classAmiMessage- Returns:
- the string representation of the AMI action.
-