use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest in project jain-slee.diameter by RestComm.
the class CxDxClientSessionImpl method createMultimediaAuthenticationRequest.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxClientSession#createMultimediaAuthenticationRequest()
*/
public MultimediaAuthenticationRequest createMultimediaAuthenticationRequest() {
// Create the request
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest(super.getSessionId());
// Fill session related AVPs, if present
fillSessionAVPs(mar);
return mar;
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest in project jain-slee.diameter by RestComm.
the class CxDxMessageFactoryImpl method createMultimediaAuthenticationRequest.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxMessageFactory#createMultimediaAuthenticationRequest(java.lang.String)
*/
public MultimediaAuthenticationRequest createMultimediaAuthenticationRequest(String sessionId) throws IllegalArgumentException {
MultimediaAuthenticationRequest mar = createMultimediaAuthenticationRequest();
mar.setSessionId(sessionId);
return mar;
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method createMultimediaAuthenticationAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createMultimediaAuthenticationAnswer()
*/
public MultimediaAuthenticationAnswer createMultimediaAuthenticationAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof MultimediaAuthenticationRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
MultimediaAuthenticationAnswer maa = (MultimediaAuthenticationAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, MultimediaAuthenticationAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(maa);
return maa;
} catch (InternalException e) {
logger.error("Failed to create Multimedia-Authentication-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isRequestMAR.
@Test
public void isRequestMAR() throws Exception {
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest();
assertTrue("Request Flag in Multimedia-Authentication-Request is not set.", mar.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.cxdx.events.MultimediaAuthenticationRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testMessageFactoryApplicationIdChangeMAR.
@Test
public void testMessageFactoryApplicationIdChangeMAR() 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...
MultimediaAuthenticationRequest originalMAR = cxdxMessageFactory.createMultimediaAuthenticationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalMAR);
// now we switch..
originalMAR = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
MultimediaAuthenticationRequest changedMAR = cxdxMessageFactory.createMultimediaAuthenticationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedMAR);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations