/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, 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.apache.qpid.server.configuration; import org.apache.qpid.server.exchange.ExchangeType; import java.util.*; public final class BridgeConfigType extends ConfigObjectType { private static final List> BRIDGE_PROPERTIES = new ArrayList>(); public static interface BridgeProperty extends ConfigProperty { } private abstract static class BridgeReadWriteProperty extends ConfigProperty.ReadWriteConfigProperty implements BridgeProperty { public BridgeReadWriteProperty(String name) { super(name); BRIDGE_PROPERTIES.add(this); } } private abstract static class BridgeReadOnlyProperty extends ConfigProperty.ReadOnlyConfigProperty implements BridgeProperty { public BridgeReadOnlyProperty(String name) { super(name); BRIDGE_PROPERTIES.add(this); } } public static final BridgeReadOnlyProperty LINK_PROPERTY = new BridgeReadOnlyProperty("link") { public LinkConfig getValue(BridgeConfig object) { return object.getLink(); } }; public static final BridgeReadOnlyProperty CHANNEL_ID_PROPERTY = new BridgeReadOnlyProperty("channelId") { public Integer getValue(BridgeConfig object) { return object.getChannelId(); } }; public static final BridgeReadOnlyProperty DURABLE_PROPERTY = new BridgeReadOnlyProperty("durable") { public Boolean getValue(BridgeConfig object) { return object.isDurable(); } }; public static final BridgeReadOnlyProperty SOURCE_PROPERTY = new BridgeReadOnlyProperty("source") { public String getValue(BridgeConfig object) { return object.getSource(); } }; public static final BridgeReadOnlyProperty DESTINATION_PROPERTY = new BridgeReadOnlyProperty("destination") { public String getValue(BridgeConfig object) { return object.getDestination(); } }; public static final BridgeReadOnlyProperty KEY_PROPERTY = new BridgeReadOnlyProperty("key") { public String getValue(BridgeConfig object) { return object.getKey(); } }; public static final BridgeReadOnlyProperty QUEUE_BRIDGE_PROPERTY = new BridgeReadOnlyProperty("queueBridge") { public Boolean getValue(BridgeConfig object) { return object.isQueueBridge(); } }; public static final BridgeReadOnlyProperty LOCAL_SOURCE_PROPERTY = new BridgeReadOnlyProperty("localSource") { public Boolean getValue(BridgeConfig object) { return object.isLocalSource(); } }; public static final BridgeReadOnlyProperty TAG_PROPERTY = new BridgeReadOnlyProperty("tag") { public String getValue(BridgeConfig object) { return object.getTag(); } }; public static final BridgeReadOnlyProperty EXCLUDES_PROPERTY = new BridgeReadOnlyProperty("excludes") { public String getValue(BridgeConfig object) { return object.getExcludes(); } }; public static final BridgeReadOnlyProperty DYNAMIC_PROPERTY = new BridgeReadOnlyProperty("dynamic") { public Boolean getValue(BridgeConfig object) { return object.isDynamic(); } }; public static final BridgeReadOnlyProperty ACK_BATCHING_PROPERTY = new BridgeReadOnlyProperty("ackBatching") { public Integer getValue(BridgeConfig object) { return object.getAckBatching(); } }; private static final BridgeConfigType INSTANCE = new BridgeConfigType(); private BridgeConfigType() { } public Collection> getProperties() { return Collections.unmodifiableList(BRIDGE_PROPERTIES); } public static BridgeConfigType getInstance() { return INSTANCE; } }