Skip to content

Commit 5ab7d24

Browse files
garyrussellartembilan
authored andcommitted
Make Headers PREFIX Constants Public
**cherry-pick to 5.0.x** * Make `IpHeaders` prefix as `public` as well
1 parent df6674c commit 5ab7d24

File tree

4 files changed

+40
-30
lines changed
  • spring-integration-file/src/main/java/org/springframework/integration/file
  • spring-integration-http/src/main/java/org/springframework/integration/http
  • spring-integration-ip/src/main/java/org/springframework/integration/ip
  • spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support

4 files changed

+40
-30
lines changed

spring-integration-file/src/main/java/org/springframework/integration/file/FileHeaders.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
*/
2727
public abstract class FileHeaders {
2828

29-
private static final String PREFIX = "file_";
29+
public static final String PREFIX = "file_";
3030

3131
public static final String FILENAME = PREFIX + "name";
3232

spring-integration-http/src/main/java/org/springframework/integration/http/HttpHeaders.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2010 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,11 +18,12 @@
1818

1919
/**
2020
* @author Mark Fisher
21+
* @author Gary Russell
2122
* @since 1.0.2
2223
*/
2324
public abstract class HttpHeaders {
2425

25-
private static final String PREFIX = "http_";
26+
public static final String PREFIX = "http_";
2627

2728
public static final String REQUEST_URL = PREFIX + "requestUrl";
2829

spring-integration-ip/src/main/java/org/springframework/integration/ip/IpHeaders.java

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,51 +23,53 @@
2323
* @author Gary Russell
2424
* @author Dave Syer
2525
* @author Artem Bilan
26+
*
2627
* @since 2.0
2728
*/
2829
public final class IpHeaders {
2930

30-
private static final String IP = "ip_";
31+
/**
32+
* The {@value IP_PREFIX} prefix for UDP and TCP headers.
33+
*/
34+
public static final String IP_PREFIX = "ip_";
3135

32-
private static final String TCP = IP + "tcp_";
36+
/**
37+
* The {@value TCP_PREFIX} prefix for TCP headers.
38+
*/
39+
private static final String TCP_PREFIX = IP_PREFIX + "tcp_";
3340

3441
/**
3542
* The host name from which a TCP message or UDP packet was received. If
3643
* {@code lookupHost} is {@code false}, this will contain the ip address.
3744
*/
38-
public static final String HOSTNAME = IP + "hostname";
45+
public static final String HOSTNAME = IP_PREFIX + "hostname";
3946

4047
/**
4148
* The ip address from which a TCP message or UDP packet was received.
4249
*/
43-
public static final String IP_ADDRESS = IP + "address";
50+
public static final String IP_ADDRESS = IP_PREFIX + "address";
4451

4552
/**
4653
* The remote port for a UDP packet.
4754
*/
48-
public static final String PORT = IP + "port";
55+
public static final String PORT = IP_PREFIX + "port";
4956

5057
/**
5158
* The remote address for a UDP packet.
5259
*/
53-
public static final String PACKET_ADDRESS = IP + "packetAddress";
60+
public static final String PACKET_ADDRESS = IP_PREFIX + "packetAddress";
5461

5562
/**
5663
* The remote ip address to which UDP application-level acks will be sent. The
5764
* framework includes acknowledgment information in the data packet.
5865
*/
59-
public static final String ACK_ADDRESS = IP + "ackTo";
66+
public static final String ACK_ADDRESS = IP_PREFIX + "ackTo";
6067

6168
/**
6269
* A correlation id for UDP application-level acks. The
6370
* framework includes acknowledgment information in the data packet.
6471
*/
65-
public static final String ACK_ID = IP + "ackId";
66-
67-
/**
68-
* The remote port from which a TCP message was received.
69-
*/
70-
public static final String REMOTE_PORT = TCP + "remotePort";
72+
public static final String ACK_ID = IP_PREFIX + "ackId";
7173

7274
/**
7375
* A unique identifier for a TCP connection; set by the framework for
@@ -76,19 +78,24 @@ public final class IpHeaders {
7678
* required so the endpoint can determine which connection to send
7779
* the message to.
7880
*/
79-
public static final String CONNECTION_ID = IP + "connectionId";
81+
public static final String CONNECTION_ID = IP_PREFIX + "connectionId";
8082

8183
/**
8284
* For information only - when using a cached or failover client connection
8385
* factory, contains the actual underlying connection id.
8486
*/
85-
public static final String ACTUAL_CONNECTION_ID = IP + "actualConnectionId";
87+
public static final String ACTUAL_CONNECTION_ID = IP_PREFIX + "actualConnectionId";
8688

8789
/**
8890
* The local address (InetAddress) that the socket is connected to.
8991
* @since 4.2.5.
9092
*/
91-
public static final String LOCAL_ADDRESS = IP + "localInetAddress";
93+
public static final String LOCAL_ADDRESS = IP_PREFIX + "localInetAddress";
94+
95+
/**
96+
* The remote port from which a TCP message was received.
97+
*/
98+
public static final String REMOTE_PORT = TCP_PREFIX + "remotePort";
9299

93100
private IpHeaders() { }
94101

spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/MqttHeaders.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,30 +18,32 @@
1818

1919
/**
2020
* Spring Integration headers.
21+
*
2122
* @author Gary Russell
2223
*
2324
* @since 4.0
2425
*
2526
*/
2627
public final class MqttHeaders {
2728

28-
private static final String prefix = "mqtt_";
29+
public static final String PREFIX = "mqtt_";
2930

30-
public static final String QOS = prefix + "qos";
31+
public static final String QOS = PREFIX + "qos";
3132

32-
public static final String RECEIVED_QOS = prefix + "receivedQos";
33+
public static final String RECEIVED_QOS = PREFIX + "receivedQos";
3334

34-
public static final String DUPLICATE = prefix + "duplicate";
35+
public static final String DUPLICATE = PREFIX + "duplicate";
3536

36-
public static final String RETAINED = prefix + "retained";
37+
public static final String RETAINED = PREFIX + "retained";
3738

38-
public static final String RECEIVED_RETAINED = prefix + "receivedRetained";
39+
public static final String RECEIVED_RETAINED = PREFIX + "receivedRetained";
3940

40-
public static final String TOPIC = prefix + "topic";
41+
public static final String TOPIC = PREFIX + "topic";
4142

42-
public static final String RECEIVED_TOPIC = prefix + "receivedTopic";
43+
public static final String RECEIVED_TOPIC = PREFIX + "receivedTopic";
4344

4445
private MqttHeaders() {
4546
throw new AssertionError();
4647
}
48+
4749
}

0 commit comments

Comments
 (0)