if (master == null) {
throw new IllegalStateException("Execution context does not contain a " + OpenGammaExecutionContext.CONFIG_MASTER_NAME);
}
final ConfigSearchRequest<ViewDefinition> request = new ConfigSearchRequest<ViewDefinition>(ViewDefinition.class);
request.setName(name);
final ConfigSearchResult<ViewDefinition> result = master.search(request);
if (result.getDocuments() != null) {
for (final ConfigDocument document : result.getDocuments()) {
if (viewDefinition.equals(document.getValue().getValue())) {
// Found a matching one
s_logger.debug("Using previous view definition {}", document.getUniqueId());