/**
 * Copyright 2015-2016 Red Hat, Inc, and individual contributors.
 *
 * Licensed 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.wildfly.swarm.spi.api;

/**
 * This class defines all system properties used by Swarm
 */
public class SwarmProperties {

    /**
     * Internal property
     */
    public static final String VERSION = "swarm.version";

    /**
     * Causes a deployed artifact to be dumped to disk when swarm starts, for debugging. Defaults to <code>false</code>
     */
    public static final String EXPORT_DEPLOYMENT = "swarm.export.deployment";

    /**
     * Internal property
     */
    public static final String BUILD_MODULES = "swarm.build.modules";

    /**
     * Internal property
     */
    public static final String BUILD_REPOS = "swarm.build.repos";

    /**
     * Internal property
     */
    public static final String EXPORT_UBERJAR = "swarm.export.uberjar";

    /**
     * Internal property
     */
    public static final String CURRENT_DEPLOYMENT = "swarm.current.deployment";

    /**
     * Internal property
     */
    public static final String NODE_ID = "swarm.node.id";

    /**
     * Sets a global port adjustment, defaults to 0
     */
    public static final String PORT_OFFSET = "swarm.port.offset";

    /**
     * Interface to bind servers, defaults to 0.0.0.0
     */
    public static final String BIND_ADDRESS = "swarm.bind.address";

    /**
     * Since introducing the delayed open HTTP listeners, it has been determined
     * that maybe it'd be useful to be able to eagerly open the listeners through usage of a property.
     * If non-<code>null</code>, will cause the http listeners to not be lazy.
     */
    public static final String HTTP_EAGER = "swarm.http.eager";

    /**
     * If provided, the swarm process will pause for debugging on the given port.
     * This option is only available when running an Arquillian test or mvn wildfly-swarm:run, not when executing java -jar.
     * The latter requires normal Java debug agent parameters.
     */
    public static final String DEBUG_PORT = "swarm.debug.port";

    /**
     * The environment this process is running on (eg. openshift)
     */
    public static final String ENVIRONMENT = "swarm.environment";

    /**
     * Activates a stage in project-stages.yml
     */
    public static final String PROJECT_STAGE = "swarm.project.stage";

    /**
     * Full qualified http address, i.e. 'http://localhost:8500/
     */
    public static final String CONSUL_URL = "swarm.consul.url";

    /**
     * Timeout, in seconds, to wait for a deployment to occur, defaults to 300
     */
    public static final String DEPLOYMENT_TIMEOUT = "swarm.deployment.timeout";
    
    /**
     * Formats a property as ${property}
     *
     * @param property the property to be formatted
     * @return the formatted value as ${property}
     */
    public static String propertyVar(final String property) {
        return String.format("${%s}", property);
    }

    /**
     * Formats a property as ${property:defaultValue}
     *
     * @param property     the property to be formatted
     * @param defaultValue
     * @return the formatted value as ${property:defaultValue}
     */
    public static String propertyVar(final String property, final String defaultValue) {
        return String.format("${%s:%s}", property, defaultValue);
    }

}


@@ -2240,24 +2240,430 @@
 tp.eager%22;%0A%0A
+    /**%0A     * Sets the HTTP port to be used, defaults to 8080%0A     */%0A    public static final String HTTP_PORT = %22swarm.http.port%22;%0A%0A    /**%0A     * Sets the HTTPS port to be used, defaults to 8443%0A     */%0A    public static final String HTTPS_PORT = %22swarm.https.port%22;%0A%0A    /**%0A     * The context path to be used, defaults to /%0A     */%0A    public static final String CONTEXT_PATH = %22swarm.context.path%22;%0A%0A
     /**%0A    
@@ -2993,32 +2993,193 @@
 m.debug.port%22;%0A%0A
+    /**%0A     * If provided, the swarm container will log bootstrap information%0A     */%0A    public static final String DEBUG_BOOTSTRAP= %22swarm.debug.bootstrap%22;%0A%0A
     /**%0A     * T

Add missing system properties