X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=config%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fconfig%2FConfig.java;h=e825f9fc1d29b3bf77c9e673e5ea6c91f992eb2c;hb=03a6b404471945aed9d48fc1e5b8447b4a9d9413;hp=9ecdcfed5c4f2e7701ae6e2caf146166d29bc54a;hpb=7ace7a8cf3173112717904aa825a7481dd0804e8;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 9ecdcfe..e825f9f 100644 --- a/config/src/main/java/org/wamblee/xmlrouter/config/Config.java +++ b/config/src/main/java/org/wamblee/xmlrouter/config/Config.java @@ -12,36 +12,44 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ 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 { + /** + * Adds an item. No item with the same id may exist. + * + * @param aT + * item + * @throws DuplicateException + * In case an object with the same id already exists. + */ + 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