Search in sources :

Example 1 with DeleteSubscriberDataAnswer

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

the class S6aClientSessionImpl method createDeleteSubscriberDataAnswer.

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

Example 2 with DeleteSubscriberDataAnswer

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

the class S6aFactoriesTest method isAnswerDSA.

@Test
public void isAnswerDSA() throws Exception {
    DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
    clientSession.fetchSessionData(dsr);
    DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
    assertFalse("Request Flag in Delete-Subscriber-Data-Answer is set.", dsa.getHeader().isRequest());
}
Also used : DeleteSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer) DeleteSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with DeleteSubscriberDataAnswer

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

the class S6aFactoriesTest method testGettersAndSettersDSA.

@Test
public void testGettersAndSettersDSA() throws Exception {
    DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
    clientSession.fetchSessionData(dsr);
    DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(dsa, DeleteSubscriberDataAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : DeleteSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer) DeleteSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with DeleteSubscriberDataAnswer

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

the class S6aFactoriesTest method hasTFlagSetDSA.

@Test
public void hasTFlagSetDSA() throws Exception {
    DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
    ((DiameterMessageImpl) dsr).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Delete-Subscriber-Data-Request", dsr.getHeader().isPotentiallyRetransmitted());
    clientSession.fetchSessionData(dsr);
    DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
    assertFalse("The 'T' flag should not be set in Delete-Subscriber-Data-Answer", dsa.getHeader().isPotentiallyRetransmitted());
}
Also used : DeleteSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer) DeleteSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with DeleteSubscriberDataAnswer

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

the class S6aFactoriesTest method hasDestinationRealmDSA.

@Test
public void hasDestinationRealmDSA() throws Exception {
    DeleteSubscriberDataRequest dsr = s6aMessageFactory.createDeleteSubscriberDataRequest();
    clientSession.fetchSessionData(dsr);
    DeleteSubscriberDataAnswer dsa = clientSession.createDeleteSubscriberDataAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", dsa.getDestinationRealm());
}
Also used : DeleteSubscriberDataAnswer(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer) DeleteSubscriberDataRequest(net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

DeleteSubscriberDataAnswer (net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataAnswer)8 DeleteSubscriberDataRequest (net.java.slee.resource.diameter.s6a.events.DeleteSubscriberDataRequest)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