use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsUnsigned64.
public static long[] getAvpsAsUnsigned64(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.getUnsigned64();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Unsigned64.", e);
}
return new long[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsFloat32.
public static float[] getAvpsAsFloat32(int avpCode, long vendorId, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode, vendorId);
float[] values = new float[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getFloat32();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Float32.", e);
}
return new float[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsFloat64.
public static double[] getAvpsAsFloat64(int avpCode, long vendorId, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode, vendorId);
double[] values = new double[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getFloat32();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Float64.", e);
}
return new double[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsFloat64.
public static double[] getAvpsAsFloat64(int avpCode, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode);
double[] values = new double[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getFloat32();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " as type Float64.", e);
}
return new double[0];
}
}
use of org.jdiameter.api.AvpDataException in project jain-slee.diameter by RestComm.
the class AvpUtilities method getAvpsAsTime.
public static Date[] getAvpsAsTime(int avpCode, long vendorId, AvpSet set) {
try {
AvpSet avpSet = set.getAvps(avpCode, vendorId);
Date[] values = new Date[avpSet.size()];
int i = 0;
for (Avp avp : avpSet) {
values[i++] = avp.getTime();
}
return values;
} catch (AvpDataException e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Float64.", e);
}
return new Date[0];
}
}
Aggregations