Search in sources :

Example 1 with UserDataAnswer

use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.

the class ShServerActivityImpl method createUserDataAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createUserDataAnswer(byte[])
   */
public UserDataAnswer createUserDataAnswer(byte[] userData) {
    // Fetch the session stored request
    UserDataRequest req = (UserDataRequest) getSessionMessage(UserDataRequest.commandCode);
    UserDataAnswer answer = null;
    if (req != null) {
        // Create answer from it
        answer = this.messageFactory.createUserDataAnswer(req, userData);
        // Add any extra session data
        addSessionData(answer);
    // Store request data FIXME: Commented by Alex. Is this needed?
    // ((DiameterShMessageImpl)answer).setData(req);
    }
    return answer;
}
Also used : UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) UserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer)

Example 2 with UserDataAnswer

use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.

the class ShServerActivityImpl method createUserDataAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createUserDataAnswer(long, boolean)
   */
public UserDataAnswer createUserDataAnswer(long resultCode, boolean isExperimentalResult) {
    // Fetch the session stored request
    UserDataRequest req = (UserDataRequest) getSessionMessage(UserDataRequest.commandCode);
    UserDataAnswer answer = null;
    if (req != null) {
        // Create answer from it
        answer = this.messageFactory.createUserDataAnswer(req, resultCode, isExperimentalResult);
        // Add any extra session data
        addSessionData(answer);
    // Store request data FIXME: Commented by Alex. Is this needed?
    // ((DiameterShMessageImpl)answer).setData(req);
    }
    return answer;
}
Also used : UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) UserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer)

Example 3 with UserDataAnswer

use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.

the class ShServerActivityImpl method createUserDataAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createUserDataAnswer()
   */
public UserDataAnswer createUserDataAnswer() {
    // Fetch the session stored request
    UserDataRequest req = (UserDataRequest) getSessionMessage(UserDataAnswer.commandCode);
    UserDataAnswer answer = null;
    if (req != null) {
        // Create answer from it
        answer = this.messageFactory.createUserDataAnswer(req);
        // Add any extra session data
        addSessionData(answer);
    // Store request data FIXME: Commented by Alex. Is this needed?
    // ((DiameterShMessageImpl)answer).setData(req);
    }
    return answer;
}
Also used : UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) UserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer)

Example 4 with UserDataAnswer

use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.

the class ShServerSubscriptionActivityImpl method createUserDataAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#createUserDataAnswer()
   */
public UserDataAnswer createUserDataAnswer() {
    UserDataAnswer answer = null;
    for (int index = 0; index < stateMessages.size(); index++) {
        if (stateMessages.get(index).getCommand().getCode() == UserDataRequest.commandCode) {
            UserDataRequest msg = (UserDataRequest) stateMessages.get(index);
            answer = this.messageFactory.createUserDataAnswer(msg);
            if (answer.getAuthSessionState() == null && this.authSessionState != null) {
                answer.setAuthSessionState(this.authSessionState);
            }
            ((DiameterShMessageImpl) answer).setData(msg);
            break;
        }
    }
    // answer.setSessionId(super.session.getSessionId());
    return answer;
}
Also used : UserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterShMessageImpl(org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)

Example 5 with UserDataAnswer

use of net.java.slee.resource.diameter.sh.events.UserDataAnswer in project jain-slee.diameter by RestComm.

the class ShServerSubscriptionActivityImpl method createUserDataAnswer.

public UserDataAnswer createUserDataAnswer(byte[] userData) {
    UserDataAnswer answer = null;
    for (int index = 0; index < stateMessages.size(); index++) {
        if (stateMessages.get(index).getCommand().getCode() == UserDataRequest.commandCode) {
            UserDataRequest msg = (UserDataRequest) stateMessages.get(index);
            answer = this.messageFactory.createUserDataAnswer(msg, userData);
            if (answer.getAuthSessionState() == null && this.authSessionState != null) {
                answer.setAuthSessionState(this.authSessionState);
            }
            ((DiameterShMessageImpl) answer).setData(msg);
            break;
        }
    }
    // answer.setSessionId(super.session.getSessionId());
    return answer;
}
Also used : UserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterShMessageImpl(org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)

Aggregations

UserDataAnswer (net.java.slee.resource.diameter.sh.events.UserDataAnswer)18 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)9 Test (org.junit.Test)9 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)9 DiameterShMessageImpl (org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)5 IOException (java.io.IOException)2 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)2 ProfileUpdateAnswer (net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer)2 SubscribeNotificationsAnswer (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsAnswer)2 Answer (org.jdiameter.api.Answer)2 ApplicationId (org.jdiameter.api.ApplicationId)2 UserDataAnswerImpl (org.jdiameter.common.impl.app.sh.UserDataAnswerImpl)2 ShServerMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.server.ShServerMessageFactoryImpl)2 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)1