2 * Copyright 2005-2011 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.wamblee.xmlrouter.impl;
18 import org.wamblee.xmlrouter.common.Id;
19 import org.wamblee.xmlrouter.config.Config;
20 import org.wamblee.xmlrouter.config.DocumentType;
21 import org.wamblee.xmlrouter.config.Filter;
22 import org.wamblee.xmlrouter.config.RouterConfig;
23 import org.wamblee.xmlrouter.config.Transformation;
26 * Represents a single configuration set of a single configuration client of the
29 * @author Erik Brakkee
31 public class SingleRouterConfig implements ExtendedRouterConfig {
32 private Id<RouterConfig> id;
33 private ExtendedConfig<DocumentType> documentTypes;
34 private ExtendedConfig<Transformation> transformations;
35 private ExtendedConfig<Filter> filters;
38 * Constructs a router configuration.
40 * @param aSequenceNumberGenerator
41 * Sequence number generator to use.
43 public SingleRouterConfig(Id<RouterConfig> aId) {
45 documentTypes = new ConfigImpl<DocumentType>(new Id<Config>(
48 public DocumentType wrap(String aPrefix, DocumentType aT) {
49 return new RobustDocumentType(aPrefix, aT);
52 transformations = new ConfigImpl<Transformation>(new Id<Config>(
55 public Transformation wrap(String aPrefix,
56 Transformation aTransformation) {
57 return new RobustTransformation(aPrefix, aTransformation);
60 filters = new ConfigImpl<Filter>(new Id<Config>("filters")) {
62 public Filter wrap(String aPrefix, Filter aFilter) {
63 return new RobustFilter(aPrefix, aFilter);
70 public Id<RouterConfig> getId() {
75 public Config<DocumentType> documentTypeConfig() {
80 public Config<Transformation> transformationConfig() {
81 return transformations;
85 public Config<Filter> filterConfig() {