use of net.java.slee.resource.diameter.cxdx.events.PushProfileRequest in project jain-slee.diameter by RestComm.
the class CxDxClientSessionImpl method createPushProfileAnswer.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxClientSession#createPushProfileAnswer()
*/
public PushProfileAnswer createPushProfileAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof PushProfileRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
PushProfileAnswer ppa = (PushProfileAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, PushProfileAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(ppa);
return ppa;
} catch (InternalException e) {
logger.error("Failed to create Push-Profile-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.cxdx.events.PushProfileRequest in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method createPushProfileRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createPushProfileRequest()
*/
public PushProfileRequest createPushProfileRequest() {
// Create the request
PushProfileRequest ppr = cxdxMessageFactory.createPushProfileRequest(super.getSessionId());
// Fill session related AVPs, if present
fillSessionAVPs(ppr);
return ppr;
}
use of net.java.slee.resource.diameter.cxdx.events.PushProfileRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isProxiableCopiedPPA.
@Test
public void isProxiableCopiedPPA() throws Exception {
PushProfileRequest ppr = cxdxMessageFactory.createPushProfileRequest();
clientSession.fetchSessionData(ppr);
PushProfileAnswer ppa = clientSession.createPushProfileAnswer();
assertEquals("The 'P' bit is not copied from request in Push-Profile-Answer, it should. [RFC3588/6.2]", ppr.getHeader().isProxiable(), ppa.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) ppr).getGenericData().setProxiable(!ppr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Push-Profile-Request, it should.", ppr.getHeader().isProxiable() != ppa.getHeader().isProxiable());
clientSession.fetchSessionData(ppr);
ppa = clientSession.createPushProfileAnswer();
assertEquals("The 'P' bit is not copied from request in Push-Profile-Answer, it should. [RFC3588/6.2]", ppr.getHeader().isProxiable(), ppa.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.cxdx.events.PushProfileRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasTFlagSetPPA.
@Test
public void hasTFlagSetPPA() throws Exception {
PushProfileRequest ppr = cxdxMessageFactory.createPushProfileRequest();
((DiameterMessageImpl) ppr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Push-Profile-Request", ppr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(ppr);
PushProfileAnswer ppa = clientSession.createPushProfileAnswer();
assertFalse("The 'T' flag should not be set in Push-Profile-Answer", ppa.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.cxdx.events.PushProfileRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersPPR.
@Test
public void testGettersAndSettersPPR() throws Exception {
PushProfileRequest ppr = cxdxMessageFactory.createPushProfileRequest();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(ppr, PushProfileRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Aggregations