public final class AcceptWithFallbackFeedIdStrategy extends Object implements FeedIdStrategy
If a feed with the proposed ID already exists in the given tenant and environment, an optional fallback strategy is used to generate a new ID. If the fallback strategy is not defined, an exception is thrown. This strategy is useful for Hawkular deployments where some of the feeds are incapable of remembering their assigned IDs and need to be pre-configured with one.
| Constructor and Description |
|---|
AcceptWithFallbackFeedIdStrategy() |
AcceptWithFallbackFeedIdStrategy(FeedIdStrategy fallback) |
| Modifier and Type | Method and Description |
|---|---|
String |
generate(Inventory inventory,
Feed proposedFeed)
Generates a unique ID for the provided feed.
|
public AcceptWithFallbackFeedIdStrategy()
public AcceptWithFallbackFeedIdStrategy(FeedIdStrategy fallback)
public String generate(Inventory inventory, Feed proposedFeed) throws EntityAlreadyExistsException
FeedIdStrategygenerate in interface FeedIdStrategyinventory - the inventory implementation to optionally consult some constraintsproposedFeed - the feed to be generated with the ID proposed by the callerEntityAlreadyExistsException - if a feed with the proposed ID exists and no alternatives can be proposed
by this strategy.Copyright © 2015 Red Hat, Inc.. All rights reserved.