本文整理了Java中org.jdiameter.api.Message.getAvps()
方法的一些代码示例,展示了Message.getAvps()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getAvps()
方法的具体详情如下:
包路径:org.jdiameter.api.Message
类名称:Message
方法名:getAvps
暂无
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public DiameterAvp[] getAvps() {
DiameterAvp[] avps = new DiameterAvp[0];
try {
avps = getAvpsInternal(message.getAvps());
}
catch (Exception e) {
log.error("Failed to obtain/decode AVP/data.", e);
}
return avps;
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public void setAccountingRecordNumber(long recordNum) throws AvpDataException {
message.getAvps().removeAvp(Avp.ACC_RECORD_NUMBER);
message.getAvps().addAvp(Avp.ACC_RECORD_NUMBER, ACC_RECORD_NUMBER, true);
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-cca-common-ra
public Message createMessage(DiameterHeader header, DiameterAvp[] avps) throws AvpNotAllowedException {
Message msg = createRawMessage(header);
AvpSet set = msg.getAvps();
for (DiameterAvp avp : avps) {
addAvp(avp, set);
}
return msg;
}
代码示例来源:origin: org.mobicents.resources/restcomm-slee-ra-diameter-ro-ra
public Message createMessage(DiameterHeader header, DiameterAvp[] avps) throws AvpNotAllowedException {
Message msg = createRawMessage(header);
AvpSet set = msg.getAvps();
for (DiameterAvp avp : avps) {
addAvp(avp, set);
}
return msg;
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
public AccountAnswerImpl(Request request, int accountRecordType, int accReqNumber, long resultCode) {
this(request.createAnswer(resultCode));
try {
getMessage().getAvps().addAvp(Avp.ACC_RECORD_TYPE, accountRecordType);
getMessage().getAvps().addAvp(Avp.ACC_RECORD_NUMBER, accReqNumber);
}
catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
public RfAccountingAnswerImpl(Request request, int accountRecordType, int accReqNumber, long resultCode) {
super(request.createAnswer(resultCode));
try {
getMessage().getAvps().addAvp(Avp.ACC_RECORD_TYPE, accountRecordType);
getMessage().getAvps().addAvp(Avp.ACC_RECORD_NUMBER, accReqNumber);
}
catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public void setAuthApplicationIds(long[] authApplicationIds) {
DiameterAvp[] values = new DiameterAvp[authApplicationIds.length];
for(int index = 0; index < authApplicationIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.AUTH_APPLICATION_ID, authApplicationIds[index]);
}
super.message.getAvps().removeAvp(Avp.AUTH_APPLICATION_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public void setAcctApplicationIds(long[] acctApplicationIds) {
DiameterAvp[] values = new DiameterAvp[acctApplicationIds.length];
for(int index = 0; index < acctApplicationIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.ACCT_APPLICATION_ID, acctApplicationIds[index]);
}
super.message.getAvps().removeAvp(Avp.ACCT_APPLICATION_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public void setInbandSecurityIds(long[] inbandSecurityIds) {
DiameterAvp[] values = new DiameterAvp[inbandSecurityIds.length];
for(int index = 0; index < inbandSecurityIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.INBAND_SECURITY_ID, inbandSecurityIds[index]);
}
super.message.getAvps().removeAvp(Avp.INBAND_SECURITY_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public long getAccountingRecordNumber() throws AvpDataException {
Avp accRecordNumberAvp = message.getAvps().getAvp(ACC_RECORD_NUMBER);
if (accRecordNumberAvp != null) {
return accRecordNumberAvp.getUnsigned32();
}
else {
throw new AvpDataException("Avp ACC_RECORD_NUMBER not found");
}
}
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public int getAccountingRecordType() throws AvpDataException {
Avp accRecordTypeAvp = message.getAvps().getAvp(Avp.ACC_RECORD_TYPE);
if (accRecordTypeAvp != null) {
return accRecordTypeAvp.getInteger32();
}
else {
throw new AvpDataException("Avp ACC_RECORD_TYPE not found");
}
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public int getAccountingRecordType() throws AvpDataException {
Avp accRecordTypeAvp = message.getAvps().getAvp(Avp.ACC_RECORD_TYPE);
if (accRecordTypeAvp != null) {
return accRecordTypeAvp.getInteger32();
}
else {
throw new AvpDataException("Avp ACC_RECORD_TYPE not found");
}
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public long getAccountingRecordNumber() throws AvpDataException {
Avp accRecordNumberAvp = message.getAvps().getAvp(ACC_RECORD_NUMBER);
if (accRecordNumberAvp != null) {
return accRecordNumberAvp.getUnsigned32();
}
else {
throw new AvpDataException("Avp ACC_RECORD_NUMBER not found");
}
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public void setAcctApplicationIds(long[] acctApplicationIds) {
DiameterAvp[] values = new DiameterAvp[acctApplicationIds.length];
for(int index = 0; index < acctApplicationIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.ACCT_APPLICATION_ID, acctApplicationIds[index]);
}
super.message.getAvps().removeAvp(Avp.ACCT_APPLICATION_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public void setAuthApplicationIds(long[] authApplicationIds) {
DiameterAvp[] values = new DiameterAvp[authApplicationIds.length];
for(int index = 0; index < authApplicationIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.AUTH_APPLICATION_ID, authApplicationIds[index]);
}
super.message.getAvps().removeAvp(Avp.AUTH_APPLICATION_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.diameter/jdiameter-impl
@Override
public String getOriginHost() throws AvpDataException {
Avp originHostAvp = message.getAvps().getAvp(ORIGIN_HOST);
if (originHostAvp != null) {
return originHostAvp.getDiameterIdentity();
}
else {
throw new AvpDataException("Avp ORIGIN_HOST not found");
}
}
代码示例来源:origin: org.mobicents.servers.diameter.resources/base-common-events
public void setFailedAvps(FailedAvp[] failedAvps) {
DiameterAvp[] values = new DiameterAvp[failedAvps.length];
for(int index = 0; index < failedAvps.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.FAILED_AVP, failedAvps[index].getExtensionAvps());
}
this.message.getAvps().removeAvp(Avp.FAILED_AVP);
this.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public void setRouteRecords(DiameterIdentity[] routeRecords) {
DiameterAvp[] values = new DiameterAvp[routeRecords.length];
for(int index = 0; index < routeRecords.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.ROUTE_RECORD, routeRecords[index].toString());
}
this.message.getAvps().removeAvp(Avp.ROUTE_RECORD);
this.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public void setVendorSpecificApplicationIds(VendorSpecificApplicationIdAvp[] vendorSpecificApplicationIds) {
DiameterAvp[] values = new DiameterAvp[vendorSpecificApplicationIds.length];
for(int index = 0; index < vendorSpecificApplicationIds.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.VENDOR_SPECIFIC_APPLICATION_ID, vendorSpecificApplicationIds[index].getExtensionAvps());
}
super.message.getAvps().removeAvp(Avp.VENDOR_SPECIFIC_APPLICATION_ID);
super.setExtensionAvps(values);
}
代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-diameter-base-common-events
public void setFailedAvps(FailedAvp[] failedAvps) {
DiameterAvp[] values = new DiameterAvp[failedAvps.length];
for(int index = 0; index < failedAvps.length; index++) {
values[index] = AvpUtilities.createAvp(Avp.FAILED_AVP, failedAvps[index].getExtensionAvps());
}
this.message.getAvps().removeAvp(Avp.FAILED_AVP);
this.setExtensionAvps(values);
}
内容来源于网络,如有侵权,请联系作者删除!