use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method sendUserDataAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#sendUserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer)
*/
public void sendUserDataAnswer(UserDataAnswer message) throws IOException {
try {
DiameterShMessageImpl msg = (DiameterShMessageImpl) message;
this.serverSession.sendUserDataAnswer(new UserDataAnswerImpl((Answer) msg.getGenericData()));
clean(msg);
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to send message.", e);
}
throw new IOException("Failed to send message, due to: " + e);
}
}
use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasDestinationRealmUDA.
@Test
public void hasDestinationRealmUDA() throws Exception {
UserDataAnswer uda = shServerFactory.createUserDataAnswer(shClientFactory.createUserDataRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", uda.getDestinationRealm());
}
use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasTFlagSetUDA.
@Test
public void hasTFlagSetUDA() throws Exception {
UserDataRequest udr = shClientFactory.createUserDataRequest();
((DiameterMessageImpl) udr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in User-Data-Request", udr.getHeader().isPotentiallyRetransmitted());
UserDataAnswer uda = shServerFactory.createUserDataAnswer(udr);
assertFalse("The 'T' flag should not be set in User-Data-Answer", uda.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasDestinationHostUDA.
@Test
public void hasDestinationHostUDA() throws Exception {
UserDataAnswer uda = shServerFactory.createUserDataAnswer(shClientFactory.createUserDataRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", uda.getDestinationHost());
}
use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method isExperimentalResultCorrectlySetUDA.
/**
* Test for Issue #665 (Diameter Experimental Result AVP is Nested)
* http://code.google.com/p/mobicents/issues/detail?id=655
*
* @throws Exception
*/
@Test
public void isExperimentalResultCorrectlySetUDA() throws Exception {
long originalValue = 5001;
UserDataAnswer uda = shServerFactory.createUserDataAnswer(shClientFactory.createUserDataRequest(), originalValue, true);
long obtainedValue = uda.getExperimentalResult().getExperimentalResultCode();
assertTrue("Experimental-Result-Code in UDA should be " + originalValue + " and is " + obtainedValue + ".", originalValue == obtainedValue);
}
Aggregations