Interface ExternalPatternSink
- All Known Subinterfaces:
PatternProvider
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable ExternalPatternSinkDetailsgetId()Returns a unique ID for this sink.insertAll(Pattern pattern, Collection<ResourceAmount> resources, Action action) Inserts the given resources into the external target.default ExternalPatternSinkIdIf this sink acts as a proxy for another sink, the ID of the other sink should be returned here.
-
Method Details
-
insertAll
ExternalPatternSink.Result insertAll(Pattern pattern, Collection<ResourceAmount> resources, Action action) Inserts the given resources into the external target. All resources MUST be able to be inserted for this method to returnExternalPatternSink.Result.ACCEPTED, otherwise, it must returnExternalPatternSink.Result.REJECTED. If the sink is locked, it must returnExternalPatternSink.Result.LOCKED. If the resources are not applicable for this sink, it must returnExternalPatternSink.Result.SKIPPED.- Parameters:
pattern- the patternresources- the resourcesaction- the action- Returns:
- the result
-
getId
ExternalPatternSinkId getId()Returns a unique ID for this sink. This is used to unlock sinks that became locked after inserting an external iteration. The ID must remain stable across the lifecycle of theExternalPatternSink.- Returns:
- the ID for this sink
-
unwrapId
If this sink acts as a proxy for another sink, the ID of the other sink should be returned here. This is used so that the correct sink can be notified (and potentially be unlocked) when an external iteration is received.- Returns:
- the ID of the sink this sink is proxying for, or the same ID as
getId()if it is not a proxy
-
getDetails
@Nullable ExternalPatternSinkDetails getDetails()- Returns:
- optional details that belong to this sink
-