org.schemarepo.client
Class RESTRepositoryClient

java.lang.Object
  extended by org.schemarepo.BaseRepository
      extended by org.schemarepo.client.RESTRepositoryClient
All Implemented Interfaces:
Closeable, RepositoryClient, Repository

public class RESTRepositoryClient
extends BaseRepository
implements RepositoryClient

An Implementation of Repository that connects to a remote RESTRepository over HTTP.

Typically, this is used in a client wrapped in a CacheRepository to limit network communication.

Alternatively, this implementation can itself be what is used behind a RESTRepository in a RepositoryServer, thus creating a caching proxy. Note:This implementation diverges from the original AVRO-1124 issue

See Also:
Avro1124RESTRepositoryClient

Field Summary
 
Fields inherited from class org.schemarepo.BaseRepository
closed
 
Constructor Summary
RESTRepositoryClient(String url, JsonUtil jsonUtil, boolean returnNoneOnExceptions)
           
 
Method Summary
protected  Map<String,String> exposeConfiguration()
           
 Properties getConfiguration(boolean includeDefaults)
           
 String getStatus()
          Return status information about the repository, such as whether it's healthy.
 Subject lookup(String subject)
           
 Subject register(String subject, SubjectConfig config)
           
 Iterable<Subject> subjects()
           
 
Methods inherited from class org.schemarepo.BaseRepository
close, isValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

RESTRepositoryClient

@Inject
public RESTRepositoryClient(@Named(value="schema-repo.rest-client.server-url")
                                   String url,
                                   @Named(value="schema-repo.json.util-implementation")
                                   JsonUtil jsonUtil,
                                   @Named(value="schema-repo.rest-client.return-none-on-exceptions")
                                   boolean returnNoneOnExceptions)
Method Detail

register

public Subject register(String subject,
                        SubjectConfig config)
Specified by:
register in interface Repository

lookup

public Subject lookup(String subject)
Specified by:
lookup in interface Repository

subjects

public Iterable<Subject> subjects()
Specified by:
subjects in interface Repository

getStatus

public String getStatus()
Description copied from interface: RepositoryClient
Return status information about the repository, such as whether it's healthy. Details such as "what" and "representation" are up to the implementing classes.

Specified by:
getStatus in interface RepositoryClient
Returns:
String representation of repository status

getConfiguration

public Properties getConfiguration(boolean includeDefaults)

exposeConfiguration

protected Map<String,String> exposeConfiguration()
Overrides:
exposeConfiguration in class BaseRepository


Copyright © 2015. All rights reserved.