Package com.opencloud.sentinel.multileg
Class HeadersByLeg
- java.lang.Object
-
- com.opencloud.sentinel.multileg.HeadersByLeg
-
public class HeadersByLeg extends java.lang.Object
Stores per-Leg header values. UseHeadersByLegCodec
when storing in a CMP field.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CELLULAR_NETWORK_INFO
static java.lang.String
OC_TERM_P_ACCESS_NETWORK_INFO
static java.lang.String
OC_TERM_P_VISITED_NETWORK_ID
static java.lang.String
P_ACCESS_NETWORK_INFO
static java.lang.String
P_CELLULAR_NETWORK_INFO
static java.lang.String
P_CHARGING_VECTOR
static java.lang.String
P_EARLY_MEDIA
static java.lang.String
P_VISITED_NETWORK_ID
-
Constructor Summary
Constructors Constructor Description HeadersByLeg()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeaderForLeg(java.lang.String legName, java.lang.String headerName, java.lang.String headerValue)
Add a header value to a particular leg, retaining existing values, if anyvoid
copyLegValues(java.lang.String fromLeg, java.lang.String toLeg)
Copies the headers associated with fromLeg and associates them with toLeg.java.lang.String
getHeaderValueForLeg(java.lang.String legName, java.lang.String headerName)
Get a leg's header value.java.util.List<java.lang.String>
getHeaderValuesForLeg(java.lang.String legName, java.lang.String headerName)
Get a leg's header values.void
setHeaderForLeg(java.lang.String legName, java.lang.String headerName, java.lang.String headerValue)
Set the header value for a particular leg.void
setHeadersForLeg(java.lang.String legName, java.lang.String headerName, java.lang.Iterable<java.lang.String> headerValues)
Set multiple header values for a particular leg.java.lang.String
toString()
-
-
-
Field Detail
-
P_ACCESS_NETWORK_INFO
public static final java.lang.String P_ACCESS_NETWORK_INFO
- See Also:
- Constant Field Values
-
OC_TERM_P_ACCESS_NETWORK_INFO
public static final java.lang.String OC_TERM_P_ACCESS_NETWORK_INFO
- See Also:
- Constant Field Values
-
P_CHARGING_VECTOR
public static final java.lang.String P_CHARGING_VECTOR
- See Also:
- Constant Field Values
-
P_VISITED_NETWORK_ID
public static final java.lang.String P_VISITED_NETWORK_ID
- See Also:
- Constant Field Values
-
OC_TERM_P_VISITED_NETWORK_ID
public static final java.lang.String OC_TERM_P_VISITED_NETWORK_ID
- See Also:
- Constant Field Values
-
CELLULAR_NETWORK_INFO
public static final java.lang.String CELLULAR_NETWORK_INFO
- See Also:
- Constant Field Values
-
P_CELLULAR_NETWORK_INFO
public static final java.lang.String P_CELLULAR_NETWORK_INFO
- See Also:
- Constant Field Values
-
P_EARLY_MEDIA
public static final java.lang.String P_EARLY_MEDIA
- See Also:
- Constant Field Values
-
-
Method Detail
-
setHeaderForLeg
public void setHeaderForLeg(java.lang.String legName, java.lang.String headerName, java.lang.String headerValue)
Set the header value for a particular leg. Replaces the existing header value, if any.- Parameters:
legName
- the leg name the header is associated withheaderName
- the header nameheaderValue
- the header value
-
setHeadersForLeg
public void setHeadersForLeg(java.lang.String legName, java.lang.String headerName, java.lang.Iterable<java.lang.String> headerValues)
Set multiple header values for a particular leg. Replaces the existing values, if any.- Parameters:
legName
- the leg name the header is associated withheaderName
- the header nameheaderValues
- the header values
-
addHeaderForLeg
public void addHeaderForLeg(java.lang.String legName, java.lang.String headerName, java.lang.String headerValue)
Add a header value to a particular leg, retaining existing values, if any- Parameters:
legName
- the leg name the header is associated withheaderName
- the header nameheaderValue
- the new header value
-
getHeaderValueForLeg
public java.lang.String getHeaderValueForLeg(java.lang.String legName, java.lang.String headerName)
Get a leg's header value.- Parameters:
legName
- the leg name the header is associated withheaderName
- the header name- Returns:
- the header value, or null if no header values have been set. If multiple header values are present, this method returns the first value that was added.
-
getHeaderValuesForLeg
public java.util.List<java.lang.String> getHeaderValuesForLeg(java.lang.String legName, java.lang.String headerName)
Get a leg's header values.- Parameters:
legName
- the leg name the header is associated withheaderName
- the header name- Returns:
- an immutable list of header values, empty if no header values have been set. Header values are returned in the order they were added.
-
copyLegValues
public void copyLegValues(java.lang.String fromLeg, java.lang.String toLeg)
Copies the headers associated with fromLeg and associates them with toLeg. Replaces existing values, if any.- Parameters:
fromLeg
- leg name to copy header values fromtoLeg
- leg name to copy header values to
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-