Record Class StrategyNotice
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.strategy.StrategyNotice
- Record Components:
level- how much attention this deservescode- stable, greppable identifier — clients may switch on it, so treat it as APImessage- human-readable explanation, safe to show to a strategy author
- All Implemented Interfaces:
Notice
public record StrategyNotice(@NonNull Notice.Level level, @NonNull String code, @NonNull String message)
extends Record
implements Notice
A
Notice about the strategy itself rather than about one of its indicators — a condition
that concerns the whole run, so it names neither an indicator nor an instrument.
Two are raised today, both for things a strategy author cannot otherwise discover when the run happens on a worker they have no logs for: the market-data source died (the strategy is blind and will stay blind until resubscribed) and update errors are being isolated (the feed survives, but some events never reached the strategy's logic).
Deduplicated by code() alone — the inherited default — because a strategy has exactly
one market-data source and one update path, so a second occurrence is the same problem seen again.
Conditions that can occur independently many times do not belong here: see StrategyPropertyNotice, which keys on the property as well.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Notice
Notice.Level -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStrategyNotice(@NonNull Notice.Level level, @NonNull String code, @NonNull String message) Creates an instance of aStrategyNoticerecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull Stringcode()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NonNull Notice.Levellevel()Returns the value of thelevelrecord component.static StrategyNoticemarketDataSourceFailed(@NonNull String sourceName, @NonNull Throwable error) Builds theMARKET_DATA_SOURCE_FAILEDnotice.@NonNull Stringmessage()Returns the value of themessagerecord component.final StringtoString()Returns a string representation of this record class.static StrategyNoticeupdateErrorsIsolated(@NonNull Throwable error) Builds theUPDATE_ERRORS_ISOLATEDnotice.
-
Field Details
-
MARKET_DATA_SOURCE_FAILED
Raised when the market-data subscription terminates with an error.ERROR: no further data arrives on it, so every number the strategy produces from here on is stale.- See Also:
-
UPDATE_ERRORS_ISOLATED
Raised when a market-data event made the strategy's ownupdatethrow.WARN: the subscription deliberately survives (one bad event must not kill the feed), so the run continues — but it continues with gaps the author would otherwise never learn about.- See Also:
-
-
Constructor Details
-
StrategyNotice
public StrategyNotice(@NonNull @NonNull Notice.Level level, @NonNull @NonNull String code, @NonNull @NonNull String message) Creates an instance of aStrategyNoticerecord class.
-
-
Method Details
-
marketDataSourceFailed
public static StrategyNotice marketDataSourceFailed(@NonNull @NonNull String sourceName, @NonNull @NonNull Throwable error) Builds theMARKET_DATA_SOURCE_FAILEDnotice.- Parameters:
sourceName- the market-data source that failederror- what it failed with- Returns:
- the notice
-
updateErrorsIsolated
Builds theUPDATE_ERRORS_ISOLATEDnotice.- Parameters:
error- the first error seen; later ones do not raise a second notice- Returns:
- the notice
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
level
Returns the value of thelevelrecord component. -
code
-
message
-