use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest 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.DeleteSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aMessageFactoryImpl method createDeleteSubscriberDataRequest.
public DeleteSubscriberDataRequest createDeleteSubscriberDataRequest(String sessionId) throws IllegalArgumentException {
DeleteSubscriberDataRequest dsr = createDeleteSubscriberDataRequest();
dsr.setSessionId(sessionId);
return dsr;
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testMessageFactoryApplicationIdChangeDSR.
@Test
public void testMessageFactoryApplicationIdChangeDSR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((S6aMessageFactoryImpl) s6aMessageFactory).getApplicationId();
boolean isAuth = originalAppId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
boolean isAcct = originalAppId.getAcctAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
boolean isVendor = originalAppId.getVendorId() != 0L;
assertTrue("Invalid Application-Id (" + originalAppId + "). Should only, and at least, contain either Auth or Acct value.", (isAuth && !isAcct) || (!isAuth && isAcct));
System.out.println("Default VENDOR-ID for S6a is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
DeleteSubscriberDataRequest originalDSR = s6aMessageFactory.createDeleteSubscriberDataRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalDSR);
// now we switch..
originalDSR = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
DeleteSubscriberDataRequest changedDSR = s6aMessageFactory.createDeleteSubscriberDataRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedDSR);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest 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.DeleteSubscriberDataRequest 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);
}
Aggregations