@Override public Boolean visitMarketDataOverride(final MarketDataOverride marketDataOverride) { s_logger.debug("Removing {}", marketDataOverride); final MarketDataInjector injector = getViewClient().getViewClient().getLiveDataOverrideInjector(); if (marketDataOverride.getValueRequirement() != null) { injector.removeValue(marketDataOverride.getValueRequirement()); } else { injector.removeValue(marketDataOverride.getIdentifier(), marketDataOverride.getValueName()); } return Boolean.TRUE; }
@Override public Boolean visitMarketDataOverride(final MarketDataOverride marketDataOverride) { s_logger.debug("Applying {}", marketDataOverride); final MarketDataInjector injector = getViewClient().getViewClient().getLiveDataOverrideInjector(); Object value = marketDataOverride.getValue(); if (marketDataOverride.getOperation() != null) { switch (marketDataOverride.getOperation()) { case ADD: if (value instanceof Number) { value = new MarketDataAddOperation(((Number) value).doubleValue()); } else { throw new InvokeInvalidArgumentException( "Invalid ADD override - " + marketDataOverride.toString()); } break; case MULTIPLY: if (value instanceof Number) { value = new MarketDataMultiplyOperation(((Number) value).doubleValue()); } else { throw new InvokeInvalidArgumentException( "Invalid ADD override - " + marketDataOverride.toString()); } break; default: throw new UnsupportedOperationException(marketDataOverride.getOperation().toString()); } } if (marketDataOverride.getValueRequirement() != null) { injector.addValue(marketDataOverride.getValueRequirement(), value); } else { injector.addValue( marketDataOverride.getIdentifier(), marketDataOverride.getValueName(), value); } return Boolean.TRUE; }