本文整理了Java中org.apache.activemq.transport.tcp.QualityOfServiceUtils.adjustDSCPForECN
方法的一些代码示例,展示了QualityOfServiceUtils.adjustDSCPForECN
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QualityOfServiceUtils.adjustDSCPForECN
方法的具体详情如下:
包路径:org.apache.activemq.transport.tcp.QualityOfServiceUtils
类名称:QualityOfServiceUtils
方法名:adjustDSCPForECN
[英]The Differentiated Services values use only 6 of the 8 bits in the field in the TCP/IP packet header. Make sure any values the system has set for the other two bits (the ECN bits) are maintained.
[中]区分服务值仅使用TCP/IP数据包报头字段中8位中的6位。确保系统为其他两位(ECN位)设置的任何值都得到维护。
代码示例来源:origin: apache/activemq
/**
* @param value A potential value to be used for Differentiated Services.
* @return The corresponding Differentiated Services Code Point (DSCP).
* @throws IllegalArgumentException if the value does not correspond to a
* Differentiated Services Code Point or setting the DSCP is not
* supported.
*/
public static int getDSCP(String value) throws IllegalArgumentException {
int intValue = -1;
// Check the names first.
if (DIFF_SERV_NAMES.containsKey(value)) {
intValue = DIFF_SERV_NAMES.get(value);
} else {
try {
intValue = Integer.parseInt(value);
if (intValue > MAX_DIFF_SERV || intValue < MIN_DIFF_SERV) {
throw new IllegalArgumentException("Differentiated Services"
+ " value: " + intValue + " not in legal range ["
+ MIN_DIFF_SERV + ", " + MAX_DIFF_SERV + "].");
}
} catch (NumberFormatException e) {
// value must have been a malformed name.
throw new IllegalArgumentException("No such Differentiated "
+ "Services name: " + value);
}
}
return adjustDSCPForECN(intValue);
}
代码示例来源:origin: org.apache.activemq/activemq-client
/**
* @param value A potential value to be used for Differentiated Services.
* @return The corresponding Differentiated Services Code Point (DSCP).
* @throws IllegalArgumentException if the value does not correspond to a
* Differentiated Services Code Point or setting the DSCP is not
* supported.
*/
public static int getDSCP(String value) throws IllegalArgumentException {
int intValue = -1;
// Check the names first.
if (DIFF_SERV_NAMES.containsKey(value)) {
intValue = DIFF_SERV_NAMES.get(value);
} else {
try {
intValue = Integer.parseInt(value);
if (intValue > MAX_DIFF_SERV || intValue < MIN_DIFF_SERV) {
throw new IllegalArgumentException("Differentiated Services"
+ " value: " + intValue + " not in legal range ["
+ MIN_DIFF_SERV + ", " + MAX_DIFF_SERV + "].");
}
} catch (NumberFormatException e) {
// value must have been a malformed name.
throw new IllegalArgumentException("No such Differentiated "
+ "Services name: " + value);
}
}
return adjustDSCPForECN(intValue);
}
代码示例来源:origin: org.apache.activemq/activemq-all
/**
* @param value A potential value to be used for Differentiated Services.
* @return The corresponding Differentiated Services Code Point (DSCP).
* @throws IllegalArgumentException if the value does not correspond to a
* Differentiated Services Code Point or setting the DSCP is not
* supported.
*/
public static int getDSCP(String value) throws IllegalArgumentException {
int intValue = -1;
// Check the names first.
if (DIFF_SERV_NAMES.containsKey(value)) {
intValue = DIFF_SERV_NAMES.get(value);
} else {
try {
intValue = Integer.parseInt(value);
if (intValue > MAX_DIFF_SERV || intValue < MIN_DIFF_SERV) {
throw new IllegalArgumentException("Differentiated Services"
+ " value: " + intValue + " not in legal range ["
+ MIN_DIFF_SERV + ", " + MAX_DIFF_SERV + "].");
}
} catch (NumberFormatException e) {
// value must have been a malformed name.
throw new IllegalArgumentException("No such Differentiated "
+ "Services name: " + value);
}
}
return adjustDSCPForECN(intValue);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
/**
* @param value A potential value to be used for Differentiated Services.
* @return The corresponding Differentiated Services Code Point (DSCP).
* @throws IllegalArgumentException if the value does not correspond to a
* Differentiated Services Code Point or setting the DSCP is not
* supported.
*/
public static int getDSCP(String value) throws IllegalArgumentException {
int intValue = -1;
// Check the names first.
if (DIFF_SERV_NAMES.containsKey(value)) {
intValue = DIFF_SERV_NAMES.get(value);
} else {
try {
intValue = Integer.parseInt(value);
if (intValue > MAX_DIFF_SERV || intValue < MIN_DIFF_SERV) {
throw new IllegalArgumentException("Differentiated Services"
+ " value: " + intValue + " not in legal range ["
+ MIN_DIFF_SERV + ", " + MAX_DIFF_SERV + "].");
}
} catch (NumberFormatException e) {
// value must have been a malformed name.
throw new IllegalArgumentException("No such Differentiated "
+ "Services name: " + value);
}
}
return adjustDSCPForECN(intValue);
}
代码示例来源:origin: pierre/meteo
/**
* @param value A potential value to be used for Differentiated Services.
* @return The corresponding Differentiated Services Code Point (DSCP).
* @throws IllegalArgumentException if the value does not correspond to a
* Differentiated Services Code Point or setting the DSCP is not
* supported.
*/
public static int getDSCP(String value) throws IllegalArgumentException {
int intValue = -1;
// Check the names first.
if (DIFF_SERV_NAMES.containsKey(value)) {
intValue = DIFF_SERV_NAMES.get(value);
} else {
try {
intValue = Integer.parseInt(value);
if (intValue > MAX_DIFF_SERV || intValue < MIN_DIFF_SERV) {
throw new IllegalArgumentException("Differentiated Services"
+ " value: " + intValue + " not in legal range ["
+ MIN_DIFF_SERV + ", " + MAX_DIFF_SERV + "].");
}
} catch (NumberFormatException e) {
// value must have been a malformed name.
throw new IllegalArgumentException("No such Differentiated "
+ "Services name: " + value);
}
}
return adjustDSCPForECN(intValue);
}
内容来源于网络,如有侵权,请联系作者删除!