Search in sources :

Example 11 with LocationInfoRequest

use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest in project jain-slee.diameter by RestComm.

the class CxDxServerSessionImpl method createLocationInfoAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createLocationInfoAnswer()
   */
public LocationInfoAnswer createLocationInfoAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof LocationInfoRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        LocationInfoAnswer lia = (LocationInfoAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, LocationInfoAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(lia);
        return lia;
    } catch (InternalException e) {
        logger.error("Failed to create Location-Info-Answer.", e);
    }
    return null;
}
Also used : LocationInfoRequest(net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) LocationInfoAnswer(net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer) InternalException(org.jdiameter.api.InternalException)

Aggregations

LocationInfoRequest (net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest)11 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 LocationInfoAnswer (net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer)4 ApplicationId (org.jdiameter.api.ApplicationId)3 CxDxMessageFactoryImpl (org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl)3 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1