use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest in project jain-slee.diameter by RestComm.
the class CxDxMessageFactoryImpl method createRegistrationTerminationRequest.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxMessageFactory#createRegistrationTerminationRequest(java.lang.String)
*/
public RegistrationTerminationRequest createRegistrationTerminationRequest(String sessionId) throws IllegalArgumentException {
RegistrationTerminationRequest rtr = createRegistrationTerminationRequest();
rtr.setSessionId(sessionId);
return rtr;
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method createRegistrationTerminationRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createRegistrationTerminationRequest()
*/
public RegistrationTerminationRequest createRegistrationTerminationRequest() {
// Create the request
RegistrationTerminationRequest rtr = cxdxMessageFactory.createRegistrationTerminationRequest(super.getSessionId());
// Fill session related AVPs, if present
fillSessionAVPs(rtr);
return rtr;
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersRTR.
@Test
public void testGettersAndSettersRTR() throws Exception {
RegistrationTerminationRequest rtr = cxdxMessageFactory.createRegistrationTerminationRequest();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(rtr, RegistrationTerminationRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasTFlagSetRTA.
@Test
public void hasTFlagSetRTA() throws Exception {
RegistrationTerminationRequest rtr = cxdxMessageFactory.createRegistrationTerminationRequest();
((DiameterMessageImpl) rtr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Registration-Termination-Request", rtr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(rtr);
RegistrationTerminationAnswer rta = clientSession.createRegistrationTerminationAnswer();
assertFalse("The 'T' flag should not be set in Registration-Termination-Answer", rta.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testServerSessionApplicationIdChangeRTR.
@Test
public void testServerSessionApplicationIdChangeRTR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
RegistrationTerminationRequest originalRTR = serverSession.createRegistrationTerminationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalRTR);
// now we switch..
originalRTR = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
RegistrationTerminationRequest changedRTR = serverSession.createRegistrationTerminationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedRTR);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations