org.apache.brooklyn.entity.webapp.WebAppServiceConstants Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-software-webapp Show documentation
Show all versions of brooklyn-software-webapp Show documentation
Brooklyn entities for Web App 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 org.apache.brooklyn.entity.webapp;
import java.util.Set;
import org.apache.brooklyn.api.sensor.AttributeSensor;
import org.apache.brooklyn.core.config.render.RendererHints;
import org.apache.brooklyn.core.entity.Attributes;
import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
import org.apache.brooklyn.core.sensor.Sensors;
import org.apache.brooklyn.util.core.flags.SetFromFlag;
import com.google.common.collect.ImmutableSet;
public interface WebAppServiceConstants extends WebAppServiceMetrics {
@SetFromFlag("httpPort")
public static final PortAttributeSensorAndConfigKey HTTP_PORT = Attributes.HTTP_PORT;
@SetFromFlag("httpsPort")
public static final PortAttributeSensorAndConfigKey HTTPS_PORT = Attributes.HTTPS_PORT;
@SuppressWarnings({ "unchecked", "rawtypes" })
@SetFromFlag("enabledProtocols")
public static final BasicAttributeSensorAndConfigKey> ENABLED_PROTOCOLS = new BasicAttributeSensorAndConfigKey(
Set.class, "webapp.enabledProtocols", "List of enabled protocols (e.g. http, https)", ImmutableSet.of("http"));
@SetFromFlag("httpsSsl")
public static final BasicAttributeSensorAndConfigKey HTTPS_SSL_CONFIG = new BasicAttributeSensorAndConfigKey(
HttpsSslConfig.class, "webapp.https.ssl", "SSL Configuration for HTTPS", null);
public static final AttributeSensor ROOT_URL = RootUrl.ROOT_URL;
}
// this class is added because the ROOT_URL relies on a static initialization which unfortunately can't be added to an interface.
class RootUrl {
public static final AttributeSensor ROOT_URL = Sensors.newStringSensor("webapp.url", "URL");
static {
RendererHints.register(ROOT_URL, RendererHints.namedActionWithUrl());
}
}