001/*
002 * Copyright 2012-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.devtools.autoconfigure;
018
019/**
020 * Configuration properties for remote Spring Boot applications.
021 *
022 * @author Phillip Webb
023 * @author Rob Winch
024 * @since 1.3.0
025 * @see DevToolsProperties
026 */
027public class RemoteDevToolsProperties {
028
029        public static final String DEFAULT_CONTEXT_PATH = "/.~~spring-boot!~";
030
031        public static final String DEFAULT_SECRET_HEADER_NAME = "X-AUTH-TOKEN";
032
033        /**
034         * Context path used to handle the remote connection.
035         */
036        private String contextPath = DEFAULT_CONTEXT_PATH;
037
038        /**
039         * A shared secret required to establish a connection (required to enable remote
040         * support).
041         */
042        private String secret;
043
044        /**
045         * HTTP header used to transfer the shared secret.
046         */
047        private String secretHeaderName = DEFAULT_SECRET_HEADER_NAME;
048
049        private Restart restart = new Restart();
050
051        private Proxy proxy = new Proxy();
052
053        public String getContextPath() {
054                return this.contextPath;
055        }
056
057        public void setContextPath(String contextPath) {
058                this.contextPath = contextPath;
059        }
060
061        public String getSecret() {
062                return this.secret;
063        }
064
065        public void setSecret(String secret) {
066                this.secret = secret;
067        }
068
069        public String getSecretHeaderName() {
070                return this.secretHeaderName;
071        }
072
073        public void setSecretHeaderName(String secretHeaderName) {
074                this.secretHeaderName = secretHeaderName;
075        }
076
077        public Restart getRestart() {
078                return this.restart;
079        }
080
081        public Proxy getProxy() {
082                return this.proxy;
083        }
084
085        public static class Restart {
086
087                /**
088                 * Whether to enable remote restart.
089                 */
090                private boolean enabled = true;
091
092                public boolean isEnabled() {
093                        return this.enabled;
094                }
095
096                public void setEnabled(boolean enabled) {
097                        this.enabled = enabled;
098                }
099
100        }
101
102        public static class Proxy {
103
104                /**
105                 * The host of the proxy to use to connect to the remote application.
106                 */
107                private String host;
108
109                /**
110                 * The port of the proxy to use to connect to the remote application.
111                 */
112                private Integer port;
113
114                public String getHost() {
115                        return this.host;
116                }
117
118                public void setHost(String host) {
119                        this.host = host;
120                }
121
122                public Integer getPort() {
123                        return this.port;
124                }
125
126                public void setPort(Integer port) {
127                        this.port = port;
128                }
129
130        }
131
132}