X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=config%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Fconfig%2FConfig.java;h=b90b34c4bfb58a0739d760d0b545a139bf19df0c;hb=b2375f35a2f897e1417e8b5ec5b19b3257a11586;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..b90b34c 100644 --- a/config/src/main/java/org/wamblee/xmlrouter/config/Config.java +++ b/config/src/main/java/org/wamblee/xmlrouter/config/Config.java @@ -12,7 +12,7 @@ * 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; @@ -20,28 +20,46 @@ import java.util.Collection; import org.wamblee.xmlrouter.common.Id; /** - * Configuration API for the XML router. + * Basic configuration 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); +public interface Config { - Collection getTransformations(); + /** + * Adds a item + * + * @param aT + * item + * @return Unique id. + */ + Id add(T aT); - Id addFilter(Filter aFilter); + /** + * Removes the item with a given id. + * + * @param aId + * Item id. + * @return true iff the item was removed. + */ + boolean remove(Id aId); - void removeFilter(Id aId); + /** + * @return All available ids. + */ + Collection> ids(); - Collection getFilters(); + /** + * Gets the item for the given id. + * + * @param aId + * Item id. + * @return Item, or null if not found. + */ + T get(Id aId); -} +} \ No newline at end of file