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

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

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

Message.getEndToEndIdentifier介绍

[英]The End-to-End Identifier is an unsigned 32-bit integer field (in network byte order) and is used to detect duplicate messages. Upon reboot implementations MAY set the high order 12 bits to contain the low order 12 bits of current time, and the low order 20 bits to a random value. Senders of request messages MUST insert a unique identifier on each message.
[中]端到端标识符是一个无符号32位整数字段(按网络字节顺序),用于检测重复消息。在重新启动时,可将高阶12位设置为包含当前时间的低阶12位,将低阶20位设置为随机值。请求消息的发件人必须在每条消息上插入唯一标识符。

代码示例

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

public long getEndToEndId() {
 return this.msg.getEndToEndIdentifier();
}

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

public long getEndToEndId() {
 return this.msg.getEndToEndIdentifier();
}

代码示例来源: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);
}

相关文章