1 /*******************************************************************************
2 * Copyright (c) 2007, 2014 Massimiliano Ziccardi
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 package it.jnrpe.server;
17
18 /**
19 * Holds the binding address informations.
20 *
21 * @author Massimiliano Ziccardi
22 */
23 class BindAddress {
24 /**
25 * <code>true</code> if SSL must be used.
26 */
27 private final boolean useSSL;
28
29 /**
30 * The binding IP or URL.
31 */
32 private final String bindingAddress;
33
34 /**
35 * Constructs the object.
36 *
37 * @param address The binding IP or URL
38 */
39 public BindAddress(final String address) {
40 bindingAddress = address;
41 useSSL = true;
42 }
43
44 /**
45 * Constructs the object.
46 *
47 * @param address The binding IP or URL
48 * @param ssl <code>true</code> if SSL must be used.
49 */
50 public BindAddress(final String address, final boolean ssl) {
51 bindingAddress = address;
52 useSSL = ssl;
53 }
54
55 /**
56 * @return the binding address/url
57 */
58 public String getBindingAddress() {
59 return bindingAddress;
60 }
61
62 /**
63 * @return <code>true</code> if SSL must be used
64 */
65 public boolean isSSL() {
66 return useSSL;
67 }
68 }