use of net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer in project jain-slee.diameter by RestComm.
the class S6aServerSessionImpl method createPurgeUEAnswer.
public PurgeUEAnswer createPurgeUEAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof PurgeUERequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
PurgeUEAnswer aia = (PurgeUEAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, PurgeUEAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(aia);
return aia;
} catch (InternalException e) {
logger.error("Failed to create Purge-UE-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationHostPUA.
@Test
public void hasDestinationHostPUA() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
serverSession.fetchSessionData(pur);
PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pua.getDestinationHost());
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasTFlagSetPUA.
@Test
public void hasTFlagSetPUA() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
((DiameterMessageImpl) pur).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Purge-UE-Request", pur.getHeader().isPotentiallyRetransmitted());
serverSession.fetchSessionData(pur);
PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
assertFalse("The 'T' flag should not be set in Purge-UE-Answer", pua.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationRealmPUA.
@Test
public void hasDestinationRealmPUA() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
serverSession.fetchSessionData(pur);
PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pua.getDestinationRealm());
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isProxiableCopiedPUA.
@Test
public void isProxiableCopiedPUA() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
serverSession.fetchSessionData(pur);
PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
assertEquals("The 'P' bit is not copied from request in Location-Info-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) pur).getGenericData().setProxiable(!pur.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Purge-UE-Request, it should.", pur.getHeader().isProxiable() != pua.getHeader().isProxiable());
serverSession.fetchSessionData(pur);
pua = serverSession.createPurgeUEAnswer();
assertEquals("The 'P' bit is not copied from request in Purge-UE-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
}
Aggregations