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; }
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; }
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; }
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); } }
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); } }
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); }
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); }
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); }
@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"); } } }
@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"); } }
@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"); } }
@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"); } }
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); }
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); }
@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"); } }
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); }
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); }
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); }
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); }