X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=config%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fconfig%2FConfig.java;h=b12210b1b841a5ac52af7dec6cdcd9a1607eea67;hb=061b09796a129759566d98b03616ff26344eb045;hp=940b34622fcdd3d454c683cba5e083fca59ad6db;hpb=f7f3bbbc63a9e177f56064d821dc5f502dee378e;p=xmlrouter diff --git a/config/src/main/java/org/wamblee/xmlrouter/config/Config.java b/config/src/main/java/org/wamblee/xmlrouter/config/Config.java index 940b346..b12210b 100644 --- a/config/src/main/java/org/wamblee/xmlrouter/config/Config.java +++ b/config/src/main/java/org/wamblee/xmlrouter/config/Config.java @@ -15,33 +15,42 @@ */ package org.wamblee.xmlrouter.config; -import java.util.Collection; +import java.util.List; import org.wamblee.xmlrouter.common.Id; /** - * Configuration API for the XML router. + * Interface for managing a set of configuration items of a given type with + * unique ids. * * @author Erik Brakkee + * + * @param + * Type for which ids are generated. */ -public interface Config { - - Id addDocumentType(DocumentType aType); - - void removeDocumentType(Id aId); - - Collection getDocumentTypes(); - - Id addTransformation(Transformation aTransformation); - - void removeTransformation(Id aId); - - Collection getTransformations(); - - Id addFilter(Filter aFilter); - - void removeFilter(Id aId); - - Collection getFilters(); - -} +public interface Config extends Identifiable { + + // TODO define what happens when there is a duplicate item. + + /** + * Adds an item. No item with the same id may exist. + * + * @param aT + * item + */ + void add(T aT); + + /** + * Removes the item with a given id. + * + * @param aId + * Item id. + * @return true iff the item was removed. + */ + boolean remove(Id aId); + + /** + * @return All available items. + */ + List values(); +} \ No newline at end of file