use of net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method testGettersAndSettersSTA.
@Test
public void testGettersAndSettersSTA() throws Exception {
SessionTerminationAnswer sta = rxMessageFactory.createSessionTerminationAnswer(rxMessageFactory.createSessionTerminationRequest());
int nFailures = RxAvpAssistant.INSTANCE.testMethods(sta, SessionTerminationAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.
the class RxServerSessionActivityImpl method sendSessionTermAnswer.
/**
* {@inheritDoc}
*/
@Override
public void sendSessionTermAnswer(final SessionTerminationAnswer sta) throws IOException {
fetchCurrentState(sta);
final DiameterMessageImpl msg = (DiameterMessageImpl) sta;
try {
session.sendSessionTermAnswer(new RxSessionTermAnswerImpl((Answer) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
final AvpNotAllowedException anae = new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
throw anae;
} catch (Exception e) {
throw new IOException("Failed to send message.", e);
}
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.
the class RxServerSessionActivityImpl method createSessionTermAnswer.
/**
* {@inheritDoc}
*/
@Override
public SessionTerminationAnswer createSessionTermAnswer() {
if (lastSessionTermRequest == null) {
if (logger.isInfoEnabled()) {
logger.info("No request received, cant create answer.");
}
return null;
}
SessionTerminationAnswer answer = null;
answer = ((RxMessageFactoryImpl) getRxMessageFactory()).createSessionTerminationAnswer(lastSessionTermRequest);
return answer;
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method isAnswerSTA.
// Session-Termination-Answer
@Test
public void isAnswerSTA() throws Exception {
SessionTerminationAnswer sta = rxMessageFactory.createSessionTerminationAnswer(rxMessageFactory.createSessionTerminationRequest());
assertFalse("Request Flag in Re-Auth-Answer is set.", sta.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method hasDestinationRealmSTA.
@Test
public void hasDestinationRealmSTA() throws Exception {
SessionTerminationAnswer sta = rxMessageFactory.createSessionTerminationAnswer(rxMessageFactory.createSessionTerminationRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", sta.getDestinationRealm());
}
Aggregations