org.jdiameter.api.Message.getHopByHopIdentifier()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(243)

本文整理了Java中org.jdiameter.api.Message.getHopByHopIdentifier()方法的一些代码示例,展示了Message.getHopByHopIdentifier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getHopByHopIdentifier()方法的具体详情如下:
包路径:org.jdiameter.api.Message
类名称:Message
方法名:getHopByHopIdentifier

Message.getHopByHopIdentifier介绍

[英]The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in network byte order) and aids in matching requests and replies. The sender MUST ensure that the Hop-by-Hop identifier in a request is unique on a given connection at any given time, and MAY attempt to ensure that the number is unique across reboots.
[中]逐跳标识符是一个无符号32位整数字段(按网络字节顺序),有助于匹配请求和回复。发送方必须确保请求中的逐跳标识符在任何给定时间在给定连接上都是唯一的,并且可以尝试确保该号码在重新启动时是唯一的。

代码示例

代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events

public long getHopByHopId() {
 return this.msg.getHopByHopIdentifier();
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events

public long getHopByHopId() {
 return this.msg.getHopByHopIdentifier();
}

代码示例来源:origin: org.mobicents.diameter/jdiameter-impl

private String makeRoutingKey(Message message) {
 String sessionId = message.getSessionId();
 return new StringBuilder(sessionId != null ? sessionId : "null").append(message.getEndToEndIdentifier())
   .append(message.getHopByHopIdentifier()).toString();
}

代码示例来源:origin: org.mobicents.diameter/jdiameter-impl

@Override
public void sendCeaMessage(int resultCode, Message cer,  String errMessage) throws TransportException, OverloadException {
 logger.debug("Send CEA message");
 IMessage message = parser.createEmptyMessage(Message.CAPABILITIES_EXCHANGE_ANSWER, 0);
 message.setRequest(false);
 message.setHopByHopIdentifier(cer.getHopByHopIdentifier());
 message.setEndToEndIdentifier(cer.getEndToEndIdentifier());
 message.getAvps().addAvp(Avp.ORIGIN_HOST, metaData.getLocalPeer().getUri().getFQDN(), true, false, true);
 message.getAvps().addAvp(Avp.ORIGIN_REALM, metaData.getLocalPeer().getRealmName(), true, false, true);
 for (InetAddress ia : metaData.getLocalPeer().getIPAddresses()) {
  message.getAvps().addAvp(Avp.HOST_IP_ADDRESS, ia, true, false);
 }
 message.getAvps().addAvp(Avp.VENDOR_ID, metaData.getLocalPeer().getVendorId(), true, false, true);
 for (ApplicationId appId: metaData.getLocalPeer().getCommonApplications()) {
  addAppId(appId, message);
 }
 message.getAvps().addAvp(Avp.PRODUCT_NAME,  metaData.getLocalPeer().getProductName(), false);
 message.getAvps().addAvp(Avp.RESULT_CODE, resultCode, true, false, true);
 message.getAvps().addAvp(Avp.FIRMWARE_REVISION, metaData.getLocalPeer().getFirmware(), true);
 if (errMessage != null) {
  message.getAvps().addAvp(Avp.ERROR_MESSAGE, errMessage, false);
 }
 sendMessage(message);
}

相关文章