19
19
20
20
package org .elasticsearch .http ;
21
21
22
- import org .apache .logging .log4j .LogManager ;
23
22
import org .elasticsearch .common .io .stream .StreamInput ;
24
23
import org .elasticsearch .common .io .stream .StreamOutput ;
25
24
import org .elasticsearch .common .io .stream .Writeable ;
26
- import org .elasticsearch .common .logging .DeprecationLogger ;
27
25
import org .elasticsearch .common .network .InetAddresses ;
28
26
import org .elasticsearch .common .transport .BoundTransportAddress ;
29
27
import org .elasticsearch .common .transport .TransportAddress ;
33
31
34
32
import java .io .IOException ;
35
33
36
- import static org .elasticsearch .common .Booleans .parseBoolean ;
37
-
38
34
public class HttpInfo implements Writeable , ToXContentFragment {
39
35
40
- private static final DeprecationLogger deprecationLogger = new DeprecationLogger (LogManager .getLogger (HttpInfo .class ));
41
-
42
- /** Whether to add hostname to publish host field when serializing. */
43
- private static final boolean CNAME_IN_PUBLISH_HOST =
44
- parseBoolean (System .getProperty ("es.http.cname_in_publish_address" ), true );
45
-
46
36
private final BoundTransportAddress address ;
47
37
private final long maxContentLength ;
48
- private final boolean cnameInPublishHostProperty ;
49
38
50
39
public HttpInfo (StreamInput in ) throws IOException {
51
- this (new BoundTransportAddress (in ), in .readLong (), CNAME_IN_PUBLISH_HOST );
40
+ this (new BoundTransportAddress (in ), in .readLong ());
52
41
}
53
42
54
43
public HttpInfo (BoundTransportAddress address , long maxContentLength ) {
55
- this (address , maxContentLength , CNAME_IN_PUBLISH_HOST );
56
- }
57
-
58
- HttpInfo (BoundTransportAddress address , long maxContentLength , boolean cnameInPublishHostProperty ) {
59
44
this .address = address ;
60
45
this .maxContentLength = maxContentLength ;
61
- this .cnameInPublishHostProperty = cnameInPublishHostProperty ;
62
46
}
63
47
64
48
@ Override
@@ -84,12 +68,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
84
68
String hostString = publishAddress .address ().getHostString ();
85
69
if (InetAddresses .isInetAddress (hostString ) == false ) {
86
70
publishAddressString = hostString + '/' + publishAddress .toString ();
87
- if (cnameInPublishHostProperty ) {
88
- deprecationLogger .deprecated (
89
- "es.http.cname_in_publish_address system property is deprecated and no longer affects http.publish_address " +
90
- "formatting. Remove this property to get rid of this deprecation warning."
91
- );
92
- }
93
71
}
94
72
builder .field (Fields .PUBLISH_ADDRESS , publishAddressString );
95
73
builder .humanReadableField (Fields .MAX_CONTENT_LENGTH_IN_BYTES , Fields .MAX_CONTENT_LENGTH , maxContentLength ());
0 commit comments