Search in sources :

Example 6 with AuthenticationInformationAnswer

use of net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer in project jain-slee.diameter by RestComm.

the class S6aServerSessionImpl method createAuthenticationInformationAnswer.

public AuthenticationInformationAnswer createAuthenticationInformationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof AuthenticationInformationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        AuthenticationInformationAnswer aia = (AuthenticationInformationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, AuthenticationInformationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(aia);
        return aia;
    } catch (InternalException e) {
        logger.error("Failed to create Authentication-Information-Answer.", e);
    }
    return null;
}
Also used : AuthenticationInformationAnswer(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) AuthenticationInformationRequest(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationRequest) InternalException(org.jdiameter.api.InternalException)

Example 7 with AuthenticationInformationAnswer

use of net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method hasTFlagSetAIA.

@Test
public void hasTFlagSetAIA() throws Exception {
    AuthenticationInformationRequest air = s6aMessageFactory.createAuthenticationInformationRequest();
    ((DiameterMessageImpl) air).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Authentication-Information-Request", air.getHeader().isPotentiallyRetransmitted());
    serverSession.fetchSessionData(air);
    AuthenticationInformationAnswer aia = serverSession.createAuthenticationInformationAnswer();
    assertFalse("The 'T' flag should not be set in Authentication-Information-Answer", aia.getHeader().isPotentiallyRetransmitted());
}
Also used : AuthenticationInformationAnswer(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer) AuthenticationInformationRequest(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 8 with AuthenticationInformationAnswer

use of net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGettersAndSettersAIA.

@Test
public void testGettersAndSettersAIA() throws Exception {
    AuthenticationInformationRequest air = s6aMessageFactory.createAuthenticationInformationRequest();
    serverSession.fetchSessionData(air);
    AuthenticationInformationAnswer aia = serverSession.createAuthenticationInformationAnswer();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(aia, AuthenticationInformationAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : AuthenticationInformationAnswer(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer) AuthenticationInformationRequest(net.java.slee.resource.diameter.s6a.events.AuthenticationInformationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

AuthenticationInformationAnswer (net.java.slee.resource.diameter.s6a.events.AuthenticationInformationAnswer)8 AuthenticationInformationRequest (net.java.slee.resource.diameter.s6a.events.AuthenticationInformationRequest)8 Test (org.junit.Test)7 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)7 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 ApplicationId (org.jdiameter.api.ApplicationId)1 InternalException (org.jdiameter.api.InternalException)1 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)1