Search in sources :

Example 6 with SessionTerminationAnswer

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);
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with SessionTerminationAnswer

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);
    }
}
Also used : AAAnswer(net.java.slee.resource.diameter.rx.events.AAAnswer) SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer) Answer(org.jdiameter.api.Answer) RxSessionTermAnswerImpl(org.jdiameter.common.impl.app.rx.RxSessionTermAnswerImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException)

Example 8 with SessionTerminationAnswer

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;
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer)

Example 9 with SessionTerminationAnswer

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());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 10 with SessionTerminationAnswer

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());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

SessionTerminationAnswer (net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer)10 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 SessionTerminationRequest (net.java.slee.resource.diameter.rx.events.SessionTerminationRequest)3 ApplicationId (org.jdiameter.api.ApplicationId)2 RxMessageFactoryImpl (org.mobicents.slee.resource.diameter.rx.RxMessageFactoryImpl)2 IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 AAAnswer (net.java.slee.resource.diameter.rx.events.AAAnswer)1 Answer (org.jdiameter.api.Answer)1 RxSessionTermAnswerImpl (org.jdiameter.common.impl.app.rx.RxSessionTermAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1