use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest 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.PurgeUERequest 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.PurgeUERequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testGettersAndSettersPUR.
@Test
public void testGettersAndSettersPUR() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
int nFailures = S6aAvpAssistant.INSTANCE.testMethods(pur, PurgeUERequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isRequestPUR.
@Test
public void isRequestPUR() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
assertTrue("Request Flag in Purge-UE-Request is not set.", pur.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest 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());
}
Aggregations