if (snapshotMaster == null) {
throw new OpenGammaRuntimeException("MarketDataSnapshotMaster is missing from given Toolcontext");
}
MarketDataSnapshotSearchRequest request = new MarketDataSnapshotSearchRequest();
request.setName(snapshotOption);
MarketDataSnapshotSearchResult searchResult = snapshotMaster.search(request);
if (searchResult.getDocuments().isEmpty()) {
throw new OpenGammaRuntimeException("No matching snapshot for given name [" + marketDataOption + "]");
}
return new UserMarketDataSpecification(searchResult.getFirstDocument().getUniqueId());
}