org.schemarepo
Interface Repository

All Superinterfaces:
Closeable
All Known Implementing Classes:
AbstractBackendRepository, BaseRepository, CacheRepository, DelegatingRepository, InMemoryRepository, LocalFileSystemRepository, ReadOnlyRepository

public interface Repository
extends Closeable

A Repository is a collection of Subjects. A Subject can be looked up by name on a Repository, or registered.

Registration of a Subject in a Repository is done via register(String, SubjectConfig), which requires the subject name and its configuration. The configuration is a map of configuration keys to configuration values, both of which are Strings.


Method Summary
 Subject lookup(String subjectName)
          Returns the subject if it exists, null otherwise.
 Subject register(String subjectName, SubjectConfig config)
          Attempt to create a Subject with the given name and validator.
 Iterable<Subject> subjects()
          List all subjects.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

register

Subject register(String subjectName,
                 SubjectConfig config)
Attempt to create a Subject with the given name and validator.

Parameters:
subjectName - The name of the subject. Must not be null.
config - The subject configuration. May be null.
Returns:
The newly created Subject, or an equivalent one if already created. Does not return null.
Throws:
NullPointerException - if subjectName is null

lookup

Subject lookup(String subjectName)
Returns the subject if it exists, null otherwise.

Parameters:
subjectName - the subject name
Returns:
The subject if it exists, null otherwise.

subjects

Iterable<Subject> subjects()
List all subjects. Does not return null.



Copyright © 2015. All rights reserved.