brooklyn.entity.network.bind.BindDnsServer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-software-network Show documentation
Show all versions of brooklyn-software-network Show documentation
Brooklyn entities for network service software processes
/*
* 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 brooklyn.entity.network.bind;
import java.util.Map;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Multimap;
import com.google.common.reflect.TypeToken;
import brooklyn.catalog.Catalog;
import brooklyn.config.ConfigKey;
import brooklyn.entity.Entity;
import brooklyn.entity.annotation.Effector;
import brooklyn.entity.basic.ConfigKeys;
import brooklyn.entity.basic.DynamicGroup;
import brooklyn.entity.basic.SoftwareProcess;
import brooklyn.entity.proxying.ImplementedBy;
import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
import brooklyn.event.basic.Sensors;
import brooklyn.location.basic.PortRanges;
import brooklyn.util.flags.SetFromFlag;
import brooklyn.util.net.Cidr;
/**
* This sets up a BIND DNS server.
*/
@Catalog(name="BIND", description="BIND is an Internet Domain Name Server.", iconUrl="classpath:///isc-logo.png")
@ImplementedBy(BindDnsServerImpl.class)
public interface BindDnsServer extends SoftwareProcess {
@SetFromFlag("filter")
ConfigKey> ENTITY_FILTER = ConfigKeys.newConfigKey(new TypeToken>() {},
"bind.entity.filter", "Filter for entities which will use the BIND DNS service for name resolution." +
"Default is all instances of SoftwareProcess in the application.",
Predicates.instanceOf(SoftwareProcess.class));
@SetFromFlag("domainName")
ConfigKey DOMAIN_NAME = ConfigKeys.newStringConfigKey(
"bind.domain.name", "The DNS domain name to serve", "brooklyn.local");
@SetFromFlag("reverseLookupNetwork")
ConfigKey REVERSE_LOOKUP_NETWORK = ConfigKeys.newStringConfigKey(
"bind.reverse-lookup.address", "Network address for reverse lookup zone");
@SetFromFlag("subnet")
ConfigKey MANAGEMENT_CIDR = ConfigKeys.newStringConfigKey(
"bind.access.cidr", "Subnet CIDR or ACL allowed to access DNS", "0.0.0.0/0");
@SetFromFlag("hostnameSensor")
ConfigKey> HOSTNAME_SENSOR = ConfigKeys.newConfigKey(new TypeToken>() {},
"bind.sensor.hostname", "Sensor on managed entities that reports the hostname");
PortAttributeSensorAndConfigKey DNS_PORT =
new PortAttributeSensorAndConfigKey("bind.port", "BIND DNS port for TCP and UDP", PortRanges.fromString("53"));
@SetFromFlag("zoneFileTemplate")
ConfigKey DOMAIN_ZONE_FILE_TEMPLATE = ConfigKeys.newStringConfigKey(
"bind.template.domain-zone", "The BIND domain zone file to serve (as FreeMarker template)",
"classpath://brooklyn/entity/network/bind/domain.zone");
@SetFromFlag("reverseZoneFileTemplate")
ConfigKey REVERSE_ZONE_FILE_TEMPLATE = ConfigKeys.newStringConfigKey(
"bind.template.reverse-zone", "The BIND reverse lookup zone file to serve (as FreeMarker template)",
"classpath://brooklyn/entity/network/bind/reverse.zone");
@SetFromFlag("namedConfTemplate")
ConfigKey NAMED_CONF_TEMPLATE = ConfigKeys.newStringConfigKey(
"bind.template.named-conf", "The BIND named configuration file (as FreeMarker template)",
"classpath://brooklyn/entity/network/bind/named.conf");
@SetFromFlag("updateRootZonesFile")
ConfigKey UPDATE_ROOT_ZONES_FILE = ConfigKeys.newBooleanConfigKey(
"bind.updateRootZones", "Instructs the entity to fetch the latest root zones file from ftp.rs.internic.net.",
Boolean.FALSE);
/* Reverse lookup attributes. */
AttributeSensor REVERSE_LOOKUP_CIDR = Sensors.newSensor(Cidr.class,
"bind.reverse-lookup.cidr", "The network CIDR that hosts must have for reverse lookup entries " +
"to be added (default uses server address /24)");
AttributeSensor REVERSE_LOOKUP_DOMAIN = Sensors.newStringSensor(
"bind.reverse-lookup.domain", "The in-addr.arpa reverse lookup domain name");
/* Configuration applicable to clients of the BIND DNS service. */
@SetFromFlag("replaceResolvConf")
ConfigKey REPLACE_RESOLV_CONF = ConfigKeys.newBooleanConfigKey(
"bind.resolv-conf.replce", "Set to replace resolv.conf with the template (default is to use eth0 script)", Boolean.FALSE);
@SetFromFlag("interfaceConfigTemplate")
ConfigKey INTERFACE_CONFIG_TEMPLATE = ConfigKeys.newStringConfigKey(
"bind.template.interface-cfg", "The network interface configuration file for clients (as FreeMarker template)",
"classpath://brooklyn/entity/network/bind/ifcfg");
@SetFromFlag("interfaceConfigTemplate")
ConfigKey RESOLV_CONF_TEMPLATE = ConfigKeys.newStringConfigKey(
"bind.template.resolv-conf", "The resolver configuration file for clients (as FreeMarker template)",
"classpath://brooklyn/entity/network/bind/resolv.conf");
AttributeSensor ENTITIES = Sensors.newSensor(DynamicGroup.class,
"bind.entities", "The entities being managed by this server");
AttributeSensor> ADDRESS_MAPPINGS = Sensors.newSensor(new TypeToken>() {},
"bind.mappings", "All address mappings maintained by the server, in form address -> [names]");
AttributeSensor