/* * * 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 java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class VirtualHostConfigType extends ConfigObjectType { private static final List> VIRTUAL_HOST_PROPERTIES = new ArrayList>(); private static final VirtualHostConfigType INSTANCE = new VirtualHostConfigType(); public static interface VirtualHostProperty extends ConfigProperty { } private abstract static class VirtualHostReadWriteProperty extends ConfigProperty.ReadWriteConfigProperty implements VirtualHostProperty { public VirtualHostReadWriteProperty(String name) { super(name); VIRTUAL_HOST_PROPERTIES.add(this); } } private abstract static class VirtualHostReadOnlyProperty extends ConfigProperty.ReadOnlyConfigProperty implements VirtualHostProperty { public VirtualHostReadOnlyProperty(String name) { super(name); VIRTUAL_HOST_PROPERTIES.add(this); } } public static final VirtualHostReadOnlyProperty NAME_PROPERTY = new VirtualHostReadOnlyProperty("name") { public String getValue(VirtualHostConfig object) { return object.getName(); } }; public static final VirtualHostReadOnlyProperty BROKER_PROPERTY = new VirtualHostReadOnlyProperty("broker") { public BrokerConfig getValue(VirtualHostConfig object) { return object.getBroker(); } }; public static final VirtualHostReadOnlyProperty FEDERATION_TAG_PROPERTY = new VirtualHostReadOnlyProperty("federationTag") { public String getValue(VirtualHostConfig object) { return object.getFederationTag(); } }; public Collection> getProperties() { return Collections.unmodifiableList(VIRTUAL_HOST_PROPERTIES); } private VirtualHostConfigType() { } public static VirtualHostConfigType getInstance() { return INSTANCE; } }