|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.schemarepo.Subject
org.schemarepo.DelegatingSubject
public abstract class DelegatingSubject
A DelegatingSubject is a Subject that delegates work to an underlying
Subject.
Specific implementations may override various methods.
| Constructor Summary | |
|---|---|
protected |
DelegatingSubject(Subject delegate)
A DelegatingSubject delegates work to a provided Subject. |
| Method Summary | |
|---|---|
Iterable<SchemaEntry> |
allEntries()
List the ids of schemas registered with the given subject, ordered from most recent to oldest. |
SubjectConfig |
getConfig()
|
boolean |
integralKeys()
Indicates whether the keys generated by this subject can be expected to parse as an integer. |
SchemaEntry |
latest()
Lookup the most recently registered schema for the given subject. |
SchemaEntry |
lookupById(String id)
Lookup the SchemaEntry for the given subject by id. |
SchemaEntry |
lookupBySchema(String schema)
Lookup the SchemaEntry for the given schema. |
SchemaEntry |
register(String schema)
If the provided schema has already been registered in this subject, return the id. |
SchemaEntry |
registerIfLatest(String schema,
SchemaEntry latest)
Register the provided schema only if the current latest schema matches the provided latest entry. |
| Methods inherited from class org.schemarepo.Subject |
|---|
cacheWith, getName, readOnly, toString, validatingSubject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected DelegatingSubject(Subject delegate)
DelegatingSubject delegates work to a provided Subject.
| Method Detail |
|---|
public SchemaEntry register(String schema)
throws SchemaValidationException
SubjectSchemaEntry result and succeed.
register in class Subjectschema - The schema to register
SchemaValidationException - If the schema change is not valid according the validation rules
of the subject
public SchemaEntry registerIfLatest(String schema,
SchemaEntry latest)
throws SchemaValidationException
Subject
registerIfLatest in class Subjectschema - The schema to registerlatest - the entry that must match the current actual latest value in order
to register this schema.
SchemaValidationException - If the schema change is not valid according the validation rules
of the subjectpublic SchemaEntry lookupBySchema(String schema)
SubjectSchemaEntry for the given schema. Since the mapping of
schema to id is immutable, this result can be cached.
lookupBySchema in class Subjectschema - The schema to look up
public SchemaEntry lookupById(String id)
SubjectSchemaEntry for the given subject by id. Since the
mapping of schema to id is immutable the result can be cached.
lookupById in class Subjectid - the id of the schema to look up
public SchemaEntry latest()
Subject
latest in class SubjectSchemaEntry or null if no schema is registered with
this subjectpublic Iterable<SchemaEntry> allEntries()
SubjectSchemaEntry in the subject may grow over time.
allEntries in class SubjectSchemaEntry objects in this subject, ordered from most
recent to oldest.public SubjectConfig getConfig()
getConfig in class SubjectSubjectConfig for this Subjectpublic boolean integralKeys()
Subject
integralKeys in class Subject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||