com.ning.metrics.goodwill.access
Class CachingGoodwillAccessor

java.lang.Object
  extended by com.ning.metrics.goodwill.access.CachingGoodwillAccessor

public class CachingGoodwillAccessor
extends Object


Field Summary
protected  String host
           
protected static org.slf4j.Logger log
           
protected  int port
           
protected  String url
           
 
Constructor Summary
CachingGoodwillAccessor(String host, int port)
           
CachingGoodwillAccessor(String host, int port, int cacheTimeoutInSeconds)
           
 
Method Summary
 void close()
          Close the underlying http client
 GoodwillSchema getSchema(String schemaName)
          Given a schema name, get the associated GoodwillSchema.
 List<GoodwillSchema> getSchemata()
           
 void refreshSchemataCache()
          Invalidate and refresh the cache

This is blocking and returns when the cache has been updated

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.slf4j.Logger log

host

protected final String host

port

protected final int port

url

protected String url
Constructor Detail

CachingGoodwillAccessor

public CachingGoodwillAccessor(String host,
                               int port)

CachingGoodwillAccessor

public CachingGoodwillAccessor(String host,
                               int port,
                               int cacheTimeoutInSeconds)
Method Detail

refreshSchemataCache

public void refreshSchemataCache()
Invalidate and refresh the cache

This is blocking and returns when the cache has been updated


getSchema

public GoodwillSchema getSchema(String schemaName)
Given a schema name, get the associated GoodwillSchema. This method tries hard to find it, i.e. it will refresh the cache if the schema is not in the cache.

Parameters:
schemaName - name of the schema to find
Returns:
GoodwillSchema describing the schema

getSchemata

public List<GoodwillSchema> getSchemata()

close

public void close()
Close the underlying http client



Copyright © 2010-2011 Ning, Inc.. All Rights Reserved.