Search in sources :

Example 1 with PurgeUERequest

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

the class S6aServerSessionImpl method createPurgeUEAnswer.

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

Example 2 with PurgeUERequest

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

the class S6aFactoriesTest method hasDestinationHostPUA.

@Test
public void hasDestinationHostPUA() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pua.getDestinationHost());
}
Also used : PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with PurgeUERequest

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

the class S6aFactoriesTest method testGettersAndSettersPUR.

@Test
public void testGettersAndSettersPUR() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(pur, PurgeUERequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with PurgeUERequest

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

the class S6aFactoriesTest method isRequestPUR.

@Test
public void isRequestPUR() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    assertTrue("Request Flag in Purge-UE-Request is not set.", pur.getHeader().isRequest());
}
Also used : PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with PurgeUERequest

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

the class S6aFactoriesTest method hasTFlagSetPUA.

@Test
public void hasTFlagSetPUA() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    ((DiameterMessageImpl) pur).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Purge-UE-Request", pur.getHeader().isPotentiallyRetransmitted());
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
    assertFalse("The 'T' flag should not be set in Purge-UE-Answer", pua.getHeader().isPotentiallyRetransmitted());
}
Also used : PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

PurgeUERequest (net.java.slee.resource.diameter.s6a.events.PurgeUERequest)13 Test (org.junit.Test)11 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)11 PurgeUEAnswer (net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer)8 ApplicationId (org.jdiameter.api.ApplicationId)2 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)2 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1