use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method createDeleteSubscriberDataAnswer.
public DeleteSubscriberDataAnswer createDeleteSubscriberDataAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof DeleteSubscriberDataRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
DeleteSubscriberDataAnswer dsa = (DeleteSubscriberDataAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, DeleteSubscriberDataAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(dsa);
return dsa;
} catch (InternalException e) {
logger.error("Failed to create Delete-Subscriber-Data-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isAnswerDSA.
@Test
public void isAnswerDSA() throws Exception {
DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
clientSession.fetchSessionData(dsr);
DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
assertFalse("Request Flag in Delete-Subscriber-Data-Answer is set.", dsa.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testGettersAndSettersDSA.
@Test
public void testGettersAndSettersDSA() throws Exception {
DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
clientSession.fetchSessionData(dsr);
DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
int nFailures = S6aAvpAssistant.INSTANCE.testMethods(dsa, DeleteSubscriberDataAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasTFlagSetDSA.
@Test
public void hasTFlagSetDSA() throws Exception {
DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
((DiameterMessageImpl) dsr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Delete-Subscriber-Data-Request", dsr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(dsr);
DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
assertFalse("The 'T' flag should not be set in Delete-Subscriber-Data-Answer", dsa.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationRealmDSA.
@Test
public void hasDestinationRealmDSA() throws Exception {
DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
clientSession.fetchSessionData(dsr);
DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", dsa.getDestinationRealm());
}
Aggregations