org.schemarepo
Class BaseRepository

java.lang.Object
  extended by org.schemarepo.BaseRepository
All Implemented Interfaces:
Closeable, Repository
Direct Known Subclasses:
AbstractBackendRepository, DelegatingRepository

public abstract class BaseRepository
extends Object
implements Repository

Base class for all repository implementations.


Field Summary
protected  boolean closed
           
protected  org.slf4j.Logger logger
           
 
Constructor Summary
BaseRepository()
           
 
Method Summary
 void close()
           
protected  Map<String,String> exposeConfiguration()
          Expose certain configuration elements as properties.
 void isValid()
          Asserts the repository is in a valid state (for ex.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.schemarepo.Repository
lookup, register, subjects
 

Field Detail

logger

protected org.slf4j.Logger logger

closed

protected boolean closed
Constructor Detail

BaseRepository

public BaseRepository()
Method Detail

isValid

public void isValid()
Asserts the repository is in a valid state (for ex. not closed).

Throws:
IllegalStateException - if the repository is NOT in a valid state

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

exposeConfiguration

protected Map<String,String> exposeConfiguration()
Expose certain configuration elements as properties. This can be used to construct a useful toString() response, for ex.

Remember to call

super
when overriding!

Returns:
Map representing properties; note that the actual implementation may be immutable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All rights reserved.