Search in sources :

Example 6 with SessionTerminationAnswer

use of net.java.slee.resource.diameter.base.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method testGettersAndSettersSTA.

@Test
public void testGettersAndSettersSTA() throws Exception {
    SessionTerminationAnswer str = messageFactory.createSessionTerminationAnswer(messageFactory.createSessionTerminationRequest());
    int nFailures = AvpAssistant.INSTANCE.testMethods(str, SessionTerminationAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) Test(org.junit.Test)

Example 7 with SessionTerminationAnswer

use of net.java.slee.resource.diameter.base.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.

the class AuthServerSessionActivityImpl method sendSessionTerminationAnswer.

public void sendSessionTerminationAnswer(SessionTerminationAnswer request) throws IOException {
    try {
        // super.sendMessage(request);
        DiameterMessageImpl msg = (DiameterMessageImpl) request;
        this.serverSession.sendSessionTerminationAnswer(new SessionTermAnswerImpl((Answer) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : Answer(org.jdiameter.api.Answer) SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) SessionTermAnswerImpl(org.jdiameter.common.impl.app.auth.SessionTermAnswerImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Example 8 with SessionTerminationAnswer

use of net.java.slee.resource.diameter.base.events.SessionTerminationAnswer in project jain-slee.diameter by RestComm.

the class DiameterMessageFactoryImpl method createSessionTerminationAnswer.

public SessionTerminationAnswer createSessionTerminationAnswer(SessionTerminationRequest request, DiameterAvp[] avps) throws AvpNotAllowedException {
    SessionTerminationAnswer msg = (SessionTerminationAnswer) this.createDiameterMessage(request.getHeader(), avps, Message.SESSION_TERMINATION_REQUEST, getApplicationId(request));
    // Add Session-Id AVP if not present
    addSessionIdAvp(msg);
    return msg;
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer)

Aggregations

SessionTerminationAnswer (net.java.slee.resource.diameter.base.events.SessionTerminationAnswer)8 Test (org.junit.Test)6 SessionTerminationRequest (net.java.slee.resource.diameter.base.events.SessionTerminationRequest)2 IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 SessionTermAnswerImpl (org.jdiameter.common.impl.app.auth.SessionTermAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1