use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class HSSClientChildSbb method updatePSIActivation.
public String updatePSIActivation(String publicIdentity, String data, String destinationRealm, String destinationHost) throws IOException {
UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);
ProfileUpdateRequest pur = diameterShClientMessageFactory.createProfileUpdateRequest(publicIdentityAvp, DataReferenceType.PSI_ACTIVATION, data.getBytes());
pur.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
// Set destination -- Realm is mandatory, host is optional
pur.setDestinationRealm(new DiameterIdentity(destinationRealm));
if (destinationHost != null) {
pur.setDestinationHost(new DiameterIdentity(destinationHost));
}
ShClientActivity activity = getShClientActivity();
activity.sendProfileUpdateRequest(pur);
// Store request for future matching
storeRequestInACI(activity, pur);
// Return Session-Id, may be used as identifier
return activity.getSessionId();
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class HSSClientChildSbb method updateRepositoryData.
public String updateRepositoryData(String publicIdentity, String data, String destinationRealm, String destinationHost) throws IOException {
UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);
ProfileUpdateRequest pur = diameterShClientMessageFactory.createProfileUpdateRequest(publicIdentityAvp, DataReferenceType.REPOSITORY_DATA, data.getBytes());
pur.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
// Set destination -- Realm is mandatory, host is optional
pur.setDestinationRealm(new DiameterIdentity(destinationRealm));
if (destinationHost != null) {
pur.setDestinationHost(new DiameterIdentity(destinationHost));
}
ShClientActivity activity = getShClientActivity();
activity.sendProfileUpdateRequest(pur);
// Store request for future matching
storeRequestInACI(activity, pur);
// Return Session-Id, may be used as identifier
return activity.getSessionId();
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShServerActivityImpl method createProfileUpdateAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createProfileUpdateAnswer()
*/
public ProfileUpdateAnswer createProfileUpdateAnswer() {
// Fetch the session stored request
ProfileUpdateRequest req = (ProfileUpdateRequest) getSessionMessage(ProfileUpdateRequest.commandCode);
ProfileUpdateAnswer answer = null;
if (req != null) {
// Create answer from it
answer = this.messageFactory.createProfileUpdateAnswer(req);
// Add any extra session data
addSessionData(answer);
// Store request data FIXME: Commented by Alex. Is this needed?
// ((DiameterShMessageImpl)answer).setData(req);
}
return answer;
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShClientActivityImpl method sendProfileUpdateRequest.
public void sendProfileUpdateRequest(ProfileUpdateRequest message) throws IOException {
try {
DiameterMessageImpl msg = (DiameterMessageImpl) message;
clientSession.sendProfileUpdateRequest(new ProfileUpdateRequestImpl((Request) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
throw new IOException("Failed to send message, due to: " + e.getLocalizedMessage());
}
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest in project jain-slee.diameter by RestComm.
the class ShClientMessageFactoryImpl method createProfileUpdateRequest.
public ProfileUpdateRequest createProfileUpdateRequest(UserIdentityAvp userIdentity, DataReferenceType reference, byte[] userData) {
ProfileUpdateRequest pur = this.createProfileUpdateRequest();
pur.setUserIdentity(userIdentity);
pur.setDataReference(reference);
pur.setUserData(userData);
return pur;
}
Aggregations