org.fudgemsg.taxon
Class URLTaxonomyResolver

java.lang.Object
  extended by org.fudgemsg.taxon.URLTaxonomyResolver
All Implemented Interfaces:
TaxonomyResolver
Direct Known Subclasses:
RESTfulTaxonomyResolver

public abstract class URLTaxonomyResolver
extends Object
implements TaxonomyResolver

A taxonomy resolver that retrieves a taxonomy from a URL.

A concrete implementation must specify how the URL is constructed. This resolver will cache the taxonomy objects.


Constructor Summary
protected URLTaxonomyResolver()
          Creates a new resolver.
 
Method Summary
protected abstract  URL createTaxonomyURL(short taxonomyId)
          Returns the URL that the taxonomy corresponding to the ID should be loaded from.
 void reset()
          Clears the resolver cache.
 FudgeTaxonomy resolveTaxonomy(short taxonomyId)
          Looks up the taxonomy by ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLTaxonomyResolver

protected URLTaxonomyResolver()
Creates a new resolver.

Method Detail

resolveTaxonomy

public FudgeTaxonomy resolveTaxonomy(short taxonomyId)
Description copied from interface: TaxonomyResolver
Looks up the taxonomy by ID.

Specified by:
resolveTaxonomy in interface TaxonomyResolver
Parameters:
taxonomyId - the ID of the taxonomy to look up
Returns:
the taxonomy, null if not found

createTaxonomyURL

protected abstract URL createTaxonomyURL(short taxonomyId)
                                  throws MalformedURLException
Returns the URL that the taxonomy corresponding to the ID should be loaded from.

Parameters:
taxonomyId - the taxonomy ID to locate
Returns:
the URL where the taxonomy is found, not null
Throws:
MalformedURLException - if there is a problem creating the URL, this will be wrapped into a runtime exception

reset

public void reset()
Clears the resolver cache.



Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0