use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqSessionTerminationRequest.
@Override
public GqSessionTerminationRequest createGqSessionTerminationRequest() {
Message raw = createRequest(GqSessionTerminationRequest.COMMAND_CODE, new DiameterAvp[] {});
GqSessionTerminationRequest str = new GqSessionTerminationRequestImpl(raw);
if (sessionId != null) {
str.setSessionId(sessionId);
}
addOrigin(str);
return str;
}
use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqSessionTerminationRequest.
@Override
public GqSessionTerminationRequest createGqSessionTerminationRequest(String sessionId) {
Message raw = createRequest(GqSessionTerminationRequest.COMMAND_CODE, new DiameterAvp[] {});
GqSessionTerminationRequest str = new GqSessionTerminationRequestImpl(raw);
str.setSessionId(sessionId);
addOrigin(str);
return str;
}
use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method testMessageFactoryApplicationIdChangeSTR.
@Test
public void testMessageFactoryApplicationIdChangeSTR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GqMessageFactoryImpl) gqMessageFactory).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 Gq is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GqSessionTerminationRequest originalSTR = gqMessageFactory.createGqSessionTerminationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalSTR);
// now we switch..
originalSTR = null;
isVendor = !isVendor;
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GqSessionTerminationRequest changedSTR = gqMessageFactory.createGqSessionTerminationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedSTR);
// revert back to default
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method testGettersAndSettersSTR.
@Test
public void testGettersAndSettersSTR() throws Exception {
GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
int nFailures = GqAvpAssistant.INSTANCE.testMethods(str, GqSessionTerminationRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Aggregations