Search in sources :

Example 1 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest 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 UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest 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 UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest 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 UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest 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 UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest 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

UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)29 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)12 DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)10 ShClientActivity (net.java.slee.resource.diameter.sh.client.ShClientActivity)10 Test (org.junit.Test)10 UserDataAnswer (net.java.slee.resource.diameter.sh.events.UserDataAnswer)9 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 ShClientMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.client.ShClientMessageFactoryImpl)3 DiameterShMessageImpl (org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)3 ShServerMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.server.ShServerMessageFactoryImpl)3 ArrayList (java.util.ArrayList)2 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)2 ProfileUpdateRequest (net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest)2 SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)2 ApplicationId (org.jdiameter.api.ApplicationId)2 ServerShSession (org.jdiameter.api.sh.ServerShSession)2 ShServerSessionDataLocalImpl (org.jdiameter.server.impl.app.sh.ShServerSessionDataLocalImpl)2 ShServerSessionImpl (org.jdiameter.server.impl.app.sh.ShServerSessionImpl)2 DiameterMessageFactoryImpl (org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl)2 ShClientActivityAnswerCreationTest (org.mobicents.slee.resource.diameter.sh.client.tests.activities.ShClientActivityAnswerCreationTest)2