Package velox.api.layer1.messages
Class Layer1ApiSoundAlertMessage
java.lang.Object
velox.api.layer1.messages.Layer1ApiSoundAlertMessage
- All Implemented Interfaces:
Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
public class Layer1ApiSoundAlertMessage extends java.lang.Object implements Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLayer1ApiSoundAlertMessage.BuilderBuilder to buildLayer1ApiSoundAlertMessage.static classLayer1ApiSoundAlertMessage.SoundAlertStatusstatic interfaceLayer1ApiSoundAlertMessage.SoundAlertStatusListener -
Field Summary
Fields Modifier and Type Field Description java.lang.StringadditionalInfoIf not null, this text will be shown on the alert popup below the main message, specified intextInfo.java.lang.StringalertDeclarationIdTheLayer1ApiSoundAlertDeclarationMessage.idof a linked alert declaration
Note that if you specify this field, there should already exist a registered declaration with the given id.java.lang.StringalertIdThis ID can be used to reference alert later (stop it)java.lang.StringaliasIf not null the alert is considered linked to specific instrumentjava.lang.ObjectmetadataThis field will not be used anywhere outside of strategy code, but strategy can later use this field, for example, to determine if this message should be cancelled inLayer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter.shouldCancelMessage(Layer1ApiSoundAlertMessage)intpriorityThe priority value helps to order sound messages in a sound play queue.static longREPEAT_COUNT_INFINITElongrepeatCountNumber of times sound will be repeated orREPEAT_COUNT_INFINITEfor infinite replay (until cancelled by user).java.time.DurationrepeatDelayDelay between sound repetitions.java.awt.ImageseverityIconIf not null, the icon is shown on the alert popup.booleanshowPopupIf true, popup will be shown containingtextInfo(which must not be null)byte[]soundBinary data for the sound to be played.java.lang.Class<?>sourceClass that created this messageLayer1ApiSoundAlertMessage.SoundAlertStatusListenerstatusListenerjava.lang.StringtextInfoText description of a message, will be displyed in alerts dialog -
Constructor Summary
Constructors Constructor Description Layer1ApiSoundAlertMessage(byte[] sound, java.lang.String textInfo, long repeatCount, java.time.Duration repeatDelay, Layer1ApiSoundAlertMessage.SoundAlertStatusListener statusListener, java.lang.Class<?> source, java.lang.Object metadata)Deprecated.Layer1ApiSoundAlertMessage(java.lang.String alertId)Deprecated. -
Method Summary
Modifier and Type Method Description static Layer1ApiSoundAlertMessage.Builderbuilder()Creates builder to buildLayer1ApiSoundAlertMessage.booleanisCancelMessage()True if the message was created viaLayer1ApiSoundAlertMessage(java.lang.String)constructorjava.lang.StringtoString()
-
Field Details
-
REPEAT_COUNT_INFINITE
public static final long REPEAT_COUNT_INFINITE- See Also:
- Constant Field Values
-
sound
public final byte[] soundBinary data for the sound to be played. Please do not modify array after you pass it to the message. Multiple messages can share same sound data. -
textInfo
public final java.lang.String textInfoText description of a message, will be displyed in alerts dialog -
showPopup
public final boolean showPopupIf true, popup will be shown containingtextInfo(which must not be null) -
repeatCount
public final long repeatCountNumber of times sound will be repeated orREPEAT_COUNT_INFINITEfor infinite replay (until cancelled by user). -
repeatDelay
public final java.time.Duration repeatDelayDelay between sound repetitions. -
alertId
public final java.lang.String alertIdThis ID can be used to reference alert later (stop it) -
statusListener
-
source
public final java.lang.Class<?> sourceClass that created this message -
metadata
public final java.lang.Object metadataThis field will not be used anywhere outside of strategy code, but strategy can later use this field, for example, to determine if this message should be cancelled inLayer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter.shouldCancelMessage(Layer1ApiSoundAlertMessage) -
alias
public final java.lang.String aliasIf not null the alert is considered linked to specific instrument -
alertDeclarationId
public final java.lang.String alertDeclarationIdTheLayer1ApiSoundAlertDeclarationMessage.idof a linked alert declaration
Note that if you specify this field, there should already exist a registered declaration with the given id. Also, the fields of the declaration and its linked alerts are checked for conformity, e. g. for a declaration withLayer1ApiSoundAlertDeclarationMessage.popup= true
you cannot link an alert message withshowPopup= false -
priority
public final int priorityThe priority value helps to order sound messages in a sound play queue. If there are 2 or more messages waiting in a queue, the message with higher priority will be handled first. Order of handling messages with equal priority is not guaranteed. Default is 0 -
additionalInfo
public final java.lang.String additionalInfoIf not null, this text will be shown on the alert popup below the main message, specified intextInfo. This field is optional -
severityIcon
public final java.awt.Image severityIconIf not null, the icon is shown on the alert popup. You can add your own image or use the defaults from theLayer1DefaultAlertIcons
Default value is null
-
-
Constructor Details
-
Layer1ApiSoundAlertMessage
@Deprecated public Layer1ApiSoundAlertMessage(byte[] sound, java.lang.String textInfo, long repeatCount, java.time.Duration repeatDelay, Layer1ApiSoundAlertMessage.SoundAlertStatusListener statusListener, java.lang.Class<?> source, java.lang.Object metadata)Deprecated.Creates a message that will launch an alert. UseLayer1ApiSoundAlertMessage.Builderinstead. -
Layer1ApiSoundAlertMessage
@Deprecated public Layer1ApiSoundAlertMessage(java.lang.String alertId)Deprecated.Creates a message that will stop an alert with specified alertId
-
-
Method Details
-
isCancelMessage
public boolean isCancelMessage()True if the message was created viaLayer1ApiSoundAlertMessage(java.lang.String)constructor- Returns:
- flag if the message is actually a cancel message
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
builder
Creates builder to buildLayer1ApiSoundAlertMessage.- Returns:
- created builder
-