use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsUnsigned32.
public static long[] getAvpsAsUnsigned32(int avpCode, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode);
long[] values = new long[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getUnsigned32();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " as type Unsigned32.", e);
}
return new long[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsRaw.
public static byte[][] getAvpsAsRaw(int avpCode, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode);
byte[][] values = new byte[avpSet.size()][];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getRaw();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " as type Raw.", e);
}
return new byte[0][];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsUTF8String.
public static String[] getAvpsAsUTF8String(int avpCode, long vendorId, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode, vendorId);
String[] values = new String[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getUTF8String();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type UTF8String.", e);
}
return new String[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsInteger64.
public static long[] getAvpsAsInteger64(int avpCode, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode);
long[] values = new long[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getInteger64();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " as type Integer64.", e);
}
return new long[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsInteger64.
public static long[] getAvpsAsInteger64(int avpCode, long vendorId, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode, vendorId);
long[] values = new long[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getInteger64();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Integer64.", e);
}
return new long[0];
}
}
Aggregations