@Override public Convention getConvention(final UniqueId identifier) { final ConventionDocument doc = _conventionMaster.getConvention(identifier); if (doc != null) { return doc.getValue(); } return null; }
@Override public Convention getConvention(final ExternalIdBundle identifiers) { final ConventionSearchResult result = _conventionMaster.searchConvention(new ConventionSearchRequest(identifiers)); final int size = result.getResults().size(); switch (size) { case 0: return null; case 1: return Iterables.getOnlyElement(result.getResults()).getValue(); default: throw new OpenGammaRuntimeException( "Multiple matches (" + size + ") to " + identifiers + "; expecting one"); } }