com.ning.metrics.goodwill.access
Class GoodwillAccessor

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

public class GoodwillAccessor
extends Object


Field Summary
protected  com.ning.http.client.AsyncHttpClient client
           
protected  String host
           
protected static org.slf4j.Logger log
           
protected static org.codehaus.jackson.map.ObjectMapper mapper
           
protected  int port
           
protected  String url
           
 
Constructor Summary
GoodwillAccessor(String host, int port)
           
 
Method Summary
 void close()
          Close the underlying http client
protected  void closeStream(InputStream in)
           
 Future<GoodwillSchema> getSchema(String schemaName)
          Get the Goodwill schema associated to a schema name.
 Future<List<GoodwillSchema>> getSchemata()
          Get all schemata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapper

protected static final org.codehaus.jackson.map.ObjectMapper mapper

client

protected com.ning.http.client.AsyncHttpClient client

log

protected static final org.slf4j.Logger log

host

protected final String host

port

protected final int port

url

protected String url
Constructor Detail

GoodwillAccessor

public GoodwillAccessor(String host,
                        int port)
Method Detail

getSchema

public Future<GoodwillSchema> getSchema(String schemaName)
Get the Goodwill schema associated to a schema name.

Typical invocation:
 try {
   GoodwillSchema type = accessor.getSchema("test").get();
 ...
 }
 catch (Exception e) {
   // Connection exception? Goodwill server down?
 }
 

Parameters:
schemaName - schema name to lookup
Returns:
a future on the Schema

getSchemata

public Future<List<GoodwillSchema>> getSchemata()
Get all schemata.

Use schemata, instead of schemas, which is closer to the original σχήματα.

Returns:
a future on a list of Schema
See Also:
for an invocation example

close

public void close()
Close the underlying http client


closeStream

protected final void closeStream(InputStream in)


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